#include <mfstream.h>
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. | |
mfstream & | writex (void *p, int sz, int n=1) |
Write function for machine-independent byte order. | |
mfstream & | readx (void *p, int sz, int n=1) |
Read function for machine-independent byte order. | |
mfstream & | iwritex (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. | |
mfstream & | seekp (streampos loc) |
Seeks a position within a file. | |
mfstream & | reopen () |
Reopens an input stream. | |
Public Attributes | |
char | _cmdname [500] |
Protected Member Functions | |
int | swapbytes (char *p, int sz, int n) |
Protected Attributes | |
fdbuf * | buf |
int | _cmd |
openmode | _mode |
FILE * | _FILE |
Definition at line 148 of file mfstream.h.
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().
mfstream::~mfstream | ( | ) | [inline] |
Closes and destroys a file/command stream.
Definition at line 176 of file mfstream.h.
void mfstream::close | ( | ) |
Closes an existing mfstream.
Definition at line 60 of file mfstream.cpp.
References _cmd, _FILE, buf, and pclose().
Referenced by lmtable::checkbounds(), plsa::combineT(), dictionary::dictionary(), ngramtable::generate(), dictionary::generate(), ngramtable::generate_dstco(), ngramtable::generate_hmask(), plsa::initH(), dictionary::load(), ngramtable::loadbin(), main(), ngramtable::ngramtable(), reopen(), doc::reset(), doc::save(), ngramtable::savebin(), mdiadaptlm::saveBIN_per_word(), plsa::saveT(), ngramtable::savetxt(), plsa::saveW(), plsa::saveWtxt(), interplm::test(), dictionary::test(), interplm::test_txt(), plsa::train(), and ~mfstream().
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().
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().
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().
mfstream& mfstream::reopen | ( | ) | [inline] |
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().
int mfstream::swapbytes | ( | char * | p, | |
int | sz, | |||
int | n | |||
) | [protected] |
Definition at line 74 of file mfstream.cpp.
Referenced by readx(), and writex().
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().
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().
int mfstream::_cmd [protected] |
Definition at line 153 of file mfstream.h.
Referenced by close(), open(), seekp(), tellp(), and ~mfstream().
char mfstream::_cmdname[500] |
FILE* mfstream::_FILE [protected] |
openmode mfstream::_mode [protected] |
fdbuf* mfstream::buf [protected] |