27 #include <strstream.h> 35 # define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY) 37 # define SET_BINARY_MODE(file) 46 struct Val {
unsigned char byte;
size_t word; }
val;
97 const char*
error(
int* errnum) {
114 template <
class T,
class Items>
131 if (
val.byte == 255) zs >
val.word;
141 x[len.
value()] =
'\0';
147 char*
x =
new char[len.
value()+1];
149 x[len.
value()] =
'\0';
178 char mode[4] =
"wb\0";
188 char mode[4] =
"wb\0";
200 ::gzwrite(m_fp, m_os->str(), m_os->pcount());
201 delete[] m_os->str();
delete m_os; m_os = 0;
237 if (m_os == 0) m_os =
new ostrstream;
242 if (m_os && m_os->pcount()>0) {
243 ostrstream* oss =
new ostrstream;
244 oss->fill(m_os->fill());
245 oss->flags(m_os->flags());
246 oss->precision(m_os->precision());
247 oss->width(m_os->width());
248 ::gzwrite(m_fp, m_os->str(), m_os->pcount());
249 delete[] m_os->str();
delete m_os; m_os = oss;
263 template <
class T,
class Items>
278 val.byte = 255;
val.word = ::strlen(x);
279 if (
val.word < 255) zs < (
val.byte =
val.word);
294 return zs < (
const char*) x;
void open(const char *name, int level=Z_DEFAULT_COMPRESSION)
#define SET_BINARY_MODE(file)
void open(FILE *fp, int level=Z_DEFAULT_COMPRESSION)
void open(const char *name)
int ZEXPORT gzclose(gzFile file)
#define Z_DEFAULT_COMPRESSION
ozstream(FILE *fp, int level=Z_DEFAULT_COMPRESSION)
GLint GLint GLint GLint GLint x
int ZEXPORT gzwrite(gzFile file, voidpc buf, unsigned len)
GLenum GLuint GLenum GLsizei const GLchar * buf
const char * error(int *errnum)
int write(ozstream &zs, const T *x, Items items)
izstream & operator>(izstream &zs, T &x)
GLdouble GLdouble GLdouble r
ozstream & operator<(ozstream &zs, const T &x)
gzFile ZEXPORT gzdopen(int fd, const char *mode)
zstringlen(class izstream &)
int read(izstream &zs, T *x, Items items)
izstream(const char *name)
GLuint const GLchar * name
ostream & operator<<(ozstream &zs, const T &x)
const char * error(int *errnum)
const char *ZEXPORT gzerror(gzFile file, int *errnum)
int write(const void *buf, size_t len)
int ZEXPORT gzflush(gzFile file, int flush)
int open(const char *name, int flags, int mode)
int read(void *buf, size_t len)
char * read_string(izstream &zs)
gzFile ZEXPORT gzopen(char *path, const char *mode) const
ozstream(const char *name, int level=Z_DEFAULT_COMPRESSION)
int ZEXPORT gzread(gzFile file, voidp buf, unsigned len)