X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/1347f3d1e04bedd1508589173f577673ee2c5554..16060474339321263c1d5fa80368e858757caa5e:/stglibs/conffiles.lib/conffiles.cpp?ds=sidebyside diff --git a/stglibs/conffiles.lib/conffiles.cpp b/stglibs/conffiles.lib/conffiles.cpp index 4fb72f61..ed2e4447 100644 --- a/stglibs/conffiles.lib/conffiles.cpp +++ b/stglibs/conffiles.lib/conffiles.cpp @@ -73,7 +73,6 @@ std::string Trim(std::string val) { return TrimR(TrimL(val)); } -} //--------------------------------------------------------------------------- } // namespace anonymous @@ -115,13 +114,8 @@ while (getline(f, line)) return; } -<<<<<<< Updated upstream std::string parameter = Trim(line.substr(0, pos)); std::string value = Trim(line.substr(pos + 1)); -======= - std::string parameter = line.substr(0, pos); - std::string value = line.substr(pos + 1); ->>>>>>> Stashed changes param_val[parameter] = value; } } @@ -145,7 +139,7 @@ return e; //--------------------------------------------------------------------------- int CONFIGFILE::ReadString(const std::string & param, std::string * val, const std::string & defaultVal) const { -const std::map::const_iterator it(param_val.find(param)); +const std::map::const_iterator it(param_val.find(param)); if (it != param_val.end()) { @@ -165,7 +159,7 @@ changed = true; //--------------------------------------------------------------------------- int CONFIGFILE::ReadTime(const std::string & param, time_t * val, time_t defaultVal) const { -const std::map::const_iterator it(param_val.find(param)); +const std::map::const_iterator it(param_val.find(param)); if (it != param_val.end()) { @@ -185,7 +179,7 @@ return -1; //--------------------------------------------------------------------------- int CONFIGFILE::ReadInt(const std::string & param, int * val, int defaultVal) const { -const std::map::const_iterator it(param_val.find(param)); +const std::map::const_iterator it(param_val.find(param)); if (it != param_val.end()) { @@ -205,7 +199,7 @@ return -1; //--------------------------------------------------------------------------- int CONFIGFILE::ReadUInt(const std::string & param, unsigned int * val, unsigned int defaultVal) const { -const std::map::const_iterator it(param_val.find(param)); +const std::map::const_iterator it(param_val.find(param)); if (it != param_val.end()) { @@ -225,7 +219,7 @@ return -1; //--------------------------------------------------------------------------- int CONFIGFILE::ReadLongInt(const std::string & param, long int * val, long int defaultVal) const { -const std::map::const_iterator it(param_val.find(param)); +const std::map::const_iterator it(param_val.find(param)); if (it != param_val.end()) { @@ -245,7 +239,7 @@ return -1; //--------------------------------------------------------------------------- int CONFIGFILE::ReadULongInt(const std::string & param, unsigned long int * val, unsigned long int defaultVal) const { -const std::map::const_iterator it(param_val.find(param)); +const std::map::const_iterator it(param_val.find(param)); if (it != param_val.end()) { @@ -265,7 +259,7 @@ return -1; //--------------------------------------------------------------------------- int CONFIGFILE::ReadLongLongInt(const std::string & param, int64_t * val, int64_t defaultVal) const { -const std::map::const_iterator it(param_val.find(param)); +const std::map::const_iterator it(param_val.find(param)); if (it != param_val.end()) { @@ -285,7 +279,7 @@ return -1; //--------------------------------------------------------------------------- int CONFIGFILE::ReadULongLongInt(const std::string & param, uint64_t * val, uint64_t defaultVal) const { -const std::map::const_iterator it(param_val.find(param)); +const std::map::const_iterator it(param_val.find(param)); if (it != param_val.end()) { @@ -305,7 +299,7 @@ return -1; //--------------------------------------------------------------------------- int CONFIGFILE::ReadShortInt(const std::string & param, short int * val, short int defaultVal) const { -const std::map::const_iterator it(param_val.find(param)); +const std::map::const_iterator it(param_val.find(param)); if (it != param_val.end()) { @@ -325,7 +319,7 @@ return -1; //--------------------------------------------------------------------------- int CONFIGFILE::ReadUShortInt(const std::string & param, unsigned short int * val, unsigned short int defaultVal) const { -const std::map::const_iterator it(param_val.find(param)); +const std::map::const_iterator it(param_val.find(param)); if (it != param_val.end()) { @@ -353,7 +347,7 @@ changed = true; //--------------------------------------------------------------------------- int CONFIGFILE::ReadDouble(const std::string & param, double * val, double defaultVal) const { -const std::map::const_iterator it(param_val.find(param)); +const std::map::const_iterator it(param_val.find(param)); if (it != param_val.end()) { @@ -388,7 +382,7 @@ if (!f.is_open()) return EIO; } -std::map::const_iterator it = param_val.begin(); +std::map::const_iterator it = param_val.begin(); while (it != param_val.end()) { f << it->first << "=" << it->second << "\n";