Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 22, 2009, 2:07:44 PM (16 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/input/KeyBinder.h

    r6387 r6394  
    6666        void clearBindings();
    6767        bool setBinding(const std::string& binding, const std::string& name, bool bTemporary = false);
    68         std::string getBinding(std::string commandName); //tolua_export
    69         std::string getBinding(std::string commandName, unsigned int index); //tolua_export
    70         unsigned int getNumberOfBindings(std::string commandName); //tolua_export
     68        const std::string& getBinding(const std::string& commandName); //tolua_export
     69        const std::string& getBinding(const std::string& commandName, unsigned int index); //tolua_export
     70        unsigned int getNumberOfBindings(const std::string& commandName); //tolua_export
    7171
    7272        const std::string& getBindingsFilename()
     
    160160
    161161    private:
    162         void addButtonToCommand(std::string command, Button* button);
     162        void addButtonToCommand(const std::string& command, Button* button);
    163163
    164164        //##### ConfigValues #####
Note: See TracChangeset for help on using the changeset viewer.