Public Attributes | List of all members
mootio::mzstream Class Reference

Wrapper class for C FILE* streams.

Inheritance diagram for mootio::mzstream:
Inheritance graph
[legend]
Collaboration diagram for mootio::mzstream:
Collaboration graph
[legend]

Public Member Functions

Constructors etc.
 mzstream (gzFile zf=__null)
 
 ~mzstream (void)
 
Integrity Tests
virtual bool valid (void)
 
virtual bool eof (void)
 
virtual std::string errmsg (void)
 
Open/Close
virtual bool reopen (void)
 
virtual bool close (void)
 
Input Methods
virtual ByteCount read (char *buf, size_t n)
 
virtual int getbyte (void)
 
Output Methods
virtual bool flush (void)
 
virtual bool write (const char *buf, size_t n)
 
virtual bool putbyte (unsigned char c)
 
virtual bool puts (const char *s)
 
virtual bool puts (const std::string &s)
 
- Public Member Functions inherited from mootio::mistream
 mistream (void)
 
virtual ~mistream (void)
 
virtual ByteCount getline (std::string &s, const std::string &delim="\")
 
- Public Member Functions inherited from mootio::mstream
 mstream (const std::string &myname="")
 
virtual ~mstream (void)
 
 operator bool (void)
 
- Public Member Functions inherited from mootio::mostream
 mostream (void)
 
virtual ~mostream (void)
 
virtual bool vprintf (const char *fmt, va_list &ap)
 
bool printf (const char *fmt,...)
 

Public Attributes

gzFile zfile
 underlying gzFile More...
 
- Public Attributes inherited from mootio::mstream
std::string name
 symbolic name of this stream More...
 

Constructor & Destructor Documentation

◆ mzstream()

mootio::mzstream::mzstream ( gzFile  zf = __null)
inline

Default constructor

◆ ~mzstream()

mootio::mzstream::~mzstream ( void  )
inline

Destructor

Member Function Documentation

◆ valid()

virtual bool mootio::mzstream::valid ( void  )
inlinevirtual

Test stream integrity

Reimplemented from mootio::mstream.

Referenced by mootio::mzfstream::reopen().

◆ eof()

virtual bool mootio::mzstream::eof ( void  )
inlinevirtual

Test for eof

Reimplemented from mootio::mstream.

◆ errmsg()

virtual std::string mootio::mzstream::errmsg ( void  )
inlinevirtual

Get current error message

Reimplemented from mootio::mstream.

◆ reopen()

virtual bool mootio::mzstream::reopen ( void  )
inlinevirtual

Does nothing

Reimplemented from mootio::mstream.

Reimplemented in mootio::mzfstream.

Referenced by mootio::mzfstream::open().

◆ close()

virtual bool mootio::mzstream::close ( void  )
inlinevirtual

Just resets internal gzFile to NULL, does nothing else

Reimplemented from mootio::mstream.

Reimplemented in mootio::mzfstream.

Referenced by mootio::mzfstream::reopen(), mootio::mizfstream::~mizfstream(), mootio::mozfstream::~mozfstream(), and mootio::mzfstream::~mzfstream().

◆ read()

virtual ByteCount mootio::mzstream::read ( char *  buf,
size_t  n 
)
inlinevirtual

Read up to n bytes of data into buf, returns number of bytes actually read.

Reimplemented from mootio::mistream.

◆ getbyte()

virtual int mootio::mzstream::getbyte ( void  )
inlinevirtual

Read a single byte of data. Returns EOF on eof.

Reimplemented from mootio::mistream.

References zfile.

◆ flush()

virtual bool mootio::mzstream::flush ( void  )
inlinevirtual

Flush all pending writes (degrades compression ratio).

Reimplemented from mootio::mostream.

◆ write()

virtual bool mootio::mzstream::write ( const char *  buf,
size_t  n 
)
inlinevirtual

Write n bytes from buf to the stream

Reimplemented from mootio::mostream.

◆ putbyte()

virtual bool mootio::mzstream::putbyte ( unsigned char  c)
inlinevirtual

Write a single byte to the stream

Reimplemented from mootio::mostream.

◆ puts() [1/2]

virtual bool mootio::mzstream::puts ( const char *  s)
inlinevirtual

Write a C string to the stream

Reimplemented from mootio::mostream.

◆ puts() [2/2]

virtual bool mootio::mzstream::puts ( const std::string &  s)
inlinevirtual

Write a C++ string to the stream

Reimplemented from mootio::mostream.

Member Data Documentation

◆ zfile

gzFile mootio::mzstream::zfile

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