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

Wrapper class for C FILE* streams.

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

Public Member Functions

Constructors etc.
 mcstream (FILE *f=__null)
 
 ~mcstream (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)
 
virtual bool vprintf (const char *fmt, va_list &ap)
 
- 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)
 
bool printf (const char *fmt,...)
 

Public Attributes

FILE * file
 underlying FILE* More...
 
- Public Attributes inherited from mootio::mstream
std::string name
 symbolic name of this stream More...
 

Constructor & Destructor Documentation

◆ mcstream()

mootio::mcstream::mcstream ( FILE *  f = __null)
inline

Default constructor

◆ ~mcstream()

mootio::mcstream::~mcstream ( void  )
inline

Destructor

Member Function Documentation

◆ valid()

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

Test stream integrity

Reimplemented from mootio::mstream.

◆ eof()

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

Test for eof

Reimplemented from mootio::mstream.

◆ errmsg()

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

Get current error message

Reimplemented from mootio::mstream.

◆ reopen()

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

Does nothing

Reimplemented from mootio::mstream.

Reimplemented in mootio::mfstream.

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

◆ close()

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

Just resets internal FILE* to NULL, does nothing else

Reimplemented from mootio::mstream.

Reimplemented in mootio::mfstream.

Referenced by mootio::mfstream::reopen(), mootio::mfstream::~mfstream(), mootio::mifstream::~mifstream(), and mootio::mofstream::~mofstream().

◆ read()

virtual ByteCount mootio::mcstream::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::mcstream::getbyte ( void  )
inlinevirtual

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

Reimplemented from mootio::mistream.

◆ flush()

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

Flush all pending writes.

Reimplemented from mootio::mostream.

◆ write()

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

Write n bytes from buf to the stream

Reimplemented from mootio::mostream.

◆ putbyte()

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

Write a single byte to the stream

Reimplemented from mootio::mostream.

◆ puts() [1/2]

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

Write a C string to the stream

Reimplemented from mootio::mostream.

◆ puts() [2/2]

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

Write a C++ string to the stream

Reimplemented from mootio::mostream.

References file.

◆ vprintf()

virtual bool mootio::mcstream::vprintf ( const char *  fmt,
va_list &  ap 
)
inlinevirtual

printf() to the stream, va_list version (the real thing)

Reimplemented from mootio::mostream.

Member Data Documentation

◆ file

FILE* mootio::mcstream::file

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