class
JsonContents
Represents an arbitary Json value
Public types
Constructors, destructors, conversion operators
- Json()
- Json(const Json& other)
- Json(Json&& other) noexcept
- Json(const double val)
- Json(const int64 val)
- Json(const bool val)
- Json(const String& val)
- Json(const char* val)
- Json(String&& val)
- Json(const Object& val)
- Json(Object&& val)
- Json(const Array& arr)
- Json(Array&& arr)
- operator double() const
- operator int64() const
- operator bool() const
- operator const String&() const
- operator const Array&() const
- operator const Object&() const
- operator Array&()
- operator Object&()
Public functions
- auto operator=(const Json& other) -> Json&
- auto operator=(Json&& other) -> Json& noexcept
- auto operator=(const double val) -> Json&
- auto operator=(const int64 val) -> Json&
- auto operator=(const bool val) -> Json&
- auto operator=(const String& val) -> Json&
- auto operator=(const char* val) -> Json&
- auto operator=(const Object& val) -> Json&
- auto operator=(const Array& val) -> Json&
-
auto Type() const -> _
bpf_ noexceptinternal_ json_ type - auto operator==(double other) const -> bool
- auto operator==(int64 other) const -> bool
- auto operator==(bool other) const -> bool
- auto operator==(const String& other) const -> bool
- auto operator==(const char* other) const -> bool
- auto ToDouble() const -> double
- auto ToInteger() const -> int64
- auto ToBoolean() const -> bool
- auto ToString() const -> const String&
- auto ToArray() const -> const Array&
- auto ToObject() const -> const Object&
Enum documentation
enum bpf::json::Json::EType
Enumeration to represent the type of a Json value
Enumerators | |
---|---|
DOUBLE |
Indicates a Json number that stores doubles |
INTEGER |
Indicates a Json number that stores integers |
BOOLEAN |
Indicates a Json boolean |
STRING |
Indicates a Json string |
ARRAY |
Indicates a Json array |
OBJECT |
Indicates a Json object |
NONE |
Indicates Json null |
Function documentation
bpf::json::Json:: operator double() const
Returns | double |
---|---|
Exceptions | |
JsonException | if the value type is not compatible |
Converts this value to a number
bpf::json::Json:: operator int64() const
Returns | integer 64 bits |
---|---|
Exceptions | |
JsonException | if the value type is not compatible |
Converts this value to a number
bpf::json::Json:: operator bool() const
Returns | bool |
---|---|
Exceptions | |
JsonException | if the value type is not compatible |
Converts this value to a boolean
bpf::json::Json:: operator const String&() const
Returns | immutable high-level string reference |
---|---|
Exceptions | |
JsonException | if the value type is not compatible |
Converts this value to a string
bpf::json::Json:: operator const Array&() const
Returns | immutable Array reference |
---|---|
Exceptions | |
JsonException | if the value type is not compatible |
bpf::json::Json:: operator const Object&() const
Returns | immutable Object reference |
---|---|
Exceptions | |
JsonException | if the value type is not compatible |
bpf::json::Json:: operator Array&()
Returns | mutable Array reference |
---|---|
Exceptions | |
JsonException | if the value type is not compatible |
bpf::json::Json:: operator Object&()
Returns | mutable Object reference |
---|---|
Exceptions | |
JsonException | if the value type is not compatible |
_bpf_internal_json_type bpf::json::Json:: Type() const noexcept
Returns | Json:: |
---|
Returns the type of this Json value
bool bpf::json::Json:: operator==(double other) const
Parameters | |
---|---|
other | value to compare with |
Returns | true if this is equal to other, false otherwise |
Compares a Json value with a number
bool bpf::json::Json:: operator==(int64 other) const
Parameters | |
---|---|
other | value to compare with |
Returns | true if this is equal to other, false otherwise |
Compares a Json value with a number
bool bpf::json::Json:: operator==(bool other) const
Parameters | |
---|---|
other | value to compare with |
Returns | true if this is equal to other, false otherwise |
Compares a Json value with a boolean
bool bpf::json::Json:: operator==(const String& other) const
Parameters | |
---|---|
other | value to compare with |
Returns | true if this is equal to other, false otherwise |
Compares a Json value with a string
bool bpf::json::Json:: operator==(const char* other) const
Parameters | |
---|---|
other | value to compare with |
Returns | true if this is equal to other, false otherwise |
Compares a Json value with a string
double bpf::json::Json:: ToDouble() const
Returns | double |
---|---|
Exceptions | |
JsonException | if the value type is not compatible |
Converts this value to a number
int64 bpf::json::Json:: ToInteger() const
Returns | integer 64 bits |
---|---|
Exceptions | |
JsonException | if the value type is not compatible |
Converts this value to a number
bool bpf::json::Json:: ToBoolean() const
Returns | bool |
---|---|
Exceptions | |
JsonException | if the value type is not compatible |
Converts this value to a boolean
const String& bpf::json::Json:: ToString() const
Returns | immutable high-level string reference |
---|---|
Exceptions | |
JsonException | if the value type is not compatible |
Converts this value to a string