Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-12-25 12:13:56 +0000
committerStijn Buys <ingar@osirion.org>2008-12-25 12:13:56 +0000
commitbfa10f9990a8a045b03474d11af75984c12a856a (patch)
tree87ff30329be78b8012d545b097b669b746ab0fc0 /src/filesystem/inifile.cc
parent164e3c5b1cd9e6d6f7ca26964df4c54394eb1c84 (diff)
Improved list_zone, list_ships
Ship price and cargo size
Diffstat (limited to 'src/filesystem/inifile.cc')
-rw-r--r--src/filesystem/inifile.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/filesystem/inifile.cc b/src/filesystem/inifile.cc
index ddb1c63..96bfd55 100644
--- a/src/filesystem/inifile.cc
+++ b/src/filesystem/inifile.cc
@@ -161,6 +161,18 @@ bool IniFile::got_key_float(const char * keylabel, float & f) {
}
}
+bool IniFile::got_key_long(const char * keylabel, long & l) {
+ if (last_read_was_key && (key_current.compare(keylabel) == 0 )) {
+ std::istringstream is(value_current);
+ if (!(is >> l)) {
+ l = 0;
+ }
+ return true;
+ } else {
+ return false;
+ }
+}
+
bool IniFile::got_key(const char * keylabel) {
return (last_read_was_key && (key_current.compare(keylabel) == 0 ));
}