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

Wrapper class for named file i/o using C FILE*s. More...

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

Public Member Functions

Constructors etc.
 mfstream (void)
 
 mfstream (const char *filename, const char *open_mode=__null)
 
virtual ~mfstream (void)
 
Open / Close
bool open (const char *filename, const char *open_mode=__null)
 
bool open (const std::string &filename, const std::string &open_mode="")
 
virtual bool reopen (void)
 
virtual bool close (void)
 
Parameter setting (does nothing)
void setparams (int level=0, int strategy=0)
 
- Public Member Functions inherited from mootio::mcstream
 mcstream (FILE *f=__null)
 
 ~mcstream (void)
 
virtual bool valid (void)
 
virtual bool eof (void)
 
virtual std::string errmsg (void)
 
virtual ByteCount read (char *buf, size_t n)
 
virtual int getbyte (void)
 
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

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

Detailed Description

Uses mstream::name as filename identifier. The name "-" corresponds to either stdin or stdout, depending on open mode.

Constructor & Destructor Documentation

◆ mfstream() [1/2]

mootio::mfstream::mfstream ( void  )
inline

Default constructor as for mcstream

◆ mfstream() [2/2]

mootio::mfstream::mfstream ( const char *  filename,
const char *  open_mode = __null 
)
inline

Constructor given filename and mode

◆ ~mfstream()

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

Destructor: auto-closes file

References mootio::mcstream::close().

Member Function Documentation

◆ open() [1/2]

bool mootio::mfstream::open ( const char *  filename,
const char *  open_mode = __null 
)
inline

Open a named file, fopen() style. "-" may be use to specify stdin or stdout, depending on 'mode'

References mootio::mstream::name, and mootio::mcstream::reopen().

◆ open() [2/2]

bool mootio::mfstream::open ( const std::string &  filename,
const std::string &  open_mode = "" 
)
inline

Open a named file, fopen() style. "-" may be use to specify stdin or stdout, depending on open_mode

References mootio::mstream::name, and mootio::mcstream::reopen().

◆ reopen()

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

(Re-)open file name with mode mode

Reimplemented from mootio::mcstream.

References mootio::mcstream::close(), mootio::mcstream::file, and mootio::mstream::name.

◆ close()

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

Close currently open file, if any

Reimplemented from mootio::mcstream.

References mootio::mcstream::file.

◆ setparams()

void mootio::mfstream::setparams ( int  level = 0,
int  strategy = 0 
)
inline

Does nothing. For compatibility with (possibly missing) zlib

Member Data Documentation

◆ mode

std::string mootio::mfstream::mode

◆ default_mode

std::string mootio::mfstream::default_mode

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