Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 19, 2006, 9:51:24 PM (18 years ago)
Author:
bensch
Message:

cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/lib/util/loading/load_param.cc

    r9769 r9770  
    4444 * @returns a pointer to itself.
    4545 */
    46 void LoadParamBase::describe(const std::string& descriptionText)
     46void LoadParamBase::describe(const ClassID& classID, const std::string& descriptionText)
    4747{
     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
    4853  /// TODO REIMPLEMENT
    4954  /*  if (LoadParamClassDescription::parametersDescription && this->paramDesc && this->paramDesc->getDescription().empty())
     
    6570 * @returns the Value of the parameter if found, NULL otherwise
    6671*/
    67 std::string grabParameter(const TiXmlElement* root, const std::string& parameterName)
     72const std::string& LoadParamBase::grabParameter(const TiXmlElement* root, const std::string& parameterName)
    6873{
    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
    8078  {
    81     if( node->ToText()) return node->Value();
    82     node = node->NextSibling();
     79    static std::string empty("");
     80    return empty;
    8381  }
    84   return "";
    8582}
    8683
     
    9087 * @returns the Element of the parameter if found, NULL otherwise
    9188 */
    92 const TiXmlElement* grabParameterElement(const TiXmlElement* root, const std::string& parameterName)
     89const TiXmlElement* LoadParamBase::grabParameterElement(const TiXmlElement* root, const std::string& parameterName)
    9390{
    9491  const TiXmlElement* element;
Note: See TracChangeset for help on using the changeset viewer.