Changeset 9770 in orxonox.OLD for branches/new_class_id/src/lib/util/loading/load_param.cc
- Timestamp:
- Sep 19, 2006, 9:51:24 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/util/loading/load_param.cc
r9769 r9770 44 44 * @returns a pointer to itself. 45 45 */ 46 void LoadParamBase::describe(const std::string& descriptionText)46 void LoadParamBase::describe(const ClassID& classID, const std::string& descriptionText) 47 47 { 48 PRINTF(5)("Describing Class '%s'(id:%d) Parameter '%s': description '%s'\n", 49 classID.name().c_str(), classID.id(), paramName.c_str(), descriptionText.c_str()); 50 51 // LoadParamDescription 52 48 53 /// TODO REIMPLEMENT 49 54 /* if (LoadParamClassDescription::parametersDescription && this->paramDesc && this->paramDesc->getDescription().empty()) … … 65 70 * @returns the Value of the parameter if found, NULL otherwise 66 71 */ 67 std::stringgrabParameter(const TiXmlElement* root, const std::string& parameterName)72 const std::string& LoadParamBase::grabParameter(const TiXmlElement* root, const std::string& parameterName) 68 73 { 69 const TiXmlElement* element; 70 const TiXmlNode* node; 71 72 if (root == NULL) 73 return ""; 74 75 element = root->FirstChildElement( parameterName); 76 if( element == NULL) return ""; 77 78 node = element->FirstChild(); 79 while( node != NULL) 74 const TiXmlElement* const element = grabParameterElement(root, parameterName); 75 if (element != NULL) 76 return element->Value(); 77 else 80 78 { 81 if( node->ToText()) return node->Value();82 node = node->NextSibling();79 static std::string empty(""); 80 return empty; 83 81 } 84 return "";85 82 } 86 83 … … 90 87 * @returns the Element of the parameter if found, NULL otherwise 91 88 */ 92 const TiXmlElement* grabParameterElement(const TiXmlElement* root, const std::string& parameterName)89 const TiXmlElement* LoadParamBase::grabParameterElement(const TiXmlElement* root, const std::string& parameterName) 93 90 { 94 91 const TiXmlElement* element;
Note: See TracChangeset
for help on using the changeset viewer.