mfstream Class Reference

Extension of fstream to commands. More...

#include <mfstream.h>

Collaboration diagram for mfstream:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 mfstream ()
 Creates and opens a file/command stream without a specified nmode.
 mfstream (const char *name, openmode mode)
 Creates and opens a file/command stream in a specified nmode.
 ~mfstream ()
 Closes and destroys a file/command stream.
void open (const char *name, openmode mode)
 Opens an existing mfstream.
void close ()
 Closes an existing mfstream.
mfstreamwritex (void *p, int sz, int n=1)
 Write function for machine-independent byte order.
mfstreamreadx (void *p, int sz, int n=1)
 Read function for machine-independent byte order.
mfstreamiwritex (streampos loc, void *ptr, int size, int n=1)
 Write function at a given stream position for machine-independent byte order.
streampos tellp ()
 Tells current position within a file.
mfstreamseekp (streampos loc)
 Seeks a position within a file.
mfstreamreopen ()
 Reopens an input stream.

Public Attributes

char _cmdname [500]

Protected Member Functions

int swapbytes (char *p, int sz, int n)

Protected Attributes

fdbufbuf
int _cmd
openmode _mode
FILE * _FILE


Detailed Description

Extension of fstream to commands.

Definition at line 148 of file mfstream.h.


Constructor & Destructor Documentation

mfstream::mfstream (  )  [inline]

Creates and opens a file/command stream without a specified nmode.

Definition at line 165 of file mfstream.h.

mfstream::mfstream ( const char *  name,
openmode  mode 
) [inline]

Creates and opens a file/command stream in a specified nmode.

Definition at line 169 of file mfstream.h.

References _cmdname, _mode, and open().

Here is the call graph for this function:

mfstream::~mfstream (  )  [inline]

Closes and destroys a file/command stream.

Definition at line 176 of file mfstream.h.

References _cmd, and close().

Here is the call graph for this function:


Member Function Documentation

void mfstream::close (  ) 

mfstream & mfstream::iwritex ( streampos  loc,
void *  ptr,
int  size,
int  n = 1 
)

Write function at a given stream position for machine-independent byte order.

Definition at line 91 of file mfstream.cpp.

References seekp(), tellp(), and writex().

Here is the call graph for this function:

void mfstream::open ( const char *  name,
openmode  mode 
)

Opens an existing mfstream.

Definition at line 31 of file mfstream.cpp.

References _cmd, _cmdname, _FILE, buf, and popen().

Referenced by createtempfile(), mfstream(), and reopen().

Here is the call graph for this function:

Here is the caller graph for this function:

mfstream & mfstream::readx ( void *  p,
int  sz,
int  n = 1 
)

Read function for machine-independent byte order.

Definition at line 106 of file mfstream.cpp.

References read(), and swapbytes().

Referenced by ngramtable::loadbin(), and mixture::loadpar().

Here is the call graph for this function:

Here is the caller graph for this function:

mfstream& mfstream::reopen (  )  [inline]

Reopens an input stream.

Definition at line 215 of file mfstream.h.

References _cmdname, _mode, close(), open(), and seekp().

Here is the call graph for this function:

mfstream& mfstream::seekp ( streampos  loc  )  [inline]

Seeks a position within a file.

Definition at line 203 of file mfstream.h.

References _cmd.

Referenced by iwritex(), reopen(), and mdiadaptlm::saveBIN_per_word().

Here is the caller graph for this function:

int mfstream::swapbytes ( char *  p,
int  sz,
int  n 
) [protected]

Definition at line 74 of file mfstream.cpp.

Referenced by readx(), and writex().

Here is the caller graph for this function:

streampos mfstream::tellp (  )  [inline]

Tells current position within a file.

Definition at line 196 of file mfstream.h.

References _cmd.

Referenced by iwritex(), and mdiadaptlm::saveBIN_per_word().

Here is the caller graph for this function:

mfstream & mfstream::writex ( void *  p,
int  sz,
int  n = 1 
)

Write function for machine-independent byte order.

Definition at line 117 of file mfstream.cpp.

References swapbytes(), and write().

Referenced by iwritex(), ngramtable::savebin(), and mixture::savepar().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

int mfstream::_cmd [protected]

Definition at line 153 of file mfstream.h.

Referenced by close(), open(), seekp(), tellp(), and ~mfstream().

char mfstream::_cmdname[500]

Definition at line 162 of file mfstream.h.

Referenced by mfstream(), open(), and reopen().

FILE* mfstream::_FILE [protected]

Definition at line 155 of file mfstream.h.

Referenced by close(), and open().

openmode mfstream::_mode [protected]

Definition at line 154 of file mfstream.h.

Referenced by mfstream(), and reopen().

fdbuf* mfstream::buf [protected]

Definition at line 152 of file mfstream.h.

Referenced by close(), and open().


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

Generated on Thu Jul 6 00:31:52 2017 for Moses by  doxygen 1.5.9