X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fio%2FTokenStreamReader.hpp;h=ea3a6ccbca1af7d5463d283e8b65329b5da6e889;hb=f85083db1989c218d91a09f43dd92fde9fb179c7;hp=f1b73491447c5c662aa37b219b2e42b0d5c283db;hpb=3185bad87c06739e4ec19b456c7158437ba9621f;p=blank.git diff --git a/src/io/TokenStreamReader.hpp b/src/io/TokenStreamReader.hpp index f1b7349..ea3a6cc 100644 --- a/src/io/TokenStreamReader.hpp +++ b/src/io/TokenStreamReader.hpp @@ -28,6 +28,9 @@ public: void ReadNumber(int &); void ReadNumber(unsigned long &); void ReadString(std::string &); + // like ReadString, but does not require the value to be + // written as a string literal in source + void ReadRelaxedString(std::string &); void ReadVec(glm::vec2 &); void ReadVec(glm::vec3 &); @@ -42,6 +45,7 @@ public: // the Get* functions advance to the next token // the As* functions try to cast the current token // if the value could not be converted, a std::runtime_error is thrown + // conversion to string is always possible bool GetBool(); bool AsBool() const; @@ -51,6 +55,8 @@ public: int AsInt() const; unsigned long GetULong(); unsigned long AsULong() const; + const std::string &GetString(); + const std::string &AsString() const; private: void SkipComments();