Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4492 in orxonox.OLD for orxonox/trunk/src/util/loading


Ignore:
Timestamp:
Jun 3, 2005, 1:55:22 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: importer works again

Location:
orxonox/trunk/src/util/loading
Files:
4 edited

Legend:

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

    r4487 r4492  
    9494}
    9595
    96 /**
    97    \param root: The XML-element to grab a parameter from
    98    \param parameterName: the parameter to grab
    99    \returns the Value of the parameter if found, NULL otherwise
    100 */
    101 const char* grabParameter(const TiXmlElement* root, const char* parameterName)
    102 {
    103   const TiXmlElement* element;
    104   const TiXmlNode* node;
    105        
    106   if (root == NULL)
    107     return NULL;
    108   assert( parameterName != NULL);
    109        
    110   element = root->FirstChildElement( parameterName);
    111   if( element == NULL) return NULL;
    112        
    113   node = element->FirstChild();
    114   while( node != NULL)
    115     {
    116       if( node->ToText()) return node->Value();
    117       node = node->NextSibling();
    118     }
    119   return NULL;
    120 }
    121 
  • orxonox/trunk/src/util/loading/factory.h

    r4487 r4492  
    100100}
    101101
    102 // helper function
    103 
    104 const char* grabParameter(const TiXmlElement* root, const char* parameterName);
    105 
    106102#endif /* _FACTORY_H */
    107103
  • orxonox/trunk/src/util/loading/load_param.cc

    r4487 r4492  
    236236  PRINT(3)("===============================================================\n");
    237237}
     238
     239
     240
     241/**
     242   \param root: The XML-element to grab a parameter from
     243   \param parameterName: the parameter to grab
     244   \returns the Value of the parameter if found, NULL otherwise
     245*/
     246const char* grabParameter(const TiXmlElement* root, const char* parameterName)
     247{
     248  const TiXmlElement* element;
     249  const TiXmlNode* node;
     250       
     251  if (root == NULL)
     252    return NULL;
     253  assert( parameterName != NULL);
     254       
     255  element = root->FirstChildElement( parameterName);
     256  if( element == NULL) return NULL;
     257       
     258  node = element->FirstChild();
     259  while( node != NULL)
     260    {
     261      if( node->ToText()) return node->Value();
     262      node = node->NextSibling();
     263    }
     264  return NULL;
     265}
  • orxonox/trunk/src/util/loading/load_param.h

    r4487 r4492  
    266266};
    267267
     268// helper function
     269
     270const char* grabParameter(const TiXmlElement* root, const char* parameterName);
    268271
    269272#endif /* _LOAD_PARAM_H */
Note: See TracChangeset for help on using the changeset viewer.