MGCL V10
V10
MGCL V10
|
MGOfstream is a class to serialize all of the subclasses of MGGel. [詳解]
公開メンバ関数 | |
MGOfstream () | |
Default constructor. [詳解] | |
MGOfstream (const TCHAR *file, bool map_clear=true) | |
Ordinal constructor. File name file is used to open the file. [詳解] | |
virtual | ~MGOfstream () |
Destructor. [詳解] | |
MGOfstream & | operator<< (const MGGel &gel) |
void | operator<< (const MGGroup &group) |
MGOfstream & | operator<< (char ch) |
基本型のファイル出力関数 [詳解] | |
MGOfstream & | operator<< (unsigned char uch) |
MGOfstream & | operator<< (signed char sch) |
MGOfstream & | operator<< (short s) |
MGOfstream & | operator<< (unsigned short us) |
MGOfstream & | operator<< (int n) |
MGOfstream & | operator<< (unsigned int un) |
MGOfstream & | operator<< (long l) |
MGOfstream & | operator<< (unsigned long ul) |
MGOfstream & | operator<< (float f) |
MGOfstream & | operator<< (double d) |
void | close () |
long | find (const MGGel *ptr) |
void | mapClear () |
Clear the map area m_map. [詳解] | |
bool | insert (const MGGel *ptr, long pid) |
Clear map. [詳解] | |
int | open (const TCHAR *file, bool map_clear=true) |
void | set_map_clear (bool map_clear) |
Set map_clear flag. [詳解] | |
int | tellp () |
Tell the current optput position of m_file(same as m_file.tellp). [詳解] | |
MGOfstream & | writenChar (const char *ps, int n) |
n bytes character data version. [詳解] | |
long | WritePointer (const MGGel *obj) |
公開変数類 | |
std::ofstream * | m_file |
MGOfstream is a class to serialize all of the subclasses of MGGel.
Generally MGGroup is a class to hold all of the subclasses of MGGel, and the followig is the standard serialize sequence: (1) Generate MGGroup that includes necessary MGGel. (2) construct MGOfstream object like: MGOfstream ofstrm(file_name); (3) then, invoke operator<< like: ofstrm<<MGGroup;
MGOfstream::MGOfstream | ( | ) |
Default constructor.
MGOfstream::MGOfstream | ( | const TCHAR * | file, |
bool | map_clear = true |
||
) |
Ordinal constructor. File name file is used to open the file.
|
virtual |
Destructor.
void MGOfstream::close | ( | ) |
Close the file. This can be used even open() was not used. Users need not use this close() if need not specify the file close before the destruction of the MGOfstream.
long MGOfstream::find | ( | const MGGel * | ptr | ) |
Find the input prt's map address. If found, <position, 'true'> will be returned. If not found, <0, 'false'> will be returned. Here position means std::stremap of the m_file file where the ptr' is stored.
bool MGOfstream::insert | ( | const MGGel * | ptr, |
long | pid | ||
) |
Clear map.
Insert the ptr into the map. Function's return value is: True: if ptr did not exist in the map and insertion succeeded. False: if ptr did exist in the map and insertion failed.
void MGOfstream::mapClear | ( | ) |
Clear the map area m_map.
int MGOfstream::open | ( | const TCHAR * | file, |
bool | map_clear = true |
||
) |
fileのオープン Open the file. This is valid only when default constructor MGOfstream() is used. =0: open succeeded. =1: file not found.
MGOfstream& MGOfstream::operator<< | ( | const MGGel & | gel | ) |
Write out an object to ofs. Written objects by this fucction are able to read by one of the following global function:
void MGOfstream::operator<< | ( | const MGGroup & | group | ) |
|
inline |
基本型のファイル出力関数
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Set map_clear flag.
int MGOfstream::tellp | ( | ) |
Tell the current optput position of m_file(same as m_file.tellp).
MGOfstream& MGOfstream::writenChar | ( | const char * | ps, |
int | n | ||
) |
n bytes character data version.
long MGOfstream::WritePointer | ( | const MGGel * | obj | ) |
Pointer base のオブジェクトファイル出力関数 戻り値はオブジェクトのPID(識別ID)。 This is an internal program. Ordinary users should not use this function. operator<< should be used instead.
std::ofstream* MGOfstream::m_file |
Target input data stream. m_file is a public member. All of the CFile's member functions can be used.