00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 class pgConfMgr;
00033
00034
00039 class PG_API pgConf
00040 {
00041 friend class pgConfMgr;
00042
00043 public:
00044 pgDefineException(ExceptionCannotOpenFile);
00045 pgDefineException(ExceptionCannotReadFile);
00046 pgDefineException(ExceptionInvalidArgument);
00047 pgDefineException(ExceptionInvalidCall);
00048
00049 pgConf* getPrevN() const;
00050 pgConf* getNextN() const;
00051
00052 pgID getID() const;
00053 bool isValid() const;
00054 u16 getErrorLineNo() const;
00055
00056 u16 getEntryNum(const char* ent_name) const;
00057 pgEnt* getEntryFromFirstN(const char* ent_name) const;
00058 pgEnt* getEntryFromLastN(const char* ent_name) const;
00059 pgEnt* getEntryBeforeN(const char* ent_name, pgEnt* ent) const;
00060 pgEnt* getEntryAfterN(const char* ent_name, pgEnt* ent) const;
00061
00062 pgEnt* getFirstEntryN() const;
00063 pgEnt* getLastEntryN() const;
00064
00065 static pgConf* newPriorConfigBeforeInitialization(const char* filename);
00066 static void deletePriorConfig(pgConf* conf);
00067
00068 private:
00069 pgConf(pgID id, const void* data, u32 data_size);
00070 pgConf(pgID id, const void* data, u32 data_size, void* dummy);
00071 ~pgConf();
00072 void operator=(const pgConf&);
00073
00074 pgEnt* newEntry(const char* ent_name, u16 val_num);
00075 void deleteEntry(pgEnt* ent);
00076
00077 void parse(const void* data, u32 data_size);
00078
00079 pgID m_id;
00080 u16 m_err_line_no;
00081 pgList<pgEnt> m_ent_list;
00082 void* (*m_malloc)(u32 size);
00083 void (*m_free)(void* ptr);
00084 };