MGCL V10  V10
MGCL V10
 全て クラス 名前空間 関数 変数 型定義 列挙型 列挙値 フレンド グループ ページ
MGIfstream クラス

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)
 
MGIfstreamoperator>> (MGGel *&gel)
 
MGIfstreamoperator>> (char &ch)
 基本型のファイル入力関数 [詳解]
 
MGIfstreamoperator>> (unsigned char &uch)
 
MGIfstreamoperator>> (short &s)
 
MGIfstreamoperator>> (unsigned short &us)
 
MGIfstreamoperator>> (int &n)
 
MGIfstreamoperator>> (unsigned int &un)
 
MGIfstreamoperator>> (long &l)
 
MGIfstreamoperator>> (unsigned long &ul)
 
MGIfstreamoperator>> (float &f)
 
MGIfstreamoperator>> (double &d)
 
void close ()
 
void mapClear ()
 Clear the map area m_map. [詳解]
 
MGGelfind (long pid)
 
bool insert (long pid, MGGel *ptr)
 
int open (const TCHAR *file, bool map_clear=true)
 
MGGelReadPointer ()
 
MGIfstreamreadnChar (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 MGIfstream::~MGIfstream ( )
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:

  1. MGOfstream::make_file();
  2. MGOfstream& operator<< (const MGGel& gel);
  3. void operator<<(MGGroup& group);
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.

MGIfstream& MGIfstream::operator>> ( char &  ch)
inline

基本型のファイル入力関数

MGIfstream& MGIfstream::operator>> ( unsigned char &  uch)
inline
MGIfstream& MGIfstream::operator>> ( short &  s)
inline
MGIfstream& MGIfstream::operator>> ( unsigned short &  us)
inline
MGIfstream& MGIfstream::operator>> ( int &  n)
inline
MGIfstream& MGIfstream::operator>> ( unsigned int &  un)
inline
MGIfstream& MGIfstream::operator>> ( long &  l)
inline
MGIfstream& MGIfstream::operator>> ( unsigned long &  ul)
inline
MGIfstream& MGIfstream::operator>> ( float &  f)
inline
MGIfstream& MGIfstream::operator>> ( double &  d)
inline
MGIfstream& MGIfstream::readnChar ( char *  ps4,
int  n 
)

n char版.

MGGel* MGIfstream::ReadPointer ( )

Pointer base のオブジェクトファイル入力関数. 戻り値はオブジェクトポインタ. Null pointer(0)のときあり。

void MGIfstream::set_map_clear ( bool  map_clear)
inline

Set map_clear flag.

long MGIfstream::tellg ( )

出力ポインタ位置関数. Tell the current input position of m_file(same as m_file.tellg).

const char* MGIfstream::version ( ) const
inline

Obtain the version number of the stream.

char* MGIfstream::version ( )
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.


このクラス詳解は次のファイルから抽出されました: