neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
neolib::json_detail Namespace Reference

Classes

class  basic_json_node
 
struct  const_iterator_traits
 
struct  default_encoding
 
struct  default_encoding_helper
 
struct  default_encoding_helper< 1 >
 
struct  default_encoding_helper< 2 >
 
struct  default_encoding_helper< 4 >
 
struct  hash_first_character
 
struct  iterator_traits
 

Enumerations

enum class  keyword { True , False , Null }
 
enum class  token : uint8_t {
  Invalid , OpenObject , CloseObject , OpenArray ,
  CloseArray , Colon , Comma , Quote ,
  Character , Escape , EscapingUnicode , Escaped ,
  Plus , Minus , Digit , HexDigit ,
  EscapedOrHexDigit , DecimalPoint , Exponent , Asterisk ,
  ForwardSlash , Symbol , Space , Whitespace ,
  EndOfInput , TOKEN_COUNT
}
 
enum class  state {
  Error , Ignore , EndOfParse , Element ,
  Object , Array , Close , Value ,
  NeedValueSeparator , NeedValue , NeedObjectValueSeparator , NeedObjectValue ,
  Keyword , Name , EndName , String ,
  StringEnd , NumberIntNeedDigit , NumberInt , NumberFracNeedDigit ,
  NumberFrac , NumberExpSign , NumberExpIntNeedDigit , NumberExpInt ,
  Escaping , Escaped , EscapingUnicode , CppStyleComment ,
  CStyleComment , STATE_COUNT
}
 

Functions

std::string to_string (state aState)
 
template<json_syntax Syntax>
constexpr std::array< state, TOKEN_COUNTobject_state ()
 
template<json_syntax Syntax>
constexpr std::array< state, TOKEN_COUNTneed_value_state ()
 
template<json_syntax Syntax>
constexpr std::array< state, TOKEN_COUNTneed_object_value_state ()
 
template<json_syntax Syntax>
constexpr std::array< state, TOKEN_COUNTvalue_state ()
 
template<json_syntax Syntax>
constexpr std::array< state, TOKEN_COUNTkeyword_state ()
 
template<typename CharT >
token to_token (const std::array< token, 256 > &aTokenTable, CharT aCharacter)
 
template<json_syntax Syntax, typename CharT >
state next_state (state aCurrentState, CharT aCharacter)
 
template<json_syntax Syntax, typename CharT >
state next_state (state aCurrentState, state aPreviousState, CharT aCurrentCharacter, CharT aNextCharacter)
 

Variables

constexpr bool debug = false
 
constexpr std::size_t TOKEN_COUNT = static_cast<std::size_t>(token::TOKEN_COUNT)
 
constexpr token TXXX = token::Invalid
 
constexpr token TOBJ = token::OpenObject
 
constexpr token TCLO = token::CloseObject
 
constexpr token TARR = token::OpenArray
 
constexpr token TCLA = token::CloseArray
 
constexpr token TCOL = token::Colon
 
constexpr token TCOM = token::Comma
 
constexpr token TQOT = token::Quote
 
constexpr token TCHA = token::Character
 
constexpr token TESC = token::Escape
 
constexpr token TESU = token::EscapingUnicode
 
constexpr token TECH = token::Escaped
 
constexpr token TPLU = token::Plus
 
constexpr token TMIN = token::Minus
 
constexpr token TDIG = token::Digit
 
constexpr token THEX = token::HexDigit
 
constexpr token TEHX = token::EscapedOrHexDigit
 
constexpr token TDEC = token::DecimalPoint
 
constexpr token TEXP = token::Exponent
 
constexpr token TAST = token::Asterisk
 
constexpr token TFWD = token::ForwardSlash
 
constexpr token TSYM = token::Symbol
 
constexpr token TSPA = token::Space
 
constexpr token TWSP = token::Whitespace
 
constexpr token TZZZ = token::EndOfInput
 
constexpr std::size_t STATE_COUNT = static_cast<std::size_t>(state::STATE_COUNT)
 
constexpr state SXXX = state::Error
 
constexpr state SIGN = state::Ignore
 
constexpr state SZZZ = state::EndOfParse
 
constexpr state SELE = state::Element
 
constexpr state SOBJ = state::Object
 
constexpr state SARR = state::Array
 
constexpr state SCLO = state::Close
 
constexpr state SVAL = state::Value
 
constexpr state SNVS = state::NeedValueSeparator
 
constexpr state SNVA = state::NeedValue
 
constexpr state SOVS = state::NeedObjectValueSeparator
 
constexpr state SNOV = state::NeedObjectValue
 
constexpr state SKEY = state::Keyword
 
constexpr state SNAM = state::Name
 
constexpr state SENM = state::EndName
 
