X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/641204dfbdb9fc870cdd2e7f9e3169a44693e7bf..8d18bde0f40cac840d25b98e48b1a8dfcc2157ff:/stglibs/conffiles.lib/conffiles.h diff --git a/stglibs/conffiles.lib/conffiles.h b/stglibs/conffiles.lib/conffiles.h index ee575d65..d912d9ab 100644 --- a/stglibs/conffiles.lib/conffiles.h +++ b/stglibs/conffiles.lib/conffiles.h @@ -22,7 +22,7 @@ * Author : Boris Mikhailenko */ - /* +/* $Revision: 1.5 $ $Date: 2009/06/22 16:00:38 $ */ @@ -31,8 +31,7 @@ #ifndef ConfFilesH #define ConfFilesH -#include -#include + #include #include @@ -40,55 +39,44 @@ using namespace std; //--------------------------------------------------------------------------- -//#define CONF_STR_LEN 300 -//typedef char STRING[CONF_STR_LEN]; typedef bool (*StringCaseCmp_t)(const string & str1, const string & str2); class CONFIGFILE { -private: - mutable map param_val; - mutable map::iterator it; - - FILE * f; - int Flush(); - //int ReadFile(); - string fileName; - int error; - public: - CONFIGFILE(const string &fn); + CONFIGFILE(const string & fn); ~CONFIGFILE(); const string & GetFileName() const; // 5 ÆÕÎËÃÉÉ Read* ×ÏÚ×ÒÁÝÁÀÔ 0 ÐÒÉ ÕÓÐÅÛÎÏÍ ÓÞÉÔÙ×ÁÎÉÉ // É EINVAL ÐÒÉ ÏÔÓÕÔÓ×ÉÉ ÐÁÒÁÍÅÔÒÁ É ×ÙÓÔÁ×ÌÑÀÔ defaulValue - int ReadString(const string & param, char * val, int * maxLen, const char * defaultVal) const; + //int ReadString(const string & param, char * val, int * maxLen, const char * defaultVal) const; int ReadString(const string & param, string * val, const string & defaultVal) const; - - int FindParameter(const string ¶meter, string * value) const; - - int ReadTime (const string & param, time_t *, time_t) const; - - int ReadShortInt (const string & param, short int *, short int) const; - int ReadInt (const string & param, int *, int) const; - int ReadLongInt (const string & param, long int *, long int) const; + int ReadTime(const string & param, time_t *, time_t) const; + int ReadShortInt(const string & param, short int *, short int) const; + int ReadInt(const string & param, int *, int) const; + int ReadLongInt(const string & param, long int *, long int) const; int ReadLongLongInt(const string & param, int64_t *, int64_t) const; - - int ReadUShortInt (const string & param, unsigned short int *, unsigned short int) const; - int ReadUInt (const string & param, unsigned int *, unsigned int) const; - int ReadULongInt (const string & param, unsigned long int *, unsigned long int) const; + int ReadUShortInt(const string & param, unsigned short int *, unsigned short int) const; + int ReadUInt(const string & param, unsigned int *, unsigned int) const; + int ReadULongInt(const string & param, unsigned long int *, unsigned long int) const; int ReadULongLongInt(const string & param, uint64_t *, uint64_t) const; + int ReadDouble(const string & param, double * val, double defaultVal) const; - int ReadDouble (const string & param, double * val, double defaultVal) const; - - int WriteString(const string & param, const char * val); + //int WriteString(const string & param, const char * val); int WriteString(const string & param, const string & val); - int WriteInt (const string & param, int64_t val); + int WriteInt(const string & param, int64_t val); int WriteDouble(const string & param, double val); int Error(); + +private: + int Flush(); + + map param_val; + string fileName; + int error; }; //--------------------------------------------------------------------------- #endif