Rev | Line | |
---|
[6383] | 1 | /* |
---|
| 2 | orxonox - the future of 3D-vertical-scrollers |
---|
| 3 | |
---|
| 4 | Copyright (C) 2004 orx |
---|
| 5 | |
---|
| 6 | This program is free software; you can redistribute it and/or modify |
---|
| 7 | it under the terms of the GNU General Public License as published by |
---|
| 8 | the Free Software Foundation; either version 2, or (at your option) |
---|
| 9 | any later version. |
---|
| 10 | |
---|
| 11 | ### File Specific: |
---|
| 12 | main-programmer: Christoph Renner |
---|
| 13 | co-programmer: ... |
---|
| 14 | */ |
---|
| 15 | |
---|
| 16 | //#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_ |
---|
| 17 | |
---|
| 18 | #include "ini_file_prefs_reader.h" |
---|
| 19 | |
---|
| 20 | using namespace std; |
---|
| 21 | |
---|
| 22 | |
---|
| 23 | /** |
---|
| 24 | * standard constructor |
---|
| 25 | */ |
---|
[7236] | 26 | IniFilePrefsReader::IniFilePrefsReader ( const std::string& fileName ) |
---|
[6383] | 27 | { |
---|
[6388] | 28 | IniParser iniParser; |
---|
[6383] | 29 | |
---|
[7661] | 30 | |
---|
| 31 | Preferences* prefs = Preferences::getInstance(); |
---|
| 32 | |
---|
| 33 | prefs->setUserIni( fileName ); |
---|
| 34 | |
---|
[6388] | 35 | if ( !iniParser.readFile( fileName ) ) |
---|
| 36 | return; |
---|
[6383] | 37 | |
---|
[6388] | 38 | iniParser.firstSection(); |
---|
[6383] | 39 | |
---|
[6388] | 40 | do |
---|
| 41 | { |
---|
| 42 | do |
---|
| 43 | { |
---|
| 44 | prefs->setString( iniParser.getCurrentSection(), iniParser.getCurrentName(), iniParser.getCurrentValue(), true ); |
---|
| 45 | } while (iniParser.nextVar()); |
---|
[7236] | 46 | } while ( iniParser.nextSection() != "" ); |
---|
[6383] | 47 | |
---|
[6388] | 48 | /*iniParser.firstVar(); |
---|
[6383] | 49 | |
---|
| 50 | Preferences* prefs = Preferences::getInstance(); |
---|
| 51 | |
---|
| 52 | while ( iniParser.nextVar() ) |
---|
| 53 | { |
---|
[6388] | 54 | prefs->setString( iniParser.getCurrentSection(), iniParser.getCurrentName(), iniParser.getCurrentValue(), true ); |
---|
| 55 | }*/ |
---|
| 56 | } |
---|
[6383] | 57 | |
---|
[6388] | 58 | |
---|
| 59 | /** |
---|
| 60 | * standard deconstructor |
---|
| 61 | */ |
---|
| 62 | IniFilePrefsReader::~IniFilePrefsReader () |
---|
| 63 | { |
---|
[6383] | 64 | } |
---|
[6388] | 65 | |
---|
| 66 | |
---|
Note: See
TracBrowser
for help on using the repository browser.