constexpr state SSTR = state::String
 
constexpr state SSEN = state::StringEnd
 
constexpr state SNU1 = state::NumberIntNeedDigit
 
constexpr state SNU2 = state::NumberInt
 
constexpr state SNU3 = state::NumberFracNeedDigit
 
constexpr state SNU4 = state::NumberFrac
 
constexpr state SNU5 = state::NumberExpSign
 
constexpr state SNU6 = state::NumberExpIntNeedDigit
 
constexpr state SNU7 = state::NumberExpInt
 
constexpr state SESC = state::Escaping
 
constexpr state SESD = state::Escaped
 
constexpr state SEUN = state::EscapingUnicode
 
constexpr state SCM1 = state::CppStyleComment
 
constexpr state SCM2 = state::CStyleComment
 
template<json_syntax Syntax>
constexpr std::array< std::array< state, TOKEN_COUNT >, STATE_COUNTsStateTables
 
template<json_syntax Syntax>
constexpr std::array< token, 256 > sTokenTable
 

Enumeration Type Documentation

◆ keyword

Enumerator
True 
False 
Null 

Definition at line 62 of file json.inl.

◆ state

Enumerator
Error 
Ignore 
EndOfParse 
Element 
Object 
Array 
Close 
Value 
NeedValueSeparator 
NeedValue 
NeedObjectValueSeparator 
NeedObjectValue 
Keyword 
Name 
EndName 
String 
StringEnd 
NumberIntNeedDigit 
NumberInt 
NumberFracNeedDigit 
NumberFrac 
NumberExpSign 
NumberExpIntNeedDigit 
NumberExpInt 
Escaping 
Escaped 
EscapingUnicode 
CppStyleComment 
CStyleComment 
STATE_COUNT 

Definition at line 125 of file json.inl.

◆ token

Enumerator
Invalid 
OpenObject 
CloseObject 
OpenArray 
CloseArray 
Colon 
Comma 
Quote 
Character 
Escape 
EscapingUnicode 
Escaped 
Plus 
Minus 
Digit 
HexDigit 
EscapedOrHexDigit 
DecimalPoint 
Exponent 
Asterisk 
ForwardSlash 
Symbol 
Space 
Whitespace 
EndOfInput 
TOKEN_COUNT 

Definition at line 69 of file json.inl.

Function Documentation

◆ keyword_state()

template<json_syntax Syntax>
constexpr std::array< state, TOKEN_COUNT > neolib::json_detail::keyword_state ( )
inlineconstexpr

Definition at line 348 of file json.inl.

◆ need_object_value_state()

template<json_syntax Syntax>
constexpr std::array< state, TOKEN_COUNT > neolib::json_detail::need_object_value_state ( )
inlineconstexpr

Definition at line 302 of file json.inl.

◆ need_value_state()

template<json_syntax Syntax>
constexpr std::array< state, TOKEN_COUNT > neolib::json_detail::need_value_state ( )
inlineconstexpr

Definition at line 279 of file json.inl.

◆ next_state() [1/2]

template<json_syntax Syntax, typename CharT >
state neolib::json_detail::next_state ( state  aCurrentState,
CharT  aCharacter 
)
inline

Definition at line 591 of file json.inl.

◆ next_state() [2/2]

template<json_syntax Syntax, typename CharT >
state neolib::json_detail::next_state ( state  aCurrentState,
state  aPreviousState,
CharT  aCurrentCharacter,
CharT  aNextCharacter 
)
inline

Definition at line 599 of file json.inl.

◆ object_state()

template<json_syntax Syntax>
constexpr std::array< state, TOKEN_COUNT > neolib::json_detail::object_state ( )
inlineconstexpr

Definition at line 256 of file json.inl.

◆ to_string()

std::string neolib::json_detail::to_string ( state  aState)
inline

Definition at line 189 of file json.inl.

◆ to_token()

template<typename CharT >
token neolib::json_detail::to_token ( const std::array< token, 256 > &  aTokenTable,
CharT  aCharacter 
)
inline

Definition at line 584 of file json.inl.

◆ value_state()

template<json_syntax Syntax>
constexpr std::array< state, TOKEN_COUNT > neolib::json_detail::value_state ( )
inlineconstexpr

Definition at line 325 of file json.inl.

Variable Documentation

◆ debug

constexpr bool neolib::json_detail::debug = false
constexpr

Definition at line 60 of file json.inl.

◆ SARR

constexpr state neolib::json_detail::SARR = state::Array
constexpr

Definition at line 164 of file json.inl.

◆ SCLO

constexpr state neolib::json_detail::SCLO = state::Close
constexpr

Definition at line 165 of file json.inl.

◆ SCM1

