Changeset 5100 in orxonox.OLD for trunk/src/util/loading
- Timestamp:
- Aug 22, 2005, 12:42:28 PM (19 years ago)
- Location:
- trunk/src/util/loading
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/util/loading/load_param.cc
r5099 r5100 17 17 18 18 #include "list.h" 19 #include "array.h" 19 20 #include "base_object.h" 20 21 … … 354 355 /** 355 356 * prints out all loadable Classes, and their parameters 357 * @param fileName prints the output to a File 358 * @todo implement it 356 359 */ 357 360 void LoadClassDescription::printAll(const char* fileName) … … 380 383 } 381 384 382 385 /** 386 * searches for classes, which beginn with classNameBegin 387 * @param classNameBegin the beginning string of a Class 388 * @return a NEW char-array with ClassNames. The ARRAY should be deleted afterwards, 389 * !! The strings MUST NOT be deleted !! 390 */ 391 Array<char*>* LoadClassDescription::searchClassWithShort(const char* classNameBegin) 392 { 393 unsigned int searchLength = strlen(classNameBegin); 394 Array<char*>* retVal = new Array<char*>; 395 396 tIterator<LoadClassDescription>* iterator = LoadClassDescription::classList->getIterator(); 397 LoadClassDescription* enumClassDesc = iterator->nextElement(); 398 while (enumClassDesc) 399 { 400 if (strlen(enumClassDesc->className)>searchLength+1 && 401 !strncasecmp(enumClassDesc->className, classNameBegin, searchLength)) 402 { 403 retVal->addEntry(enumClassDesc->className); 404 } 405 enumClassDesc = iterator->nextElement(); 406 } 407 delete iterator; 408 409 retVal->finalizeArray(); 410 return retVal; 411 } 412 413 // const LoadParamDescription* LoadParamDescription::getClass(const char* className) 414 // { 415 // tIterator<LoadClassDescription>* iterator = LoadClassDescription::classList->getIterator(); 416 // LoadClassDescription* enumClassDesc = iterator->nextElement(); 417 // while (enumClassDesc) 418 // { 419 // if (!strcmp(enumClassDesc->className, classNameBegin, className)) 420 // { 421 // delete iterator; 422 // return enumClassDesc; 423 // } 424 // enumClassDesc = iterator->nextElement(); 425 // } 426 // delete iterator; 427 // 428 // return NULL; 429 // } 383 430 384 431 /** -
trunk/src/util/loading/load_param.h
r5099 r5100 31 31 // Forward Declaration // 32 32 template<class T> class tList; 33 template<class T> class Array; 33 34 34 35 //! macro that makes it even more easy to load a Parameter … … 310 311 LoadParamDescription* addParam(const char* paramName); 311 312 312 313 313 static void printAll(const char* fileName = NULL); 314 static Array<char*>* searchClassWithShort(const char* classNameBegin); 315 // static const LoadParamDescription* getClass(const char* className); 314 316 315 317 private:
Note: See TracChangeset
for help on using the changeset viewer.