bpf::json::Lexer class

A simple Json Lexer

Public types

struct Token
enum ETokenType { STRING, NUMBER, BASIC }

Constructors, destructors, conversion operators

Lexer(bool enableComments = false, bool ignoreNulls = false)

Public functions

void LoadString(const String& input)
auto ReadTokens() -> collection::Queue<Token>
auto IgnoreNulls() const -> bool noexcept

Function documentation

bpf::json::Lexer::Lexer(bool enableComments = false, bool ignoreNulls = false)

Parameters
enableComments true if this Lexer should accept comments, false otherwise
ignoreNulls true if null values should be omitted, false otherwise

Constructs a Lexer

void bpf::json::Lexer::LoadString(const String& input)

Parameters
input the input string to load and process
Exceptions
JsonParseException when the lexer could not identify a token in the input string

Loads a string a processes it

collection::Queue<Token> bpf::json::Lexer::ReadTokens()

Returns All extracted tokens

Extract all tokens from this Lexer, this function also purges the token cache and resets this Lexer's state

bool bpf::json::Lexer::IgnoreNulls() const noexcept

Returns true if null values should be omitted, false otherwise

Check if this Lexer/Parser should ommit null values