TRF Language Model
wb::ObjFile Class Reference

used to read more than one objects More...

#include <wb-file.h>

Inheritance diagram for wb::ObjFile:
wb::File

Public Member Functions

 ObjFile ()
 constructor More...
 
 ObjFile (const char *path, const char *mode)
 constructor More...
 
void WriteHeadT ()
 ��txt��write the head More...
 
void ReadHeadT ()
 ��txt��read the head More...
 
void WriteObjT ()
 ��txt��write the object More...
 
bool ReadObjT ()
 ��txt��read the object More...
 
void WriteHeadB ()
 ��bin��write the head More...
 
void ReadHeadB ()
 ��bin��read the head More...
 
void WriteObjB ()
 ��bin��write the object More...
 
bool ReadObjB ()
 ��bin��read the object More...
 
- Public Member Functions inherited from wb::File
 File ()
 constructor More...
 
 File (const char *path, const char *mode, bool bHardOpen=true)
 constructor More...
 
 ~File ()
 destructor More...
 
virtual bool Open (const char *path, const char *mode, bool bHardOpen=true)
 Open file. More...
 
virtual bool Reopen (const char *model)
 re-open the file More...
 
virtual void Close ()
 close the file More...
 
 operator FILE * ()
 transform the class to FILE pointer More...
 
virtual char * GetLine (bool bPrecent=false)
 Read a line into the buffer. More...
 
virtual bool GetLine (char *str, int maxLen=MAX_SENTENCE_LEN)
 read a line into buffer str. More...
 
virtual void Print (const char *p_pMessage,...)
 print More...
 
virtual int Scanf (const char *p_pMessage,...)
 scanf More...
 
void Flush ()
 clean buffer More...
 
void Reset ()
 reset position More...
 
bool Good () const
 return if the file is accessible. More...
 
template<typename TYPE >
void PrintArray (const char *pformat, TYPE *pbuf, int num)
 print a array into file More...
 

Public Attributes

int m_nTotalNum
 object number More...
 
int m_nCurNum
 current object number More...
 
IO_Objm_pObj
 object pointer More...
 
- Public Attributes inherited from wb::File
FILE * fp
 file pointer More...
 
int nLine
 the number of reading from file More...
 
char * pStrLine
 store the string get from file More...
 
string strFileName
 stroe the file name More...
 
bool bOver
 record the if the buffer is overflow More...
 
short nBuf
 record the buffer is nBuf times of GS_SENTENCE_LEN More...
 

Detailed Description

used to read more than one objects

Definition at line 174 of file wb-file.h.

Constructor & Destructor Documentation

§ ObjFile() [1/2]

wb::ObjFile::ObjFile ( )
inline

constructor

Definition at line 182 of file wb-file.h.

§ ObjFile() [2/2]

wb::ObjFile::ObjFile ( const char *  path,
const char *  mode 
)
inline

constructor

Definition at line 184 of file wb-file.h.

Member Function Documentation

§ ReadHeadB()

void wb::ObjFile::ReadHeadB ( )

��bin��read the head

Definition at line 190 of file wb-file.cpp.

§ ReadHeadT()

void wb::ObjFile::ReadHeadT ( )

��txt��read the head

Definition at line 154 of file wb-file.cpp.

§ ReadObjB()

bool wb::ObjFile::ReadObjB ( )

��bin��read the object

Definition at line 203 of file wb-file.cpp.

§ ReadObjT()

bool wb::ObjFile::ReadObjT ( )

��txt��read the object

Definition at line 169 of file wb-file.cpp.

§ WriteHeadB()

void wb::ObjFile::WriteHeadB ( )

��bin��write the head

Definition at line 184 of file wb-file.cpp.

§ WriteHeadT()

void wb::ObjFile::WriteHeadT ( )

��txt��write the head

Definition at line 148 of file wb-file.cpp.

§ WriteObjB()

void wb::ObjFile::WriteObjB ( )

��bin��write the object

Definition at line 196 of file wb-file.cpp.

§ WriteObjT()

void wb::ObjFile::WriteObjT ( )

��txt��write the object

Definition at line 161 of file wb-file.cpp.

Member Data Documentation

§ m_nCurNum

int wb::ObjFile::m_nCurNum

current object number

Definition at line 178 of file wb-file.h.

§ m_nTotalNum

int wb::ObjFile::m_nTotalNum

object number

Definition at line 177 of file wb-file.h.

§ m_pObj

IO_Obj* wb::ObjFile::m_pObj

object pointer

Definition at line 179 of file wb-file.h.


The documentation for this class was generated from the following files: