]> git.localhorst.tv Git - blank.git/blobdiff - src/io/TokenStreamReader.hpp
some linting
[blank.git] / src / io / TokenStreamReader.hpp
index caa620705179c3e8ef51e10d04144d1c8043e2e0..f1b73491447c5c662aa37b219b2e42b0d5c283db 100644 (file)
@@ -3,10 +3,10 @@
 
 #include "Token.hpp"
 #include "Tokenizer.hpp"
+#include "../graphics/glm.hpp"
 
 #include <iosfwd>
 #include <string>
-#include <glm/glm.hpp>
 
 
 namespace blank {
@@ -14,7 +14,7 @@ namespace blank {
 class TokenStreamReader {
 
 public:
-       TokenStreamReader(std::istream &);
+       explicit TokenStreamReader(std::istream &);
 
        bool HasMore();
        const Token &Next();
@@ -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;