- Timestamp:
- Aug 15, 2005, 9:39:51 PM (19 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/defs/stdlibincl.h
r4381 r5031 1 1 /*! 2 \file stdlibincl.h3 \briefsome headers of the stdlib4 5 no Class is defined here.6 */2 * @file stdlibincl.h 3 * some headers of the stdlib 4 * 5 * no Class is defined here. 6 */ 7 7 8 8 #ifndef _STDLIBINCL_H -
orxonox/trunk/src/lib/util/ini_parser.cc
r5022 r5031 22 22 23 23 #include "list.h" 24 #include "stdlibincl.h" 24 #include <stdlib.h> 25 #include <string.h> 25 26 #include "debug.h" 26 27 … … 33 34 IniParser::IniParser (const char* fileName) 34 35 { 35 this->setClassID(CL_INI_PARSER, "IniParser");36 37 36 this->currentEntry = NULL; 38 37 this->currentSection = NULL; 39 38 this->sections = NULL; 39 this->fileName = NULL; 40 40 if (fileName != NULL) 41 41 this->readFile(fileName); … … 83 83 this->currentSection = NULL; 84 84 this->sections = NULL; 85 this->set Name(NULL);85 this->setFileName(NULL); 86 86 } 87 87 … … 98 98 if( fileName == NULL) 99 99 return false; 100 this->set Name(fileName);100 this->setFileName(fileName); 101 101 102 102 if( (stream = fopen (fileName, "r")) == NULL) … … 234 234 this->currentSection = newSection; 235 235 this->sections->add(newSection); 236 PRINTF( 0)("Added Section %s\n", sectionName);236 PRINTF(5)("Added Section %s\n", sectionName); 237 237 return true; 238 238 } … … 375 375 strcpy(newEntry->value, value); 376 376 this->currentSection->entries->add(newEntry); 377 PRINTF(5)("Added Entry %s with Value '%s' to Section %s\n", newEntry->name, newEntry->name, addSection->name); 377 378 return true; 378 379 } … … 421 422 } 422 423 else 423 PRINTF(1)("%s not opened\n", this->getName());424 PRINTF(1)("%s not opened\n", fileName); 424 425 425 426 return defaultValue; … … 427 428 } 428 429 430 431 void IniParser::setFileName(const char* fileName) 432 { 433 if (this->fileName) 434 delete []this->fileName; 435 if (fileName) 436 { 437 this->fileName = new char[strlen(fileName)+1]; 438 strcpy(this->fileName, fileName); 439 } 440 else 441 this->fileName = NULL; 442 } 443 444 429 445 /** 430 446 * output the whole tree in a nice and easy way. … … 432 448 void IniParser::debug() const 433 449 { 434 PRINTF(0)("Iniparser %s - debug\n", this-> getName());450 PRINTF(0)("Iniparser %s - debug\n", this->fileName); 435 451 if (this->sections) 436 452 { … … 456 472 } 457 473 else 458 PRINTF(1)("%s not opened\n", this->getName());459 } 474 PRINTF(1)("%s not opened\n", fileName); 475 } -
orxonox/trunk/src/lib/util/ini_parser.h
r5020 r5031 10 10 11 11 #define PARSELINELENGHT 512 //!< how many chars to read at once 12 13 #include "base_object.h" 12 #ifndef NULL 13 #define NULL 0x0 //!< NULL 14 #endif 14 15 15 16 // FORWARD DEFINITION // … … 20 21 * This class can be used to load an initializer file and parse it's contents for variablename=value pairs. 21 22 */ 22 class IniParser : public BaseObject23 class IniParser 23 24 { 24 25 private: … … 53 54 /** @returns true if the file is opened, false otherwise*/ 54 55 bool isOpen() const { return (sections != NULL)?true:false; }; 56 /** @returns the fileName we have opened. */ 57 const char* getFileName() const { return this->fileName; }; 55 58 56 59 bool addVar(const char* entryName, const char* value, const char* sectionName = NULL); … … 71 74 private: 72 75 void deleteSections(); 76 void setFileName(const char* fileName); 73 77 74 78 private: 79 char* fileName; //!< The name of the File that was parsed. 75 80 tList<IniSection>* sections; //!< a list of all stored Sections of the Parser 76 81 IniSection* currentSection; //!< the current selected Section -
orxonox/trunk/src/subprojects/importer/Makefile.am
r4908 r5031 31 31 $(MAINSRCDIR)/util/loading/load_param.cc \ 32 32 $(MAINSRCDIR)/lib/util/substring.cc \ 33 $(MAINSRCDIR)/lib/util/color.cc \ 33 34 $(MAINSRCDIR)/util/loading/factory.cc -
orxonox/trunk/src/subprojects/importer/Makefile.in
r4908 r5031 61 61 importer-p_node.$(OBJEXT) importer-null_parent.$(OBJEXT) \ 62 62 importer-load_param.$(OBJEXT) importer-substring.$(OBJEXT) \ 63 importer- factory.$(OBJEXT)63 importer-color.$(OBJEXT) importer-factory.$(OBJEXT) 64 64 importer_OBJECTS = $(am_importer_OBJECTS) 65 65 importer_DEPENDENCIES = $(MAINSRCDIR)/lib/event/libORXevent.a \ … … 73 73 @AMDEP_TRUE@ ./$(DEPDIR)/importer-camera.Po \ 74 74 @AMDEP_TRUE@ ./$(DEPDIR)/importer-class_list.Po \ 75 @AMDEP_TRUE@ ./$(DEPDIR)/importer-color.Po \ 75 76 @AMDEP_TRUE@ ./$(DEPDIR)/importer-element_2d.Po \ 76 77 @AMDEP_TRUE@ ./$(DEPDIR)/importer-factory.Po \ … … 233 234 $(MAINSRCDIR)/util/loading/load_param.cc \ 234 235 $(MAINSRCDIR)/lib/util/substring.cc \ 236 $(MAINSRCDIR)/lib/util/color.cc \ 235 237 $(MAINSRCDIR)/util/loading/factory.cc 236 238 … … 304 306 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/importer-camera.Po@am__quote@ 305 307 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/importer-class_list.Po@am__quote@ 308 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/importer-color.Po@am__quote@ 306 309 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/importer-element_2d.Po@am__quote@ 307 310 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/importer-factory.Po@am__quote@ … … 624 627 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 625 628 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(importer_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o importer-substring.obj `if test -f '$(MAINSRCDIR)/lib/util/substring.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/util/substring.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/util/substring.cc'; fi` 629 630 importer-color.o: $(MAINSRCDIR)/lib/util/color.cc 631 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(importer_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT importer-color.o -MD -MP -MF "$(DEPDIR)/importer-color.Tpo" -c -o importer-color.o `test -f '$(MAINSRCDIR)/lib/util/color.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/util/color.cc; \ 632 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/importer-color.Tpo" "$(DEPDIR)/importer-color.Po"; else rm -f "$(DEPDIR)/importer-color.Tpo"; exit 1; fi 633 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/util/color.cc' object='importer-color.o' libtool=no @AMDEPBACKSLASH@ 634 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/importer-color.Po' tmpdepfile='$(DEPDIR)/importer-color.TPo' @AMDEPBACKSLASH@ 635 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 636 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(importer_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o importer-color.o `test -f '$(MAINSRCDIR)/lib/util/color.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/util/color.cc 637 638 importer-color.obj: $(MAINSRCDIR)/lib/util/color.cc 639 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(importer_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT importer-color.obj -MD -MP -MF "$(DEPDIR)/importer-color.Tpo" -c -o importer-color.obj `if test -f '$(MAINSRCDIR)/lib/util/color.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/util/color.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/util/color.cc'; fi`; \ 640 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/importer-color.Tpo" "$(DEPDIR)/importer-color.Po"; else rm -f "$(DEPDIR)/importer-color.Tpo"; exit 1; fi 641 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/util/color.cc' object='importer-color.obj' libtool=no @AMDEPBACKSLASH@ 642 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/importer-color.Po' tmpdepfile='$(DEPDIR)/importer-color.TPo' @AMDEPBACKSLASH@ 643 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 644 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(importer_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o importer-color.obj `if test -f '$(MAINSRCDIR)/lib/util/color.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/util/color.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/util/color.cc'; fi` 626 645 627 646 importer-factory.o: $(MAINSRCDIR)/util/loading/factory.cc -
orxonox/trunk/src/subprojects/particles/Makefile.am
r4908 r5031 37 37 $(MAINSRCDIR)/util/loading/load_param.cc \ 38 38 $(MAINSRCDIR)/util/loading/factory.cc \ 39 $(MAINSRCDIR)/lib/util/color.cc \ 39 40 $(MAINSRCDIR)/lib/util/ini_parser.cc 40 41 -
orxonox/trunk/src/subprojects/particles/Makefile.in
r4908 r5031 63 63 particles-null_parent.$(OBJEXT) particles-gui_gtk.$(OBJEXT) \ 64 64 particles-substring.$(OBJEXT) particles-load_param.$(OBJEXT) \ 65 particles-factory.$(OBJEXT) particles-ini_parser.$(OBJEXT) 65 particles-factory.$(OBJEXT) particles-color.$(OBJEXT) \ 66 particles-ini_parser.$(OBJEXT) 66 67 particles_OBJECTS = $(am_particles_OBJECTS) 67 68 am__DEPENDENCIES_1 = … … 80 81 @AMDEP_TRUE@ ./$(DEPDIR)/particles-camera.Po \ 81 82 @AMDEP_TRUE@ ./$(DEPDIR)/particles-class_list.Po \ 83 @AMDEP_TRUE@ ./$(DEPDIR)/particles-color.Po \ 82 84 @AMDEP_TRUE@ ./$(DEPDIR)/particles-element_2d.Po \ 83 85 @AMDEP_TRUE@ ./$(DEPDIR)/particles-factory.Po \ … … 249 251 $(MAINSRCDIR)/util/loading/load_param.cc \ 250 252 $(MAINSRCDIR)/util/loading/factory.cc \ 253 $(MAINSRCDIR)/lib/util/color.cc \ 251 254 $(MAINSRCDIR)/lib/util/ini_parser.cc 252 255 … … 320 323 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/particles-camera.Po@am__quote@ 321 324 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/particles-class_list.Po@am__quote@ 325 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/particles-color.Po@am__quote@ 322 326 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/particles-element_2d.Po@am__quote@ 323 327 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/particles-factory.Po@am__quote@ … … 674 678 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 675 679 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(particles_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o particles-factory.obj `if test -f '$(MAINSRCDIR)/util/loading/factory.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/util/loading/factory.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/util/loading/factory.cc'; fi` 680 681 particles-color.o: $(MAINSRCDIR)/lib/util/color.cc 682 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(particles_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT particles-color.o -MD -MP -MF "$(DEPDIR)/particles-color.Tpo" -c -o particles-color.o `test -f '$(MAINSRCDIR)/lib/util/color.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/util/color.cc; \ 683 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/particles-color.Tpo" "$(DEPDIR)/particles-color.Po"; else rm -f "$(DEPDIR)/particles-color.Tpo"; exit 1; fi 684 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/util/color.cc' object='particles-color.o' libtool=no @AMDEPBACKSLASH@ 685 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/particles-color.Po' tmpdepfile='$(DEPDIR)/particles-color.TPo' @AMDEPBACKSLASH@ 686 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 687 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(particles_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o particles-color.o `test -f '$(MAINSRCDIR)/lib/util/color.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/util/color.cc 688 689 particles-color.obj: $(MAINSRCDIR)/lib/util/color.cc 690 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(particles_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT particles-color.obj -MD -MP -MF "$(DEPDIR)/particles-color.Tpo" -c -o particles-color.obj `if test -f '$(MAINSRCDIR)/lib/util/color.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/util/color.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/util/color.cc'; fi`; \ 691 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/particles-color.Tpo" "$(DEPDIR)/particles-color.Po"; else rm -f "$(DEPDIR)/particles-color.Tpo"; exit 1; fi 692 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/util/color.cc' object='particles-color.obj' libtool=no @AMDEPBACKSLASH@ 693 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/particles-color.Po' tmpdepfile='$(DEPDIR)/particles-color.TPo' @AMDEPBACKSLASH@ 694 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 695 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(particles_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o particles-color.obj `if test -f '$(MAINSRCDIR)/lib/util/color.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/util/color.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/util/color.cc'; fi` 676 696 677 697 particles-ini_parser.o: $(MAINSRCDIR)/lib/util/ini_parser.cc
Note: See TracChangeset
for help on using the changeset viewer.