Changeset 7203 in orxonox.OLD for branches/std/src/lib/lang
- Timestamp:
- Mar 9, 2006, 5:28:10 PM (19 years ago)
- Location:
- branches/std/src/lib/lang
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/std/src/lib/lang/base_object.cc
r7193 r7203 95 95 * @brief set the name of the Object 96 96 */ 97 void BaseObject::setName (const char*objectName)97 void BaseObject::setName (const std::string& objectName) 98 98 { 99 99 if (this->objectName) 100 100 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()); 105 105 } 106 106 else -
branches/std/src/lib/lang/base_object.h
r6587 r7203 16 16 #endif 17 17 18 #include <string> 18 19 #include "stdincl.h" 19 20 … … 30 31 31 32 virtual void loadParams(const TiXmlElement* root); 32 void setName (const char*newName);33 void setName (const std::string& newName); 33 34 /** returns the Name of this Object */ 34 35 inline const char* getName ()const { return this->objectName; };
Note: See TracChangeset
for help on using the changeset viewer.