Changeset 9777 in orxonox.OLD for branches/new_class_id/src/lib/util/loading/load_param_class_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_class_description.cc
r9776 r9777 114 114 } 115 115 116 117 118 119 116 /** 120 117 * @brief prints out all loadable Classes, and their parameters 121 118 * @param fileName prints the output to a File 122 * @ todo implement it119 * @param withComments if Comments should be included. 123 120 */ 124 void LoadParamClassDescription::printAll(const std::string& fileName )121 void LoadParamClassDescription::printAll(const std::string& fileName, bool withComments) 125 122 { 126 PRINT(0)("===============================================================\n"); 127 PRINT(0)(" Listing all the Loadable Options (loaded since Game started).\n\n"); 123 printf("================== function called\n"); 124 125 FILE* stream; 126 if( (stream = fopen (fileName.c_str(), "w")) == NULL) 127 { 128 PRINTF(2)("File '%s' could not be opened for writing\n Printing to stdout\n", fileName.c_str()); 129 LoadParamClassDescription::printAllTo(stdout, withComments); 130 return; 131 } 132 else 133 LoadParamClassDescription::printAllTo(stream, withComments); 134 135 fclose (stream); 136 } 137 138 /** 139 * @brief prints out all loadable Classes, and their parameters to a stream 140 * @param stream the stream to print to. 141 * @param withComments if Comments should be included. 142 */ 143 void LoadParamClassDescription::printAllTo(FILE* stream, bool withComments) 144 { 145 fprintf(stream, "===============================================================\n"); 146 fprintf(stream, " Listing all the Loadable Options (loaded since Game started).\n\n"); 128 147 for (ClassDescriptionMap::const_iterator classIt = LoadParamClassDescription::_classList.begin(); 129 148 classIt != LoadParamClassDescription::_classList.end(); 130 149 classIt ++) 131 150 { 132 PRINT(0)("<%s>\n", (*classIt).second._className.c_str());151 fprintf(stream, "<%s>\n", (*classIt).second._className.c_str()); 133 152 for (ParamDescriptionMap::const_iterator param = (*classIt).second._parameters.begin(); 134 153 param != (*classIt).second._parameters.end(); 135 154 ++param) 136 155 { 137 (*param).second.print( );156 (*param).second.print(stream, withComments); 138 157 } 139 PRINT(0)("</%s>\n\n", (*classIt).second._className.c_str());158 fprintf(stream, "</%s>\n\n", (*classIt).second._className.c_str()); 140 159 } 141 PRINT(0)("===============================================================\n");160 fprintf(stream, "===============================================================\n"); 142 161 }
Note: See TracChangeset
for help on using the changeset viewer.