diff options
author | Stijn Buys <ingar@osirion.org> | 2012-02-19 11:54:26 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2012-02-19 11:54:26 +0000 |
commit | 96f17eaf3a1f66d7eefd66e51e2137ea404459f4 (patch) | |
tree | 4e85c02171ce0e90975bb690e19d44c00975e642 /src/inistream.cc | |
parent | f7530ccf9ce71efcb00cda56ee9d71e7765e6f79 (diff) |
Read entity properties, added entity selection and scaling.
Diffstat (limited to 'src/inistream.cc')
-rw-r--r-- | src/inistream.cc | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/src/inistream.cc b/src/inistream.cc index 1e76ab8..c89056f 100644 --- a/src/inistream.cc +++ b/src/inistream.cc @@ -121,9 +121,8 @@ bool IniStream::got_key_string(const char *keylabel, QString &valuestring) if (last_read_was_key && (key_current.compare(keylabel) == 0)) { valuestring = value_current; return true; - } else { - return false; } + return false; } bool IniStream::got_key_vector3f(const char *keylabel, float &x, float &y, float &z) @@ -134,36 +133,34 @@ bool IniStream::got_key_vector3f(const char *keylabel, float &x, float &y, float ts >> x; ts >> y; ts >> z; - return true; - } else { - return false; + return true; } + return false; } -/* -bool IniStream::got_key_label(const char * keylabel, QString & labelstring) +bool IniStream::got_key_float(const char *keylabel, float & f) { if (last_read_was_key && (key_current.compare(keylabel) == 0)) { - labelstring = value_current.trimmed(); + QTextStream ts(&value_current, QIODevice::ReadOnly); + f = 0; + ts >> f; return true; - } else { - return false; } + return false; } -bool IniStream::got_key_float(const char * keylabel, float & f) +/* +bool IniStream::got_key_label(const char * keylabel, QString & labelstring) { if (last_read_was_key && (key_current.compare(keylabel) == 0)) { - std::istringstream is(value_current); - if (!(is >> f)) { - f = 0; - } + labelstring = value_current.trimmed(); return true; } else { return false; } } + bool IniStream::got_key_long(const char * keylabel, long & l) { if (last_read_was_key && (key_current.compare(keylabel) == 0)) { |