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/overlays
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/orxonox/overlays/InGameConsole.cc

    r6375 r6394  
    318318            this->print(this->shell_->getInput(), Shell::Input, 0);
    319319
    320         if (this->shell_->getInput() == "" || this->shell_->getInput().size() == 0)
     320        if (this->shell_->getInput().empty())
    321321            this->inputWindowStart_ = 0;
    322322    }
  • code/branches/presentation2/src/orxonox/overlays/Map.cc

    r6218 r6394  
    4949#include <OgreViewport.h>
    5050
     51#include "util/StringUtils.h"
    5152#include "core/ConsoleCommand.h"
    5253#include "core/CoreIncludes.h"
  • code/branches/presentation2/src/orxonox/overlays/OrxonoxOverlay.cc

    r6387 r6394  
    4545#include "util/Convert.h"
    4646#include "util/Exception.h"
    47 #include "util/StringUtils.h"
    4847#include "core/GameMode.h"
    4948#include "core/CoreIncludes.h"
     
    146145
    147146        if (OrxonoxOverlay::overlays_s.find(this->getName()) != OrxonoxOverlay::overlays_s.end())
    148             COUT(1) << "Overlay names should be unique or you cannnot access them via console. Name: \"" << this->getName() << "\"" << std::endl;
     147            COUT(1) << "Overlay names should be unique or you cannnot access them via console. Name: \"" << this->getName() << '"' << std::endl;
    149148
    150149        OrxonoxOverlay::overlays_s[this->getName()] = this;
     
    154153    void OrxonoxOverlay::setBackgroundMaterial(const std::string& material)
    155154    {
    156         if (this->background_ && material != "")
     155        if (this->background_ && !material.empty())
    157156            this->background_->setMaterialName(material);
    158157    }
Note: See TracChangeset for help on using the changeset viewer.