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

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/modules/questsystem/notifications/Notification.cc

    r6387 r6394  
    7575    void Notification::initialize(void)
    7676    {
    77         this->message_ = "";
     77        this->message_.clear();
    7878        this->sender_ = NotificationManager::NONE;
    7979        this->sent_ = false;
  • code/branches/presentation2/src/modules/questsystem/notifications/NotificationManager.cc

    r6182 r6394  
    4444{
    4545
    46     const std::string NotificationManager::ALL = "all";
    47     const std::string NotificationManager::NONE = "none";
     46    const std::string NotificationManager::ALL("all");
     47    const std::string NotificationManager::NONE("none");
    4848
    4949    ManageScopedSingleton(NotificationManager, ScopeID::Root, false);
  • code/branches/presentation2/src/modules/questsystem/notifications/NotificationQueue.cc

    r5929 r6394  
    4646    CreateFactory(NotificationQueue);
    4747
    48     const std::string NotificationQueue::DEFAULT_FONT = "VeraMono";
    49     const Vector2 NotificationQueue::DEFAULT_POSITION = Vector2(0.0,0.0);
    50     const float NotificationQueue::DEFAULT_FONT_SIZE  = 0.025f;
     48    const std::string NotificationQueue::DEFAULT_FONT("VeraMono");
     49    const Vector2 NotificationQueue::DEFAULT_POSITION(0.0,0.0);
     50    const float NotificationQueue::DEFAULT_FONT_SIZE = 0.025f;
    5151
    5252    /**
     
    271271            if(!first)
    272272            {
    273                 *string += ",";
     273                *string += ',';
    274274            }
    275275            else
     
    300300        while( index < targets.size() ) //!< Go through the string, character by character until the end is reached.
    301301        {
    302             pTemp = new std::string("");
     302            pTemp = new std::string();
    303303            while(index < targets.size() && targets[index] != ',' && targets[index] != ' ')
    304304            {
     
    399399        std::ostringstream stream;
    400400        stream << reinterpret_cast<unsigned long>(notification);
    401         std::string addressString = stream.str() ;
     401        const std::string& addressString = stream.str();
    402402        container->name = "NotificationOverlay(" + timeString + ")&" + addressString;
    403403
Note: See TracChangeset for help on using the changeset viewer.