Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/std/src/lib/util/loading/load_param_description.cc

    r7130 r7203  
    2222 * @param paramName the name of the parameter to load
    2323 */
    24 LoadParamDescription::LoadParamDescription(const char* paramName)
     24LoadParamDescription::LoadParamDescription(const std::string& paramName)
    2525{
    2626  this->types = NULL;
    27   this->description = NULL;
    2827  this->defaultValues = NULL;
    29   this->paramName = new char[strlen(paramName)+1];
    30   strcpy(this->paramName, paramName);
     28  this->paramName = paramName;
    3129}
    3230
     
    4644  delete[] this->types;
    4745  delete[] this->defaultValues;
    48   delete[] this->paramName;
    49   delete[] this->description;
    5046}
    5147
     
    5349 * @param descriptionText The text to set as a description for this Parameter
    5450 */
    55 void LoadParamDescription::setDescription(const char* descriptionText)
    56 {
    57   this->description = new char[strlen(descriptionText)+1];
    58   strcpy(this->description, descriptionText);
     51void LoadParamDescription::setDescription(const std::string& descriptionText)
     52{
     53  this->description = descriptionText;
    5954}
    6055
     
    6459void LoadParamDescription::print() const
    6560{
    66   PRINT(3)(" <%s>", this->paramName);
     61  PRINT(3)(" <%s>", this->paramName.c_str());
    6762  for (int i = 0; i < this->paramCount; i++)
    6863  {
     
    10196//     }
    10297  }
    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());
    106101  // default values
    107102  if (this->paramCount > 0)
     
    213208  while (it != this->paramList.end())
    214209  {
    215     if (!strcmp((*it)->paramName, paramName))
     210    if ((*it)->paramName == paramName)
    216211    {
    217212      return NULL;
Note: See TracChangeset for help on using the changeset viewer.