Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9778 in orxonox.OLD for branches/new_class_id/src/lib/util/loading


Ignore:
Timestamp:
Sep 20, 2006, 9:53:49 AM (18 years ago)
Author:
bensch
Message:

enabled and disabled comments

Location:
branches/new_class_id/src/lib/util/loading
Files:
2 edited

Legend:

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

    r9777 r9778  
    121121void LoadParamClassDescription::printAll(const std::string& fileName, bool withComments)
    122122{
    123   printf("================== function called\n");
    124 
    125123  FILE* stream;
    126124  if( (stream = fopen (fileName.c_str(), "w")) == NULL)
  • branches/new_class_id/src/lib/util/loading/load_param_description.cc

    r9777 r9778  
    7070  }
    7171  fprintf(stream, "</%s>", this->_name.c_str());
    72   if (!this->_description.empty())
    73     fprintf(stream, " <!-- %s", this->_description.c_str());
    74   // default values
    75   if (this->_parameterCount > 0)
     72  // here the comments are printed out.
     73  if (withComments)
    7674  {
    77     fprintf(stream, " (Default: ");
    78     for (unsigned int i = 0; i < this->_parameterCount; i++)
     75    if (!this->_description.empty())
     76      fprintf(stream, " <!-- %s", this->_description.c_str());
     77    // default values
     78    if (this->_parameterCount > 0)
    7979    {
    80       if (i > 0)
    81         fprintf(stream, ", ");
    82       if (this->_types[i] == "string")
    83       { // leave brackets !!
    84         fprintf(stream, "\"%s\"", this->_defaultValues[i].c_str());
     80      fprintf(stream, " (Default: ");
     81      for (unsigned int i = 0; i < this->_parameterCount; i++)
     82      {
     83        if (i > 0)
     84          fprintf(stream, ", ");
     85        if (this->_types[i] == "string")
     86        { // leave brackets !!
     87          fprintf(stream, "\"%s\"", this->_defaultValues[i].c_str());
     88        }
     89        else
     90        {
     91          fprintf(stream, "%s", this->_defaultValues[i].c_str());
     92        }
    8593      }
    86       else
    87       {
    88         fprintf(stream, "%s", this->_defaultValues[i].c_str());
    89       }
     94      fprintf(stream, ")");
    9095    }
    91     fprintf(stream, ")");
     96    if (!this->_description.empty() || this->_parameterCount > 0)
     97      fprintf(stream, " -->");
    9298  }
    93   if (!this->_description.empty() || this->_parameterCount > 0)
    94     fprintf(stream, " -->");
    95 
    9699  fprintf(stream, "\n");
    97100}
Note: See TracChangeset for help on using the changeset viewer.