Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7203 in orxonox.OLD for branches/std/src/lib/lang


Ignore:
Timestamp:
Mar 9, 2006, 5:28:10 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: compiles again, BUT well…. i do not expect it to run anymore

Location:
branches/std/src/lib/lang
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/std/src/lib/lang/base_object.cc

    r7193 r7203  
    9595 * @brief set the name of the Object
    9696 */
    97 void BaseObject::setName (const char* objectName)
     97void BaseObject::setName (const std::string& objectName)
    9898{
    9999  if (this->objectName)
    100100    delete[] this->objectName;
    101   if (objectName != NULL)
    102   {
    103     this->objectName = new char[strlen(objectName)+1];
    104     strcpy(this->objectName, objectName);
     101  if (!objectName.empty())
     102  {
     103    this->objectName = new char[objectName.size()+1];
     104    strcpy(this->objectName, objectName.c_str());
    105105  }
    106106  else
  • branches/std/src/lib/lang/base_object.h

    r6587 r7203  
    1616#endif
    1717
     18#include <string>
    1819#include "stdincl.h"
    1920
     
    3031
    3132  virtual void loadParams(const TiXmlElement* root);
    32   void setName (const char* newName);
     33  void setName (const std::string& newName);
    3334  /** returns the Name of this Object */
    3435  inline const char* getName ()const { return this->objectName; };
Note: See TracChangeset for help on using the changeset viewer.