Abstract base class for I/O stream wrappers. More...
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... | |
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:
|
inline |
Default constructor
|
inlinevirtual |
Destructor
|
inlinevirtual |
Test stream integrity
Reimplemented in mootio::micbuffer, mootio::mcstream, mootio::mcxxstream< _StreamClass >, mootio::mcxxstream< std::istream >, mootio::mcxxstream< std::ostream >, and mootio::mzstream.
Referenced by moot::TokenWriterExpat::_put_sentence(), moot::TokenWriterExpat::_put_tokens(), errmsg(), moot::TokenReader::from_filename(), moot::TokenReader::opened(), moot::TokenWriter::opened(), operator bool(), moot::TokenWriter::to_filename(), and moot::TokenWriter::to_mstream().
|
inlinevirtual |
Test for eof
Reimplemented in mootio::micbuffer, mootio::mzstream, mootio::mcstream, mootio::mcxxstream< _StreamClass >, mootio::mcxxstream< std::istream >, and mootio::mcxxstream< std::ostream >.
|
inlinevirtual |
Get current error message, if any
Reimplemented in mootio::mzstream, and mootio::mcstream.
References valid().
|
inlinevirtual |
(Re-)open currently selected stream
Reimplemented in mootio::mzfstream, mootio::mfstream, mootio::mzstream, and mootio::mcstream.
|
inlinevirtual |
Close currently selected stream
Reimplemented in mootio::mzfstream, mootio::mfstream, mootio::mzstream, and mootio::mcstream.
Referenced by moot::TokenReader::close(), moot::TokenWriter::close(), moot::mootExpatParser::from_fd(), and moot::mootExpatParser::from_string().
std::string mootio::mstream::name |