Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 22, 2009, 2:07:44 PM (15 years ago)
Author:
rgrieder
Message:

std::string tweaks:

  • Declared BLANKSTRING in UtilPrereqs.h as well (removed obsolete StringUtils.h includes to avoid dependencies)
  • Using BLANKSTRING if const std::string& return type is possible
  • Replaced a few (const) std::string arguments with const std::string&
  • if (str == "") —> if (str.empty())
  • std::string msg = name + "adsf"; —> const std::string& msg = name + "asdf";
  • std::string asdf = object→getFooBar(); —> const std::string& asdf = object→getFooBar();
  • std::string asdf = "asdf"; —> std::string asdf("asdf");
  • ostream << "."; and name + "." —> ostream << '.'; and name + '.'
  • str = ""; —> str.clear()
  • std::string asdf = ""; —> std::string asdf;
  • asdf_ = ""; (in c'tor) —> delete line
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/libraries/core/ConfigFileManager.h

    r6374 r6394  
    8989    {
    9090        public:
    91             inline ConfigFileEntryValue(const std::string& name, const std::string& value = "", bool bString = false, const std::string& additionalComment = "") : name_(name), value_(value), bString_(bString), additionalComment_(additionalComment) {}
     91            inline ConfigFileEntryValue(const std::string& name, const std::string& value = "", bool bString = false, const std::string& additionalComment = "")
     92                : name_(name)
     93                , value_(value)
     94                , bString_(bString)
     95                , additionalComment_(additionalComment)
     96                {}
    9297            inline virtual ~ConfigFileEntryValue() {}
    9398
     
    173178
    174179        public:
    175             inline ConfigFileSection(const std::string& name, const std::string& additionalComment = "") : name_(name), additionalComment_(additionalComment), bUpdated_(false) {}
     180            inline ConfigFileSection(const std::string& name, const std::string& additionalComment = "")
     181                : name_(name)
     182                , additionalComment_(additionalComment)
     183                , bUpdated_(false)
     184                {}
    176185            ~ConfigFileSection();
    177186
     
    244253                { this->getSection(section)->setValue(name, value, bString); this->save(); }
    245254            inline std::string getValue(const std::string& section, const std::string& name, const std::string& fallback, bool bString)
    246                 { std::string output = this->getSection(section)->getValue(name, fallback, bString); this->saveIfUpdated(); return output; }
     255                { const std::string& output = this->getSection(section)->getValue(name, fallback, bString); this->saveIfUpdated(); return output; }
    247256
    248257            inline void setValue(const std::string& section, const std::string& name, unsigned int index, const std::string& value, bool bString)
    249258                { this->getSection(section)->setValue(name, index, value, bString); this->save(); }
    250259            inline std::string getValue(const std::string& section, const std::string& name, unsigned int index, const std::string& fallback, bool bString)
    251                 { std::string output = this->getSection(section)->getValue(name, index, fallback, bString); this->saveIfUpdated(); return output; }
     260                { const std::string& output = this->getSection(section)->getValue(name, index, fallback, bString); this->saveIfUpdated(); return output; }
    252261
    253262            inline void deleteVectorEntries(const std::string& section, const std::string& name, unsigned int startindex = 0)
Note: See TracChangeset for help on using the changeset viewer.