Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


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

orxonox/trunk: importer works again

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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}
Note: See TracChangeset for help on using the changeset viewer.