#ifndef TOKENSTREAM_H #define TOKENSTREAM_H #include #include "tokenizer/TokenType.h" class TokenStream final { public: TokenStream(); bool hasToken() const; std::string nextTokenString(); TokenType nextTokenType(); unsigned int nextLine(); std::string nextString(); double nextDouble(); void add(TokenType type, unsigned int line); void add(TokenType type, unsigned int line, double d); void add(TokenType type, unsigned int line, const std::string& text); private: void write(const void* data, size_t length); void read(void* data, size_t length); private: size_t nextToken; std::vector bytes; }; #endif