Changeset 7234 in orxonox.OLD for branches/preferences
- Timestamp:
- Mar 21, 2006, 3:36:22 PM (19 years ago)
- Location:
- branches/preferences
- Files:
-
- 5 edited
- 8 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/preferences/AUTHORS
r4604 r7234 1 1 orxonox-crew: <orxonox-dev@mail.datacore.ch> 2 2 3 Maintainers: 3 4 Patrick Boenzli <patrick@orxonox.ethz.ch> 4 5 Benjamin Grauer <bensch@orxonox.ethz.ch> 6 7 Developers: 8 Christian Meyer 9 David Gruetter 10 11 Coders: 5 12 Simon Hofmann 6 David Gruetter7 13 Johannes Bader 8 14 Adrian Buerli 9 Christian Meyer 15 16 -
branches/preferences/src/defs/class_id.h
r7193 r7234 96 96 CL_MASK_LOWLEVEL_CLASS = 0x00000fff, 97 97 98 CL_PREFERENCES = 0X00000f51, 98 99 99 100 /// SINGLETON classes (range from 0x00000000 to 0x000000ff) -
branches/preferences/src/lib/parser/Makefile.am
r5944 r7234 1 1 SUBDIRS = \ 2 2 tinyxml \ 3 ini_parser 3 ini_parser \ 4 preferences 4 5 5 6 -
branches/preferences/src/lib/parser/ini_parser/ini_parser.cc
r7221 r7234 392 392 } 393 393 394 /** 395 * @brief edits the entry speciefied by entryName in sectionName/currentSection or creates it if it doesn't exist 396 * @param entryName the Name of the Entry to add 397 * @param value the value to assign to this entry 398 * @param sectionName if NULL then this entry will be set to the currentSection 399 * otherwise to the section refered to by sectionName. 400 * If both are NULL no entry will be added 401 * @return true if everything is ok false on error 402 */ 403 bool IniParser::editVar(const char* entryName, const char* value, const char* sectionName) 404 { 405 std::list<IniSection>::iterator section; 406 407 if (sectionName != NULL) 408 { 409 for (section = this->sections.begin(); section != this->sections.end(); section++) 410 if (!strcmp((*section).name, sectionName)) 411 break; 412 } 413 else 414 section = this->currentSection; 415 416 if (section == this->sections.end()) 417 { 418 IniSection sec; 419 sec.comment = NULL; 420 sec.name = new char[strlen(sectionName)+1]; 421 strcpy(sec.name, sectionName); 422 section = this->sections.insert(this->sections.end(), sec); 423 } 424 425 if (section == this->sections.end()) 426 { 427 PRINTF(2)("section '%s' not found for value '%s'\n", sectionName, entryName); 428 return false; 429 } 430 else 431 { 432 //try find item 433 std::list<IniEntry>::iterator entry; 434 for (entry = section->entries.begin(); entry!=section->entries.end(); entry++) 435 if (!strcmp( entry->name, entryName )) 436 break; 437 438 //found it? 439 if ( entry != section->entries.end() ) 440 { 441 if ( entry->value != NULL ) 442 { 443 delete[] entry->value; 444 } 445 entry->value = new char[strlen(value)+1]; 446 strcpy(entry->value, value); 447 448 return true; 449 } 450 451 //not found -> create it 452 (*section).entries.push_back(IniEntry()); 453 (*section).entries.back().comment = NULL; 454 (*section).entries.back().name = new char[strlen(entryName)+1]; 455 strcpy((*section).entries.back().name, entryName); 456 (*section).entries.back().value = new char[strlen(value)+1]; 457 strcpy((*section).entries.back().value, value); 458 PRINTF(5)("Added Entry %s with Value '%s' to Section %s\n", 459 (*section).entries.back().name, 460 (*section).entries.back().value, 461 (*section).name); 462 this->currentEntry = --(*section).entries.end(); 463 return true; 464 } 465 } 466 394 467 395 468 /** -
branches/preferences/src/orxonox.cc
r7221 r7234 58 58 59 59 #include "state.h" 60 60 #include "lib/parser/preferences/cmd_line_prefs_reader.h" 61 61 #include <string.h> 62 62 … … 403 403 int main(int argc, char** argv) 404 404 { 405 int i; 405 CmdLinePrefsReader prefs(argc, argv); 406 407 /*int i; 406 408 for(i = 1; i < argc; ++i) 407 409 { … … 416 418 else if(!strcmp( "--license", argv[i]) || !strcmp("-l", argv[i])) 417 419 return PRINT(0)(ORXONOX_LICENSE_SHORT); 418 } 419 420 return startOrxonox(argc, argv, NULL, -1); 420 } 421 422 return startOrxonox(argc, argv, NULL, -1);*/ 423 return 0; 421 424 } 422 425
Note: See TracChangeset
for help on using the changeset viewer.