5 #ifndef _MGIfstream_HH_
6 #define _MGIfstream_HH_
11 #include "mg/Object.h"
12 #include "mg/Pvector.h"
32 typedef std::map<long, MGGel*>::iterator mapitr;
33 typedef std::map<long, MGGel*>pmap;
46 MGIfstream(
const TCHAR* file,
bool map_clear=
true);
58 void operator>>(
MGGroup& group);
66 MGIfstream& operator >>(
char& ch){read1Byte(&ch);
return *
this;};
67 MGIfstream& operator >>(
unsigned char& uch){read1Byte(&uch);
return *
this;};
68 MGIfstream& operator >>(
short& s){read2Byte(&s);
return *
this;};
69 MGIfstream& operator >>(
unsigned short& us){read2Byte(&us);
return *
this;};
70 MGIfstream& operator >>(
int& n){read4Byte(&n);
return *
this;};
71 MGIfstream& operator >>(
unsigned int& un){read4Byte(&un);
return *
this;};
72 MGIfstream& operator >>(
long& l){read4Byte(&l);
return *
this;};
73 MGIfstream& operator >>(
unsigned long& ul){read4Byte(&ul);
return *
this;};
74 MGIfstream& operator >>(
float& f){read4Byte(&f);
return *
this;};
75 MGIfstream& operator >>(
double& d){read8Byte(&d);
return *
this;};
90 MGGel* find(
long pid);
96 bool insert(
long pid,
MGGel* ptr);
105 int open(
const TCHAR* file,
bool map_clear=
true);
110 MGGel* ReadPointer();
123 const char*
version()
const{
return m_version;};
132 bool MGCLHeader(std::ifstream&);
137 void read(
void* ps,
int n);
172 std::map<long, MGGel*> pmap;
178 #endif //#ifndef _MGIfstream_HH_
std::ifstream * m_file
Definition: Ifstream.h:39
char * version()
Definition: Ifstream.h:124
MGIfstream is a class to read the serialized data generated by MGOfstream.
Definition: Ifstream.h:30
MGGel is an abstract class which represents a group element.
Definition: Gel.h:53
const char * version() const
Obtain the version number of the stream.
Definition: Ifstream.h:123
MGGroup is a class which constains MGGel elements.
Definition: Group.h:35
void set_map_clear(bool map_clear)
Set map_clear flag.
Definition: Ifstream.h:116