diff options
author | Stijn Buys <ingar@osirion.org> | 2008-12-25 12:13:56 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-12-25 12:13:56 +0000 |
commit | bfa10f9990a8a045b03474d11af75984c12a856a (patch) | |
tree | 87ff30329be78b8012d545b097b669b746ab0fc0 /src/filesystem | |
parent | 164e3c5b1cd9e6d6f7ca26964df4c54394eb1c84 (diff) |
Improved list_zone, list_ships
Ship price and cargo size
Diffstat (limited to 'src/filesystem')
-rw-r--r-- | src/filesystem/inifile.cc | 12 | ||||
-rw-r--r-- | src/filesystem/inifile.h | 2 |
2 files changed, 14 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 )); } diff --git a/src/filesystem/inifile.h b/src/filesystem/inifile.h index f118f7b..f064bc7 100644 --- a/src/filesystem/inifile.h +++ b/src/filesystem/inifile.h @@ -72,6 +72,8 @@ public: bool got_key_angle(const char * keylabel, float & f); + bool got_key_long(const char * keylabel, long & l); + bool got_key_vector3f(const char * keylabel, math::Vector3f & v); bool got_key_bool(const char * keylabel, bool & b); |