Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4597 in orxonox.OLD for orxonox/trunk/src/util/loading/load_param.cc


Ignore:
Timestamp:
Jun 11, 2005, 12:55:48 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: setClassID implemented in all files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/util/loading/load_param.cc

    r4501 r4597  
    1 /* 
     1/*
    22   orxonox - the future of 3D-vertical-scrollers
    33
     
    3030*/
    3131BaseLoadParam::BaseLoadParam(const TiXmlElement* root, BaseObject* object, const char* paramName,
    32                              int paramCount, bool multi, ...)
    33 {
     32                             int paramCount, bool multi, ...)
     33{
     34  this->setClassID(CL_LOAD_PARAM, "LoadParam");
    3435  this->loadString = NULL;
    3536
     
    3940    {
    4041      if (likely(!multi))
    41         this->loadString = grabParameter(root, paramName);
     42        this->loadString = grabParameter(root, paramName);
    4243      else
    43         {
    44           if (!strcmp(root->Value(), paramName))
    45             {
    46               const TiXmlNode* val = root->FirstChild();
    47               if( val->ToText())
    48                 this->loadString = val->Value();
    49             }
    50         }
     44        {
     45          if (!strcmp(root->Value(), paramName))
     46            {
     47              const TiXmlNode* val = root->FirstChild();
     48              if( val->ToText())
     49                this->loadString = val->Value();
     50            }
     51        }
    5152    }
    5253
     
    6465      va_start (types, multi);
    6566      for(int i = 0; i < paramCount; i++)
    66         {
    67           const char* tmpTypeName = va_arg (types, const char*);
    68           this->paramDesc->types[i] = new char[strlen(tmpTypeName)+1];
    69           strcpy(this->paramDesc->types[i], tmpTypeName);
    70         }
     67        {
     68          const char* tmpTypeName = va_arg (types, const char*);
     69          this->paramDesc->types[i] = new char[strlen(tmpTypeName)+1];
     70          strcpy(this->paramDesc->types[i], tmpTypeName);
     71        }
    7172      va_end(types);
    7273
     
    131132    {
    132133      if (i > 0)
    133         PRINT(3)(",");
     134        PRINT(3)(",");
    134135      PRINT(3)("%s", this->types[i]);
    135136    }
     
    194195    {
    195196      if (!strcmp(enumClassDesc->className, className))
    196         {
    197           delete iterator;
    198           return enumClassDesc;
    199         }
     197        {
     198          delete iterator;
     199          return enumClassDesc;
     200        }
    200201      enumClassDesc = iterator->nextElement();
    201202    }
     
    216217    {
    217218      if (!strcmp(enumParamDesc->paramName, paramName))
    218         {
    219           delete iterator;
    220           return enumParamDesc;
    221         }
     219        {
     220          delete iterator;
     221          return enumParamDesc;
     222        }
    222223      enumParamDesc = iterator->nextElement();
    223224    }
     
    243244      LoadParamDescription* enumParamDesc = paramIT->nextElement();
    244245      while (enumParamDesc)
    245         {
    246           enumParamDesc->print();
    247           enumParamDesc = paramIT->nextElement();
    248         }
     246        {
     247          enumParamDesc->print();
     248          enumParamDesc = paramIT->nextElement();
     249        }
    249250      delete paramIT;
    250251
     
    267268  const TiXmlElement* element;
    268269  const TiXmlNode* node;
    269        
     270
    270271  if (root == NULL)
    271272    return NULL;
    272273  assert( parameterName != NULL);
    273        
     274
    274275  element = root->FirstChildElement( parameterName);
    275276  if( element == NULL) return NULL;
    276        
     277
    277278  node = element->FirstChild();
    278279  while( node != NULL)
Note: See TracChangeset for help on using the changeset viewer.