Changeset 9777 in orxonox.OLD for branches/new_class_id/src/lib/util/loading/load_param_description.cc
- Timestamp:
- Sep 20, 2006, 9:49:13 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/util/loading/load_param_description.cc
r9776 r9777 56 56 57 57 /** 58 * prints out this parameter, its input method and the description (if availiable) 58 * @brief prints out this parameter, its input method and the description (if availiable) 59 * @param stream the stream to print to. 60 * @param withComments if the comments should be appended. 59 61 */ 60 void LoadParamDescription::print( ) const62 void LoadParamDescription::print(FILE* stream, bool withComments) const 61 63 { 62 PRINT(0)(" <%s>", this->_name.c_str());64 fprintf(stream, " <%s>", this->_name.c_str()); 63 65 for (unsigned int i = 0; i < this->_parameterCount; i++) 64 66 { 65 67 if (i > 0) 66 PRINT(0)(",");67 PRINT(0)("%s", this->_types[i].c_str());68 fprintf(stream, ","); 69 fprintf(stream, "%s", this->_types[i].c_str()); 68 70 } 69 PRINT(0)("</%s>", this->_name.c_str());71 fprintf(stream, "</%s>", this->_name.c_str()); 70 72 if (!this->_description.empty()) 71 PRINT(0)(" <!-- %s", this->_description.c_str());73 fprintf(stream, " <!-- %s", this->_description.c_str()); 72 74 // default values 73 75 if (this->_parameterCount > 0) 74 76 { 75 PRINT(0)(" (Default: ");77 fprintf(stream, " (Default: "); 76 78 for (unsigned int i = 0; i < this->_parameterCount; i++) 77 79 { 78 80 if (i > 0) 79 PRINT(0)(", ");81 fprintf(stream, ", "); 80 82 if (this->_types[i] == "string") 81 83 { // leave brackets !! 82 PRINT(0)("\"%s\"", this->_defaultValues[i].c_str());84 fprintf(stream, "\"%s\"", this->_defaultValues[i].c_str()); 83 85 } 84 86 else 85 87 { 86 PRINT(0)("%s", this->_defaultValues[i].c_str());88 fprintf(stream, "%s", this->_defaultValues[i].c_str()); 87 89 } 88 90 } 89 PRINT(0)(")");91 fprintf(stream, ")"); 90 92 } 91 93 if (!this->_description.empty() || this->_parameterCount > 0) 92 PRINT(0)(" -->");94 fprintf(stream, " -->"); 93 95 94 PRINT(0)("\n");96 fprintf(stream, "\n"); 95 97 } 96 98
Note: See TracChangeset
for help on using the changeset viewer.