constexpr state neolib::json_detail::SCM1 = state::CppStyleComment
constexpr

Definition at line 186 of file json.inl.

◆ SCM2

constexpr state neolib::json_detail::SCM2 = state::CStyleComment
constexpr

Definition at line 187 of file json.inl.

◆ SELE

constexpr state neolib::json_detail::SELE = state::Element
constexpr

Definition at line 162 of file json.inl.

◆ SENM

constexpr state neolib::json_detail::SENM = state::EndName
constexpr

Definition at line 173 of file json.inl.

◆ SESC

constexpr state neolib::json_detail::SESC = state::Escaping
constexpr

Definition at line 183 of file json.inl.

◆ SESD

constexpr state neolib::json_detail::SESD = state::Escaped
constexpr

Definition at line 184 of file json.inl.

◆ SEUN

constexpr state neolib::json_detail::SEUN = state::EscapingUnicode
constexpr

Definition at line 185 of file json.inl.

◆ SIGN

constexpr state neolib::json_detail::SIGN = state::Ignore
constexpr

Definition at line 160 of file json.inl.

◆ SKEY

constexpr state neolib::json_detail::SKEY = state::Keyword
constexpr

Definition at line 171 of file json.inl.

◆ SNAM

constexpr state neolib::json_detail::SNAM = state::Name
constexpr

Definition at line 172 of file json.inl.

◆ SNOV

constexpr state neolib::json_detail::SNOV = state::NeedObjectValue
constexpr

Definition at line 170 of file json.inl.

◆ SNU1

constexpr state neolib::json_detail::SNU1 = state::NumberIntNeedDigit
constexpr

Definition at line 176 of file json.inl.

◆ SNU2

constexpr state neolib::json_detail::SNU2 = state::NumberInt
constexpr

Definition at line 177 of file json.inl.

◆ SNU3

constexpr state neolib::json_detail::SNU3 = state::NumberFracNeedDigit
constexpr

Definition at line 178 of file json.inl.

◆ SNU4

constexpr state neolib::json_detail::SNU4 = state::NumberFrac
constexpr

Definition at line 179 of file json.inl.

◆ SNU5

constexpr state neolib::json_detail::SNU5 = state::NumberExpSign
constexpr

Definition at line 180 of file json.inl.

◆ SNU6

constexpr state neolib::json_detail::SNU6 = state::NumberExpIntNeedDigit
constexpr

Definition at line 181 of file json.inl.

◆ SNU7

constexpr state neolib::json_detail::SNU7 = state::NumberExpInt
constexpr

Definition at line 182 of file json.inl.

◆ SNVA

constexpr state neolib::json_detail::SNVA = state::NeedValue
constexpr

Definition at line 168 of file json.inl.

◆ SNVS

constexpr state neolib::json_detail::SNVS = state::NeedValueSeparator
constexpr

Definition at line 167 of file json.inl.

◆ SOBJ

constexpr state neolib::json_detail::SOBJ = state::Object
constexpr

Definition at line 163 of file json.inl.

◆ SOVS

constexpr state neolib::json_detail::SOVS = state::NeedObjectValueSeparator
constexpr

Definition at line 169 of file json.inl.

◆ SSEN

constexpr state neolib::json_detail::SSEN = state::StringEnd
constexpr

Definition at line 175 of file json.inl.

◆ sStateTables

template<json_syntax Syntax>
constexpr std::array<std::array<state, TOKEN_COUNT>, STATE_COUNT> neolib::json_detail::sStateTables
constexpr

Definition at line 380 of file json.inl.

◆ SSTR

constexpr state neolib::json_detail::SSTR = state::String
constexpr

Definition at line 174 of file json.inl.

◆ STATE_COUNT

constexpr std::size_t neolib::json_detail::STATE_COUNT = static_cast<std::size_t>(state::STATE_COUNT)
constexpr

Definition at line 158 of file json.inl.

◆ sTokenTable

template<json_syntax Syntax>
constexpr std::array<token, 256> neolib::json_detail::sTokenTable
constexpr
Initial value:
{
{
},
}
constexpr token TMIN
Definition json.inl:112
constexpr token TCOL
Definition json.inl:104
constexpr token TCOM
Definition json.inl:105
constexpr token TECH
Definition json.inl:110
constexpr token TESC
Definition json.inl:108
constexpr token TEHX
Definition json.inl:115
constexpr token THEX
Definition json.inl:114
constexpr token TSYM
Definition json.inl:120
constexpr token TEXP
Definition json.inl:117
constexpr token TWSP
Definition json.inl:122
constexpr token TESU
Definition json.inl:109
constexpr token TOBJ
Definition json.inl:100
constexpr token TCLO
Definition json.inl:101
constexpr token TZZZ
Definition json.inl:123
constexpr token TPLU
Definition json.inl:111
constexpr token TAST
Definition json.inl:118
constexpr token TFWD
Definition json.inl:119
constexpr token TCLA
Definition json.inl:103
constexpr token TCHA
Definition json.inl:107
constexpr token TARR
Definition json.inl:102
constexpr token TXXX
Definition json.inl:99
constexpr token TSPA
Definition json.inl:121
constexpr token TDIG
Definition json.inl:113
constexpr token TQOT
Definition json.inl:106
constexpr token TDEC
Definition json.inl:116

