Changeset 4492 in orxonox.OLD for orxonox/trunk/src/util
- Timestamp:
- Jun 3, 2005, 1:55:22 AM (20 years ago)
- Location:
- orxonox/trunk/src/util/loading
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/util/loading/factory.cc
r4487 r4492 94 94 } 95 95 96 /**97 \param root: The XML-element to grab a parameter from98 \param parameterName: the parameter to grab99 \returns the Value of the parameter if found, NULL otherwise100 */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 100 100 } 101 101 102 // helper function103 104 const char* grabParameter(const TiXmlElement* root, const char* parameterName);105 106 102 #endif /* _FACTORY_H */ 107 103 -
orxonox/trunk/src/util/loading/load_param.cc
r4487 r4492 236 236 PRINT(3)("===============================================================\n"); 237 237 } 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 */ 246 const 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 266 266 }; 267 267 268 // helper function 269 270 const char* grabParameter(const TiXmlElement* root, const char* parameterName); 268 271 269 272 #endif /* _LOAD_PARAM_H */
Note: See TracChangeset
for help on using the changeset viewer.