diff options
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); |