class new in Git master
#include <Corrade/Utility/Json.h>
JsonTokenData Data of a single JSON token.
Storage for the actual JSON token data inside a Json, internally referenced from JsonToken instances and accessible through JsonToken::
Together with JsonTokenOffsetSize can be also used to create a Json instance directly from individual tokens, such as when it's desirable to make externally parsed data available through a JSON-compatible interface. See Creating an instance from externally parsed tokens for more information and a detailed usage example.
Constructors, destructors, conversion operators
-
JsonTokenData(JsonToken::
Type type, std:: uint64_t childCountOrStringIndex, bool stringIsKey = false) explicit - Construct a parsed object, array or string token.
-
JsonTokenData(std::
nullptr_t) explicit - Construct a parsed null token.
- JsonTokenData(bool value) explicit
- Construct a parsed bool token.
- JsonTokenData(double value, JsonTokenOffsetSize& offsetSize) explicit
- Construct a parsed 64-bit floating-point token.
- JsonTokenData(float value) explicit
- Construct a parsed 32-bit floating-point token.
-
JsonTokenData(std::
uint32_t value) explicit - Construct a parsed unsigned 32-bit integer token.
-
JsonTokenData(std::
int32_t value) explicit - Construct a parsed signed 32-bit integer token.
-
JsonTokenData(std::
uint64_t value, JsonTokenOffsetSize& offsetSize) explicit - Construct a parsed unsigned 52-bit integer token.
-
JsonTokenData(std::
int64_t value, JsonTokenOffsetSize& offsetSize) explicit - Construct a parsed signed 52-bit integer token.
Function documentation
Corrade:: Utility:: JsonTokenData:: JsonTokenData(JsonToken:: Type type,
std:: uint64_t childCountOrStringIndex,
bool stringIsKey = false) explicit
Construct a parsed object, array or string token.
Parameters | |
---|---|
type | Token type. Expected to be JsonToken:: |
childCountOrStringIndex | Child token count for an object or array or escaped string index for a string. Set to ~std::uint64_t{} for a non-escaped string that's referenced directly from the input data. |
stringIsKey | Set to true if it's a string token that's an object key. Expected to be false otherwise. |
Corrade:: Utility:: JsonTokenData:: JsonTokenData(std:: nullptr_t) explicit
Construct a parsed null token.
Results in a JsonToken::
Corrade:: Utility:: JsonTokenData:: JsonTokenData(bool value) explicit
Construct a parsed bool token.
Results in a JsonToken::
Corrade:: Utility:: JsonTokenData:: JsonTokenData(double value,
JsonTokenOffsetSize& offsetSize) explicit
Construct a parsed 64-bit floating-point token.
Parameters | |
---|---|
value | The numeric value |
offsetSize | Matching token offset and size instance where to store the token type. |
Results in a JsonToken::
Corrade:: Utility:: JsonTokenData:: JsonTokenData(float value) explicit
Construct a parsed 32-bit floating-point token.
Results in a JsonToken::
Corrade:: Utility:: JsonTokenData:: JsonTokenData(std:: uint32_t value) explicit
Construct a parsed unsigned 32-bit integer token.
Results in a JsonToken::
Corrade:: Utility:: JsonTokenData:: JsonTokenData(std:: int32_t value) explicit
Construct a parsed signed 32-bit integer token.
Results in a JsonToken::
Corrade:: Utility:: JsonTokenData:: JsonTokenData(std:: uint64_t value,
JsonTokenOffsetSize& offsetSize) explicit
Construct a parsed unsigned 52-bit integer token.
Parameters | |
---|---|
value | The numeric value |
offsetSize | Matching token offset and size instance where to store the token type. |
Results in a JsonToken::
Corrade:: Utility:: JsonTokenData:: JsonTokenData(std:: int64_t value,
JsonTokenOffsetSize& offsetSize) explicit
Construct a parsed signed 52-bit integer token.
Parameters | |
---|---|
value | The numeric value |
offsetSize | Matching token offset and size instance where to store the token type. |
Results in a JsonToken::