Further SG stream APIs
This commit is contained in:
@@ -198,12 +198,23 @@ sg_gzofstream::attach( int fd, ios_openmode io_mode )
|
|||||||
sg_ifstream::sg_ifstream(const SGPath& path, ios_openmode io_mode)
|
sg_ifstream::sg_ifstream(const SGPath& path, ios_openmode io_mode)
|
||||||
{
|
{
|
||||||
std::string ps = path.local8BitStr();
|
std::string ps = path.local8BitStr();
|
||||||
open(ps.c_str(), io_mode);
|
std::ifstream::open(ps.c_str(), io_mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void sg_ifstream::open( const SGPath& name, ios_openmode io_mode )
|
||||||
|
{
|
||||||
|
std::string ps = name.local8BitStr();
|
||||||
|
std::ifstream::open(ps.c_str(), io_mode);
|
||||||
|
}
|
||||||
|
|
||||||
sg_ofstream::sg_ofstream(const SGPath& path, ios_openmode io_mode)
|
sg_ofstream::sg_ofstream(const SGPath& path, ios_openmode io_mode)
|
||||||
{
|
{
|
||||||
std::string ps = path.local8BitStr();
|
std::string ps = path.local8BitStr();
|
||||||
open(ps.c_str(), io_mode);
|
std::ofstream::open(ps.c_str(), io_mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sg_ofstream::open( const SGPath& name, ios_openmode io_mode )
|
||||||
|
{
|
||||||
|
std::string ps = name.local8BitStr();
|
||||||
|
std::ofstream::open(ps.c_str(), io_mode);
|
||||||
}
|
}
|
||||||
@@ -175,14 +175,22 @@ private:
|
|||||||
class sg_ifstream : public std::ifstream
|
class sg_ifstream : public std::ifstream
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
sg_ifstream() {}
|
||||||
|
|
||||||
sg_ifstream(const SGPath& path, ios_openmode io_mode = ios_in | ios_binary);
|
sg_ifstream(const SGPath& path, ios_openmode io_mode = ios_in | ios_binary);
|
||||||
|
|
||||||
|
void open( const SGPath& name,
|
||||||
|
ios_openmode io_mode = ios_in|ios_binary );
|
||||||
};
|
};
|
||||||
|
|
||||||
class sg_ofstream : public std::ofstream
|
class sg_ofstream : public std::ofstream
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
sg_ofstream() { }
|
||||||
sg_ofstream(const SGPath& path, ios_openmode io_mode = ios_out | ios_binary);
|
sg_ofstream(const SGPath& path, ios_openmode io_mode = ios_out | ios_binary);
|
||||||
|
|
||||||
|
void open( const SGPath& name,
|
||||||
|
ios_openmode io_mode = ios_out|ios_binary );
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* _SGSTREAM_HXX */
|
#endif /* _SGSTREAM_HXX */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user