Changeset 7248 in orxonox.OLD for branches/preferences/src/lib/util/preferences.cc
- Timestamp:
- Mar 24, 2006, 7:03:22 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/preferences/src/lib/util/preferences.cc
r7244 r7248 67 67 68 68 break; 69 } 70 } 71 72 return false; 73 } 74 75 /** 76 * Check if this section exists 77 * @param section name of the section 78 * @param name name of the item to check 79 * @return true if the item exists 80 */ 81 bool Preferences::sectionExists( const std::string& section ) 82 { 83 std::list<prefSection>::const_iterator it = data.begin(); 84 85 for ( ; it!=data.end(); it++) 86 { 87 if ( it->sectionName == section ) 88 { 89 return true; 69 90 } 70 91 } … … 285 306 } 286 307 287 308 /** 309 * list all keys in section 310 * @param section section 311 * @return list of keys 312 */ 313 std::list< std::string > Preferences::listKeys( const std::string section ) 314 { 315 std::list<std::string> lst; 316 317 std::list<prefSection>::const_iterator it = data.begin(); 318 319 for ( ; it!=data.end(); it++) 320 { 321 if ( it->sectionName == section ) 322 { 323 std::list<prefItem>::const_iterator it2 = it->items.begin(); 324 325 for ( ; it2!=it->items.end(); it2++) 326 { 327 lst.push_back( it2->name ); 328 } 329 330 break; 331 } 332 } 333 334 return lst; 335 } 336 337
Note: See TracChangeset
for help on using the changeset viewer.