Changeset 2141 in orxonox.OLD for orxonox/branches/chris/src/ini_parser.cc
- Timestamp:
- Jul 14, 2004, 3:31:42 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/chris/src/ini_parser.cc
r2066 r2141 19 19 using namespace std; 20 20 21 /** 22 \brief constructs an IniParser using a file 23 \param filename: the path and name of the file to parse 24 */ 21 25 IniParser::IniParser (char* filename) 22 26 { … … 26 30 } 27 31 32 /** 33 \brief removes the IniParser from memory 34 */ 28 35 IniParser::~IniParser () 29 36 { … … 31 38 } 32 39 40 /** 41 \brief opens another file to parse 42 \param filename: path and name of the new file to parse 43 \return zero on success or -1 if an error occured; 44 */ 33 45 int IniParser::open_file( char* filename) 34 46 { … … 44 56 } 45 57 58 /** 59 \brief set the parsing cursor to the specified section 60 \param section: the name of the section to set the cursor to 61 \return zero on success or -1 if the section could not be found 62 */ 46 63 int IniParser::get_section( char* section) 47 64 { … … 77 94 } 78 95 96 /** 97 \brief gets the next VarName=VarValue pair from the parsing stream 98 \param name: a pointer to a buffer to store the name of the entry 99 \param value: a pointer to a buffer to store the value of the entry 100 \return zero if the buffers have been filled with data or -1 if there are no entries left in the current section 101 */ 79 102 int IniParser::next_var( char* name, char* value) 80 103 { … … 111 134 } 112 135 136 /** 137 \brief directly acesses an entry in a section 138 \param name: the name of the entry to find 139 \param section: the section where the entry is to be found 140 \param defvalue: what should be returned in case the entry cannot be found 141 \return a pointer to a buffer conatining the value of the specified entry. This buffer will contain the data specified in defvalue in case the entry wasn't found 142 143 The returned pointer points to an internal buffer, so do not free it on your own. Do not give a NULL pointer to defvalue, this will certainly 144 lead to unwanted behaviour. 145 */ 113 146 char* IniParser::get_var( char* name, char* section, char* defvalue = "") 114 147 {
Note: See TracChangeset
for help on using the changeset viewer.