Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Public Attributes | List of all members
gzstream Struct Reference
Inheritance diagram for gzstream:
stream

Public Types

enum  { MAGIC1 = 0x1F, MAGIC2 = 0x8B, BUFSIZE = 16384, OS_UNIX = 0x03 }
 
enum  {
  F_ASCII = 0x01, F_CRC = 0x02, F_EXTRA = 0x04, F_NAME = 0x08,
  F_COMMENT = 0x10, F_RESERVED = 0xE0
}
 
typedef off_t offset
 

Public Member Functions

 gzstream ()
 
 ~gzstream () override
 
void writeheader ()
 
void readbuf (size_t size=BUFSIZE)
 
uchar readbyte (size_t size=BUFSIZE)
 
void skipbytes (size_t n)
 
bool checkheader ()
 
bool open (stream *f, const char *mode, bool needclose, int level)
 
uint getcrc () override
 
void finishreading ()
 
void stopreading ()
 
void finishwriting ()
 
void stopwriting ()
 
void close () override
 
bool end () override
 
offset tell () override
 
offset rawtell () override
 
offset size () override
 
offset rawsize () override
 
bool seek (offset pos, int whence) override
 
size_t read (void *buf, size_t len) override
 
bool flushbuf (bool full=false)
 
bool flush () override
 
size_t write (const void *buf, size_t len) override
 
virtual int getchar ()
 
virtual bool putchar (int n)
 
virtual bool getline (char *str, size_t len)
 
virtual bool putstring (const char *str)
 
virtual bool putline (const char *str)
 
virtual size_t printf (const char *fmt,...) PRINTFARGS(2
 
template<class T >
size_t put (const T *v, size_t n)
 
template<class T >
bool put (T n)
 
template<class T >
bool putlil (T n)
 
template<class T >
bool putbig (T n)
 
template<class T >
size_t get (T *v, size_t n)
 
template<class T >
get ()
 
template<class T >
getlil ()
 
template<class T >
getbig ()
 

Public Attributes

streamfile
 
z_stream zfile
 
ucharbuf
 
bool reading
 
bool writing
 
bool autoclose
 
uint crc
 
size_t headersize
 

Member Typedef Documentation

typedef off_t stream::offset
inherited

Member Enumeration Documentation

anonymous enum
Enumerator
MAGIC1 
MAGIC2 
BUFSIZE 
OS_UNIX 
anonymous enum
Enumerator
F_ASCII 
F_CRC 
F_EXTRA 
F_NAME 
F_COMMENT 
F_RESERVED 

Constructor & Destructor Documentation

gzstream::gzstream ( )
inline

References zfile.

gzstream::~gzstream ( )
inlineoverride

References close().

Member Function Documentation

bool gzstream::checkheader ( )
inline
void gzstream::close ( )
inlineoverridevirtual
bool gzstream::end ( )
inlineoverridevirtual

Implements stream.

References reading, and writing.

void gzstream::finishreading ( )
inline

References crc, inexor::util::log_manager::io, Log, loopi(), readbyte(), reading, and zfile.

Referenced by close(), and read().

void gzstream::finishwriting ( )
inline

References crc, file, flushbuf(), stream::write(), writing, and zfile.

Referenced by close().

bool gzstream::flush ( )
inlineoverridevirtual

Reimplemented from stream.

References flushbuf().

bool gzstream::flushbuf ( bool  full = false)
inline

References buf, BUFSIZE, file, stream::flush(), stream::write(), and zfile.

Referenced by finishwriting(), flush(), and write().

template<class T >
size_t stream::get ( T *  v,
size_t  n 
)
inlineinherited

References stream::read().

Referenced by streambuf< T >::get().

template<class T >
T stream::get ( )
inlineinherited

References stream::read().

template<class T >
T stream::getbig ( )
inlineinherited

References bigswap().

virtual int stream::getchar ( )
inlinevirtualinherited
uint gzstream::getcrc ( )
inlineoverridevirtual

Reimplemented from stream.

References crc.

template<class T >
T stream::getlil ( )
inlineinherited
bool stream::getline ( char *  str,
size_t  len 
)
virtualinherited
bool gzstream::open ( stream f,
const char *  mode,
bool  needclose,
int  level 
)
inline
size_t stream::printf ( const char *  fmt,
  ... 
)
virtualinherited
template<class T >
size_t stream::put ( const T *  v,
size_t  n 
)
inlineinherited

References stream::write().

Referenced by streambuf< T >::put().

template<class T >
bool stream::put ( n)
inlineinherited

References stream::write().

template<class T >
bool stream::putbig ( n)
inlineinherited

References bigswap().

Referenced by savepng(), and writepngchunk().

virtual bool stream::putchar ( int  n)
inlinevirtualinherited
template<class T >
bool stream::putlil ( n)
inlineinherited
virtual bool stream::putline ( const char *  str)
inlinevirtualinherited
virtual bool stream::putstring ( const char *  str)
inlinevirtualinherited

Reimplemented in filestream.

References stream::write().

Referenced by stream::putline().

offset gzstream::rawsize ( )
inlineoverridevirtual

Reimplemented from stream.

References file, and stream::size().

offset gzstream::rawtell ( )
inlineoverridevirtual

Reimplemented from stream.

References file, and stream::tell().

size_t gzstream::read ( void buf,
size_t  len 
)
inlineoverridevirtual

Reimplemented from stream.

References BUFSIZE, crc, finishreading(), readbuf(), reading, stopreading(), and zfile.

Referenced by seek().

void gzstream::readbuf ( size_t  size = BUFSIZE)
inline
uchar gzstream::readbyte ( size_t  size = BUFSIZE)
inline

References readbuf(), and zfile.

Referenced by checkheader(), and finishreading().

bool gzstream::seek ( offset  pos,
int  whence 
)
inlineoverridevirtual

Reimplemented from stream.

References buf, crc, headersize, inexor::rpc::min(), read(), reading, stopreading(), writing, and zfile.

offset gzstream::size ( )
inlineoverridevirtual

Reimplemented from stream.

References file, stream::getlil(), stream::seek(), and tell().

void gzstream::skipbytes ( size_t  n)
inline

References file, inexor::rpc::min(), stream::seek(), and zfile.

Referenced by checkheader().

void gzstream::stopreading ( )
inline

References reading, and zfile.

Referenced by close(), open(), read(), and seek().

void gzstream::stopwriting ( )
inline

References writing, and zfile.

Referenced by close(), and write().

offset gzstream::tell ( )
inlineoverridevirtual

Reimplemented from stream.

References reading, writing, and zfile.

Referenced by size().

size_t gzstream::write ( const void buf,
size_t  len 
)
inlineoverridevirtual

Reimplemented from stream.

References crc, flushbuf(), stopwriting(), writing, and zfile.

void gzstream::writeheader ( )
inline

References file, MAGIC1, MAGIC2, OS_UNIX, and stream::write().

Referenced by open().

Member Data Documentation

bool gzstream::autoclose

Referenced by close(), and open().

uchar* gzstream::buf

Referenced by close(), flushbuf(), open(), readbuf(), and seek().

uint gzstream::crc
stream* gzstream::file
size_t gzstream::headersize

Referenced by checkheader(), and seek().

bool gzstream::reading
bool gzstream::writing
z_stream gzstream::zfile

The documentation for this struct was generated from the following file: