15#include "AUI/Common/SharedPtr.h"
16#include "AUI/IO/IInputStream.h"
17#include "AUI/Common/AString.h"
18#include "AUI/Common/AColor.h"
19#include "AUI/Common/ASet.h"
21class API_AUI_CORE ATokenizer
26 : mInput(std::move(inputStream))
34 explicit ATokenizer(
const AString& fromString);
46 template<aui::predicate<
char> Callable>
48 mTemporaryStringBuffer.clear();
57 mTemporaryStringBuffer.push_back(c);
62 return mTemporaryStringBuffer;
69 return mTemporaryStringBuffer;
95 if (mBufferRead >= mBufferEnd) {
97 mBufferEnd = mBuffer + mInput->read(mBuffer,
sizeof(mBuffer));
98 mBufferRead = mBuffer;
99 if (mBufferEnd == mBufferRead) {
104 mLastByte = *(mBufferRead++);
106 if (mLastByte ==
'\n')
148 template<
typename underlying_t>
231 AString mTemporaryAStringBuffer;
232 std::string mTemporaryStringBuffer;
235 char* mBufferRead =
nullptr;
236 char* mBufferEnd =
nullptr;
239 bool mReverse =
false;
Thrown when stream has reached end (end of file).
Definition AEOFException.h:20
A std::set with AUI extensions.
Definition ASet.h:25
Represents a Unicode character string.
Definition AString.h:38
unsigned readUInt()
Reads unsigned integer number.
const std::string & readStringWhile(Callable pred)
Reads string while pred(char) == true.
Definition ATokenizer.h:47
const std::string & readString()
Reads string while isalnum == true.
float readFloat()
Reads float point number.
char getLastCharacter()
Definition ATokenizer.h:158
int getColumn() const
Get column counter value. Applicable for error reporting.
Definition ATokenizer.h:176
const std::string & readString(const ASet< char > &applicableChars)
Reads string while isalnum == true and characters contain in applicableChars.
void skipUntil(char c)
Skips character until c.
glm::vec2 readVec2()
reads 2 floats divided by any symbol.
void skipUntilUnescaped(char c)
Skips character until unescaped c.
char readChar()
Reads character.
Definition ATokenizer.h:89
const std::string & readStringUntilUnescaped(char c)
Reads string until unescaped c.
int getRow() const
Get row counter value. Applicable for error reporting.
Definition ATokenizer.h:167
void reverseByte()
Rejects the last read byte and return it into the "stream". Applicable for parsing algorithms.
const std::string & readStringUntilUnescaped(const ASet< char > &characters)
Reads string until unescaped c.
void readStringUntilUnescaped(std::string &out, const ASet< char > &characters)
Reads string until unescaped c.
const std::string & readString(size_t n)
Reads n symbols.
void readStringUntilUnescaped(std::string &out, char c)
Reads string until unescaped c.
int readInt()
Reads integer number.
int64_t readLongInt()
Reads integer number.
An std::weak_ptr with AUI extensions.
Definition SharedPtrTypes.h:179
Reads unsigned integer number + flag the read value is marked as hex (prefixed with 0x)
Definition ATokenizer.h:149