X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/261442af210d652fc2c8a3d9197097982701bd16..3556f24564ddfe6fee1fb12bc8b976b9b4c0b5df:/stglibs/conffiles.lib/include/stg/conffiles.h?ds=inline diff --git a/stglibs/conffiles.lib/include/stg/conffiles.h b/stglibs/conffiles.lib/include/stg/conffiles.h index 6909c6c9..48e07b62 100644 --- a/stglibs/conffiles.lib/include/stg/conffiles.h +++ b/stglibs/conffiles.lib/include/stg/conffiles.h @@ -37,44 +37,43 @@ #include "stg/os_int.h" -using namespace std; //--------------------------------------------------------------------------- -typedef bool (*StringCaseCmp_t)(const string & str1, const string & str2); +typedef bool (*StringCaseCmp_t)(const std::string & str1, const std::string & str2); class CONFIGFILE { public: - CONFIGFILE(const string & fn, bool nook = false); + CONFIGFILE(const std::string & fn, bool nook = false); ~CONFIGFILE(); - const string & GetFileName() const; + const std::string & GetFileName() const; // æÕÎËÃÉÉ Read* ×ÏÚ×ÒÁÝÁÀÔ 0 ÐÒÉ ÕÓÐÅÛÎÏÍ ÓÞÉÔÙ×ÁÎÉÉ // É EINVAL ÐÒÉ ÏÔÓÕÔÓ×ÉÉ ÐÁÒÁÍÅÔÒÁ É ×ÙÓÔÁ×ÌÑÀÔ defaulValue - //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 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 ReadULongLongInt(const string & param, uint64_t *, uint64_t) const; - int ReadDouble(const string & param, double * val, double defaultVal) const; + //int ReadString(const std::string & param, char * val, int * maxLen, const char * defaultVal) const; + int ReadString(const std::string & param, std::string * val, const std::string & defaultVal) const; + int ReadTime(const std::string & param, time_t *, time_t) const; + int ReadShortInt(const std::string & param, short int *, short int) const; + int ReadInt(const std::string & param, int *, int) const; + int ReadLongInt(const std::string & param, long int *, long int) const; + int ReadLongLongInt(const std::string & param, int64_t *, int64_t) const; + int ReadUShortInt(const std::string & param, unsigned short int *, unsigned short int) const; + int ReadUInt(const std::string & param, unsigned int *, unsigned int) const; + int ReadULongInt(const std::string & param, unsigned long int *, unsigned long int) const; + int ReadULongLongInt(const std::string & param, uint64_t *, uint64_t) const; + int ReadDouble(const std::string & param, double * val, double defaultVal) const; - void WriteString(const string & param, const char * val) { return WriteString(param, std::string(val)); } - void WriteString(const string & param, const string & val); - void WriteInt(const string & param, int64_t val); - void WriteDouble(const string & param, double val); + void WriteString(const std::string & param, const char * val) { return WriteString(param, std::string(val)); } + void WriteString(const std::string & param, const std::string& val); + void WriteInt(const std::string & param, int64_t val); + void WriteDouble(const std::string & param, double val); int Error() const; int Flush() const; private: - map param_val; - string fileName; + std::map param_val; + std::string fileName; mutable int error; mutable bool changed;