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

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. [詳解]
 
MGOfstreamoperator<< (const MGGel &gel)
 
void operator<< (const MGGroup &group)
 
MGOfstreamoperator<< (char ch)
 基本型のファイル出力関数 [詳解]
 
MGOfstreamoperator<< (unsigned char uch)
 
MGOfstreamoperator<< (signed char sch)
 
MGOfstreamoperator<< (short s)
 
MGOfstreamoperator<< (unsigned short us)
 
MGOfstreamoperator<< (int n)
 
MGOfstreamoperator<< (unsigned int un)
 
MGOfstreamoperator<< (long l)
 
MGOfstreamoperator<< (unsigned long ul)
 
MGOfstreamoperator<< (float f)
 
MGOfstreamoperator<< (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). [詳解]
 
MGOfstreamwritenChar (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 MGOfstream::~MGOfstream ( )
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:

  1. MGIfstream& MGIfstream::operator>>(MGGel*& gel);
  2. voic MGIfstream::operator>>(MGGroup& group);
void MGOfstream::operator<< ( const MGGroup group)
MGOfstream& MGOfstream::operator<< ( char  ch)
inline

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

MGOfstream& MGOfstream::operator<< ( unsigned char  uch)
inline
MGOfstream& MGOfstream::operator<< ( signed char  sch)
inline
MGOfstream& MGOfstream::operator<< ( short  s)
inline
MGOfstream& MGOfstream::operator<< ( unsigned short  us)
inline
MGOfstream& MGOfstream::operator<< ( int  n)
inline
MGOfstream& MGOfstream::operator<< ( unsigned int  un)
inline
MGOfstream& MGOfstream::operator<< ( long  l)
inline
MGOfstream& MGOfstream::operator<< ( unsigned long  ul)
inline
MGOfstream& MGOfstream::operator<< ( float  f)
inline
MGOfstream& MGOfstream::operator<< ( double  d)
inline
void MGOfstream::set_map_clear ( bool  map_clear)
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.


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