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

Abstract base class for I/O stream wrappers. More...

Inheritance diagram for mootio::mstream:
Inheritance graph
[legend]

Public Member Functions

Constructors etc.
 mstream (const std::string &myname="")
 
virtual ~mstream (void)
 
Integrity Tests
virtual bool valid (void)
 
 operator bool (void)
 
virtual bool eof (void)
 
virtual std::string errmsg (void)
 
Open/Close
virtual bool reopen (void)
 
virtual bool close (void)
 

Public Attributes

std::string name
 symbolic name of this stream More...
 

Detailed Description

This looks at first like a very ugly hack (which it admittedly is), since it reduces C++ iostreams to the low-level streambuf layer (which is all anyone ever really needs anyways), and wraps native C I/O calls in virtual methods (which are nasty icky OO and slow), so it gets us essentially the worst of both worlds. However:

Constructor & Destructor Documentation

◆ mstream()

mootio::mstream::mstream ( const std::string &  myname = "")
inline

Default constructor

◆ ~mstream()

virtual mootio::mstream::~mstream ( void  )
inlinevirtual

Destructor

Member Function Documentation

◆ valid()

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

◆ operator bool()

mootio::mstream::operator bool ( void  )
inline

Alias for valid()

References valid().

◆ eof()

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

◆ errmsg()

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

Get current error message, if any

Reimplemented in mootio::mzstream, and mootio::mcstream.

References valid().

◆ reopen()

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

(Re-)open currently selected stream

Reimplemented in mootio::mzfstream, mootio::mfstream, mootio::mzstream, and mootio::mcstream.

◆ close()

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

Member Data Documentation

◆ name

std::string mootio::mstream::name

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