Changeset 7203 in orxonox.OLD for branches/std/src/lib/util/loading/load_param_description.cc
- Timestamp:
- Mar 9, 2006, 5:28:10 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/std/src/lib/util/loading/load_param_description.cc
r7130 r7203 22 22 * @param paramName the name of the parameter to load 23 23 */ 24 LoadParamDescription::LoadParamDescription(const char*paramName)24 LoadParamDescription::LoadParamDescription(const std::string& paramName) 25 25 { 26 26 this->types = NULL; 27 this->description = NULL;28 27 this->defaultValues = NULL; 29 this->paramName = new char[strlen(paramName)+1]; 30 strcpy(this->paramName, paramName); 28 this->paramName = paramName; 31 29 } 32 30 … … 46 44 delete[] this->types; 47 45 delete[] this->defaultValues; 48 delete[] this->paramName;49 delete[] this->description;50 46 } 51 47 … … 53 49 * @param descriptionText The text to set as a description for this Parameter 54 50 */ 55 void LoadParamDescription::setDescription(const char* descriptionText) 56 { 57 this->description = new char[strlen(descriptionText)+1]; 58 strcpy(this->description, descriptionText); 51 void LoadParamDescription::setDescription(const std::string& descriptionText) 52 { 53 this->description = descriptionText; 59 54 } 60 55 … … 64 59 void LoadParamDescription::print() const 65 60 { 66 PRINT(3)(" <%s>", this->paramName );61 PRINT(3)(" <%s>", this->paramName.c_str()); 67 62 for (int i = 0; i < this->paramCount; i++) 68 63 { … … 101 96 // } 102 97 } 103 PRINT(3)("</%s>", this->paramName );104 if ( this->description)105 PRINT(3)(" -- %s", this->description );98 PRINT(3)("</%s>", this->paramName.c_str()); 99 if (!this->description.empty()) 100 PRINT(3)(" -- %s", this->description.c_str()); 106 101 // default values 107 102 if (this->paramCount > 0) … … 213 208 while (it != this->paramList.end()) 214 209 { 215 if ( !strcmp((*it)->paramName, paramName))210 if ((*it)->paramName == paramName) 216 211 { 217 212 return NULL;
Note: See TracChangeset
for help on using the changeset viewer.