MGCL V10
V10
MGCL V10
|
MGIfstream is a class to read the serialized data generated by MGOfstream. [詳解]
公開メンバ関数 | |
MGIfstream () | |
Default constructor. [詳解] | |
MGIfstream (const TCHAR *file, bool map_clear=true) | |
Ordinal constructor, file name file is used to open the file. [詳解] | |
virtual | ~MGIfstream () |
Destructor. [詳解] | |
void | operator>> (MGGroup &group) |
MGIfstream & | operator>> (MGGel *&gel) |
MGIfstream & | operator>> (char &ch) |
基本型のファイル入力関数 [詳解] | |
MGIfstream & | operator>> (unsigned char &uch) |
MGIfstream & | operator>> (short &s) |
MGIfstream & | operator>> (unsigned short &us) |
MGIfstream & | operator>> (int &n) |
MGIfstream & | operator>> (unsigned int &un) |
MGIfstream & | operator>> (long &l) |
MGIfstream & | operator>> (unsigned long &ul) |
MGIfstream & | operator>> (float &f) |
MGIfstream & | operator>> (double &d) |
void | close () |
void | mapClear () |
Clear the map area m_map. [詳解] | |
MGGel * | find (long pid) |
bool | insert (long pid, MGGel *ptr) |
int | open (const TCHAR *file, bool map_clear=true) |
MGGel * | ReadPointer () |
MGIfstream & | readnChar (char *ps4, int n) |
n char版. [詳解] | |
void | set_map_clear (bool map_clear) |
Set map_clear flag. [詳解] | |
long | tellg () |
const char * | version () const |
Obtain the version number of the stream. [詳解] | |
char * | version () |
公開変数類 | |
std::ifstream * | m_file |
MGIfstream is a class to read the serialized data generated by MGOfstream.
All of the MGGel data serialized can be read by : (1) Construct: MGIfstream strm(file_name). (2) Then, MGGroup grp; strm>>grp. (3) The above grp holds all of the serialized data.
MGIfstream::MGIfstream | ( | ) |
Default constructor.
MGIfstream::MGIfstream | ( | const TCHAR * | file, |
bool | map_clear = true |
||
) |
Ordinal constructor, file name file is used to open the file.
|
virtual |
Destructor.
void MGIfstream::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 MGIfstream.
MGGel* MGIfstream::find | ( | long | pid | ) |
Find the input pid's map address. If found, MGGel* will be returned. If not found, null pointer(0) will be returned.
bool MGIfstream::insert | ( | long | pid, |
MGGel * | ptr | ||
) |
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 MGIfstream::mapClear | ( | ) |
Clear the map area m_map.
int MGIfstream::open | ( | const TCHAR * | file, |
bool | map_clear = true |
||
) |
fileのオープン. Open the file. This is valid only when default constructor MGOfstream() is used. Function's return value is: =0: open succeeded. =1: file not found, or could not be opened. =2: file found, but, the format is not MGCL format.
void MGIfstream::operator>> | ( | MGGroup & | group | ) |
Read in all the objects in the file. The file should be generated by the following function:
MGIfstream& MGIfstream::operator>> | ( | MGGel *& | gel | ) |
Read in an object into gel. Returned gel is: (1) null if end of file or illegal file. (2) non null newed object pointer. User must delete it.
|
inline |
基本型のファイル入力関数
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
MGIfstream& MGIfstream::readnChar | ( | char * | ps4, |
int | n | ||
) |
n char版.
MGGel* MGIfstream::ReadPointer | ( | ) |
Pointer base のオブジェクトファイル入力関数. 戻り値はオブジェクトポインタ. Null pointer(0)のときあり。
|
inline |
Set map_clear flag.
long MGIfstream::tellg | ( | ) |
出力ポインタ位置関数. Tell the current input position of m_file(same as m_file.tellg).
|
inline |
Obtain the version number of the stream.
|
inline |
std::ifstream* MGIfstream::m_file |
Target input data stream. m_file is a public member. All of the CFile's member functions can be used.