11 #ifndef __UT_FILEBUF_H_INCLUDED__
12 #define __UT_FILEBUF_H_INCLUDED__
54 return (myFile != NULL);
66 {
return open(filename.c_str(),
mode, mode_type); }
81 bool setFileAsSparse();
91 int mode = (buf == NULL && n == 0) ? _IONBF : _IOFBF;
92 return (::setvbuf(myFile, buf, mode, n) == 0) ?
this : NULL;
98 OPEN_MODE = IOS_BASE::in | IOS_BASE::out)
override
115 return (SYSfseek(myFile, off, whence) == 0)
123 OPEN_MODE = IOS_BASE::in | IOS_BASE::out)
override
126 return (SYSfseek(myFile, off,
SEEK_SET) == 0)
140 return (::fflush(myFile) == 0) ? 0 : -1;
147 if (::putc(ch, myFile) == ch)
149 return traits_type::eof();
157 return ::fwrite(buf,
sizeof(
char), n, myFile);
165 return ::fread(buf,
sizeof(
char), n, myFile);
174 if (::ungetc(ch, myFile) == ch)
177 return traits_type::eof();
186 return traits_type::eof();
193 if (::ungetc(ch, myFile) == ch)
195 return traits_type::eof();
201 static const char *
const theBinaryCharModes[];
202 static const char *
const theAsciiCharModes[];
203 static const OPEN_MODE theOpenModes[];
206 #endif // __UT_FILEBUF_H_INCLUDED__
GLenum GLuint GLenum GLsizei const GLchar * buf
GT_API const UT_StringHolder filename
int_type overflow(int_type ch=traits_type::eof()) override
GLsizei const GLchar *const * string
SUPER_CLASS * setbuf(char *buf, std::streamsize n) override
int_type uflow() override
pos_type seekoff(off_type off, IOS_BASE::seekdir way, OPEN_MODE=IOS_BASE::in|IOS_BASE::out) override
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
pos_type seekpos(pos_type off, OPEN_MODE=IOS_BASE::in|IOS_BASE::out) override
std::streamsize xsputn(const char *buf, std::streamsize n) override
FILE * open(const std::string &filename, OPEN_MODE mode, UT_IOS_TYPE mode_type=UT_IOS_BINARY)
std::ios_base::openmode OPEN_MODE
traits_type::off_type off_type
int_type underflow() override
std::streambuf SUPER_CLASS
traits_type::pos_type pos_type
traits_type::int_type int_type
std::streamsize xsgetn(char *buf, std::streamsize n) override
int_type pbackfail(int_type ch=traits_type::eof()) override