Definition at line 515 of file json.inl.

◆ SVAL

constexpr state neolib::json_detail::SVAL = state::Value
constexpr

Definition at line 166 of file json.inl.

◆ SXXX

constexpr state neolib::json_detail::SXXX = state::Error
constexpr

Definition at line 159 of file json.inl.

◆ SZZZ

constexpr state neolib::json_detail::SZZZ = state::EndOfParse
constexpr

Definition at line 161 of file json.inl.

◆ TARR

constexpr token neolib::json_detail::TARR = token::OpenArray
constexpr

Definition at line 102 of file json.inl.

◆ TAST

constexpr token neolib::json_detail::TAST = token::Asterisk
constexpr

Definition at line 118 of file json.inl.

◆ TCHA

constexpr token neolib::json_detail::TCHA = token::Character
constexpr

Definition at line 107 of file json.inl.

◆ TCLA

constexpr token neolib::json_detail::TCLA = token::CloseArray
constexpr

Definition at line 103 of file json.inl.

◆ TCLO

constexpr token neolib::json_detail::TCLO = token::CloseObject
constexpr

Definition at line 101 of file json.inl.

◆ TCOL

constexpr token neolib::json_detail::TCOL = token::Colon
constexpr

Definition at line 104 of file json.inl.

◆ TCOM

constexpr token neolib::json_detail::TCOM = token::Comma
constexpr

Definition at line 105 of file json.inl.

◆ TDEC

constexpr token neolib::json_detail::TDEC = token::DecimalPoint
constexpr

Definition at line 116 of file json.inl.

◆ TDIG

constexpr token neolib::json_detail::TDIG = token::Digit
constexpr

Definition at line 113 of file json.inl.

◆ TECH

constexpr token neolib::json_detail::TECH = token::Escaped
constexpr

Definition at line 110 of file json.inl.

◆ TEHX

constexpr token neolib::json_detail::TEHX = token::EscapedOrHexDigit
constexpr

Definition at line 115 of file json.inl.

◆ TESC

constexpr token neolib::json_detail::TESC = token::Escape
constexpr

Definition at line 108 of file json.inl.

◆ TESU

constexpr token neolib::json_detail::TESU = token::EscapingUnicode
constexpr

Definition at line 109 of file json.inl.

◆ TEXP

constexpr token neolib::json_detail::TEXP = token::Exponent
constexpr

Definition at line 117 of file json.inl.

◆ TFWD

constexpr token neolib::json_detail::TFWD = token::ForwardSlash
constexpr

Definition at line 119 of file json.inl.

◆ THEX

constexpr token neolib::json_detail::THEX = token::HexDigit
constexpr

Definition at line 114 of file json.inl.

◆ TMIN

constexpr token neolib::json_detail::TMIN = token::Minus
constexpr

Definition at line 112 of file json.inl.

◆ TOBJ

constexpr token neolib::json_detail::TOBJ = token::OpenObject
constexpr

Definition at line 100 of file json.inl.

◆ TOKEN_COUNT

constexpr std::size_t neolib::json_detail::TOKEN_COUNT = static_cast<std::size_t>(token::TOKEN_COUNT)
constexpr

Definition at line 98 of file json.inl.

◆ TPLU

constexpr token neolib::json_detail::TPLU = token::Plus
constexpr

Definition at line 111 of file json.inl.

◆ TQOT

constexpr token neolib::json_detail::TQOT = token::Quote
constexpr

Definition at line 106 of file json.inl.

◆ TSPA

constexpr token neolib::json_detail::TSPA = token::Space
constexpr

Definition at line 121 of file json.inl.

◆ TSYM

constexpr token neolib::json_detail::TSYM = token::Symbol
constexpr

Definition at line 120 of file json.inl.

◆ TWSP

constexpr token neolib::json_detail::TWSP = token::Whitespace
constexpr

Definition at line 122 of file json.inl.

◆ TXXX

constexpr token neolib::json_detail::TXXX = token::Invalid
constexpr

Definition at line 99 of file json.inl.

◆ TZZZ

constexpr token neolib::json_detail::TZZZ = token::EndOfInput
constexpr

Definition at line 123 of file json.inl.