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
Location:
code/branches/presentation2/src/modules/objects
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/modules/objects/Attacher.cc

    r5929 r6394  
    9898        this->target_ = 0;
    9999
    100         if (this->targetname_ == "")
     100        if (this->targetname_.empty())
    101101            return;
    102102
     
    113113    void Attacher::loadedNewXMLName(BaseObject* object)
    114114    {
    115         if (this->target_ || this->targetname_ == "")
     115        if (this->target_ || this->targetname_.empty())
    116116            return;
    117117
  • code/branches/presentation2/src/modules/objects/eventsystem/EventFilter.cc

    r5929 r6394  
    6262        if (this->bActive_)
    6363        {
    64             COUT(2) << "Warning: Detected Event loop in EventFilter \"" << this->getName() << "\"" << std::endl;
     64            COUT(2) << "Warning: Detected Event loop in EventFilter \"" << this->getName() << '"' << std::endl;
    6565            return;
    6666        }
  • code/branches/presentation2/src/modules/objects/eventsystem/EventListener.cc

    r5929 r6394  
    5858        if (this->bActive_)
    5959        {
    60             COUT(2) << "Warning: Detected Event loop in EventListener \"" << this->getName() << "\"" << std::endl;
     60            COUT(2) << "Warning: Detected Event loop in EventListener \"" << this->getName() << '"' << std::endl;
    6161            return;
    6262        }
     
    7171        this->eventName_ = eventname;
    7272
    73         if (this->eventName_ == "")
     73        if (this->eventName_.empty())
    7474            return;
    7575
     
    8181    void EventListener::loadedNewXMLName(BaseObject* object)
    8282    {
    83         if (this->eventName_ == "")
     83        if (this->eventName_.empty())
    8484            return;
    8585
  • code/branches/presentation2/src/modules/objects/eventsystem/EventTarget.cc

    r6387 r6394  
    6060        if (this->bActive_)
    6161        {
    62             COUT(2) << "Warning: Detected Event loop in EventTarget \"" << this->getName() << "\"" << std::endl;
     62            COUT(2) << "Warning: Detected Event loop in EventTarget \"" << this->getName() << '"' << std::endl;
    6363            return;
    6464        }
     
    8080    void EventTarget::loadedNewXMLName(BaseObject* object)
    8181    {
    82         if (this->target_ == "")
     82        if (this->target_.empty())
    8383            return;
    8484
  • code/branches/presentation2/src/modules/objects/triggers/DistanceTrigger.cc

    r5937 r6394  
    9292    if (!targetId)
    9393    {
    94         COUT(1) << "Error: \"" << targets << "\" is not a valid class name to include in ClassTreeMask (in " << this->getName() << ", class " << this->getIdentifier()->getName() << ")" << std::endl;
     94        COUT(1) << "Error: \"" << targets << "\" is not a valid class name to include in ClassTreeMask (in " << this->getName() << ", class " << this->getIdentifier()->getName() << ')' << std::endl;
    9595        return;
    9696    }
  • code/branches/presentation2/src/modules/objects/triggers/Trigger.cc

    r5929 r6394  
    280280  {
    281281    if (this->mode_ == TriggerMode::EventTriggerAND)
    282       return std::string("and");
     282      return "and";
    283283    else if (this->mode_ == TriggerMode::EventTriggerOR)
    284       return std::string("or");
     284      return "or";
    285285    else if (this->mode_ == TriggerMode::EventTriggerXOR)
    286       return std::string("xor");
     286      return "xor";
    287287    else
    288       return std::string("and");
     288      return "and";
    289289  }
    290290
Note: See TracChangeset for help on using the changeset viewer.