11 #ifndef __UT_OFSTREAM_H_INCLUDED__
12 #define __UT_OFSTREAM_H_INCLUDED__
47 initOpen(filename,
mode, mode_type);
55 initOpen(filename.c_str(),
mode, mode_type);
71 initOpen(filename,
mode, mode_type);
76 initOpen(filename.c_str(),
mode, mode_type);
83 if (!myFileBuf.close())
84 SUPER_CLASS::setstate(IOS_BASE::failbit);
97 return myFileBuf.is_open();
103 mode |= IOS_BASE::out;
104 if (myFileBuf.open(filename, mode, mode_type) == 0)
105 setstate(IOS_BASE::failbit);
112 #endif // __UT_OFSTREAM_H_INCLUDED__
GT_API const UT_StringHolder filename
GLsizei const GLchar *const * string
void open(const std::string &filename, OPEN_MODE mode=IOS_BASE::out, UT_IOS_TYPE mode_type=UT_IOS_BINARY)
void close()
Close the stream.
UT_FileBuf * rdbuf() const
Return pointer to internal filebuf object.
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
std::ios_base::openmode OPEN_MODE
UT_OFStream(const char *filename, OPEN_MODE mode=IOS_BASE::out, UT_IOS_TYPE mode_type=UT_IOS_BINARY)
Portable replacement for std::ofstream.
UT_OFStream(const std::string &filename, OPEN_MODE mode=IOS_BASE::out, UT_IOS_TYPE mode_type=UT_IOS_BINARY)
bool is_open() const
Returns whether stream is currently associated to a file.
~UT_OFStream() override
Destructor.
UT_OFStream()
Construct with no opened file.