Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 22, 2009, 2:07:44 PM (14 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
Location:
code/branches/presentation2/src/orxonox/sound
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/orxonox/sound/AmbientSound.cc

    r6388 r6394  
    113113        if (GameMode::playsSound())
    114114        {
    115             std::string path = "ambient/" + MoodManager::getInstance().getMood() + "/" + source;
     115            const std::string& path = "ambient/" + MoodManager::getInstance().getMood() + '/' + source;
    116116            shared_ptr<ResourceInfo> fileInfo = Resource::getInfo(path);
    117117            if (fileInfo != NULL)
  • code/branches/presentation2/src/orxonox/sound/SoundBuffer.cc

    r6378 r6394  
    5757        DataStreamPtr dataStream = Resource::open(fileInfo);
    5858
    59         std::string extension(this->filename_.substr(this->filename_.find_last_of('.') + 1));
     59        const std::string& extension = this->filename_.substr(this->filename_.find_last_of('.') + 1);
    6060        if (getLowercase(extension) == "ogg")
    6161        {
  • code/branches/presentation2/src/orxonox/sound/SoundManager.cc

    r6388 r6394  
    9292        {
    9393            this->deviceNames_.push_back(devices);
    94             COUT(4) << "\"" << devices << "\", ";
     94            COUT(4) << '"' << devices << "\", ";
    9595            devices += strlen(devices) + 1;
    9696            if (*devices == '\0')
     
    100100
    101101        // Open the selected device
    102         COUT(3) << "Sound: Opening device \"" << renderDevice << "\"" << std::endl;
     102        COUT(3) << "Sound: Opening device \"" << renderDevice << '\' << std::endl;
    103103        this->device_ = alcOpenDevice(renderDevice.c_str());
    104104*/
Note: See TracChangeset for help on using the changeset viewer.