86 std::ios_base::openmode
mode;
93 setp(buffer, buffer + (bufferSize - 1));
103 inline gzstreambuf*
open(
const char* name, std::ios_base::openmode open_mode);
125 inline gzstreambase(
const char* name, std::ios_base::openmode open_mode);
127 inline void open(
const char* name, std::ios_base::openmode open_mode);
148 inline igzstream(
const char* name, std::ios_base::openmode _open_mode = std::ios::in)
156 inline void open(
const char* name, std::ios_base::openmode _open_mode = std::ios::in)
168 inline ogzstream(
const char* name, std::ios_base::openmode
mode = std::ios::out)
176 inline void open(
const char* name, std::ios_base::openmode _open_mode = std::ios::out)
190 if((
mode & std::ios::ate) || (
mode & std::ios::app) || ((
mode & std::ios::in) && (
mode & std::ios::out)))
195 char* fmodeptr = fmode;
196 if(
mode & std::ios::in)
200 else if(
mode & std::ios::out)
206 file = gzopen(name, fmode);
221 if(gzclose(
file) == Z_OK)
231 if(gptr() && (gptr() < egptr()))
233 return *
reinterpret_cast<unsigned char*
>(gptr());
241 std::streamsize n_putback = gptr() - eback();
246 memcpy(
buffer + (4 - static_cast<size_t>(n_putback)), gptr() - static_cast<size_t>(n_putback),
247 static_cast<size_t>(n_putback));
256 setg(
buffer + (4 - n_putback),
261 return *
reinterpret_cast<unsigned char*
>(gptr());
268 auto w =
static_cast<int>(pptr() - pbase());
269 if(gzwrite(
file, pbase(), static_cast<unsigned int>(w)) != w)
285 *pptr() =
static_cast<char>(c);
300 if(pptr() && pptr() > pbase())
328 if(!buf.open(name, _open_mode))
330 clear(rdstate() | std::ios::badbit);
340 clear(rdstate() | std::ios::badbit);
The big change with respect to the original code is a refactoring for a header based library...
Definition of hash function for EdgeDescriptor.
igzstream(const char *name, std::ios_base::openmode _open_mode=std::ios::in)
void open(const char *name, std::ios_base::openmode _open_mode=std::ios::out)
void open(const char *name, std::ios_base::openmode _open_mode=std::ios::in)
void open(const char *name, std::ios_base::openmode open_mode)
std::ios_base::openmode mode
void init(int bucket[BUCKETSIZE])
ogzstream(const char *name, std::ios_base::openmode mode=std::ios::out)
static const int bufferSize
int overflow(int c=EOF) override
gzstreambuf * open(const char *name, std::ios_base::openmode open_mode)