X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fio%2FTokenStreamReader.hpp;h=7b5a8ff74da6aeb54ceefe9a139b09062df2fd63;hb=5bc84befaa51b81f8f4cfc7d447c553bb471953a;hp=caa620705179c3e8ef51e10d04144d1c8043e2e0;hpb=ede25c0a2f59e21521d1cd962e6ea9d78169ca12;p=blank.git diff --git a/src/io/TokenStreamReader.hpp b/src/io/TokenStreamReader.hpp index caa6207..7b5a8ff 100644 --- a/src/io/TokenStreamReader.hpp +++ b/src/io/TokenStreamReader.hpp @@ -3,10 +3,10 @@ #include "Token.hpp" #include "Tokenizer.hpp" +#include "../graphics/glm.hpp" #include #include -#include namespace blank { @@ -37,13 +37,25 @@ public: void ReadVec(glm::ivec3 &); void ReadVec(glm::ivec4 &); + void ReadQuat(glm::quat &); + + // 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 + bool GetBool(); + bool AsBool() const; float GetFloat(); + float AsFloat() const; int GetInt(); + int AsInt() const; unsigned long GetULong(); + unsigned long AsULong() const; private: - void Assert(Token::Type); + void SkipComments(); + + void Assert(Token::Type) const; Token::Type GetType() const noexcept; const std::string &GetValue() const noexcept;