![]() |
OpenSiv3D
v0.6.5
C++20 framework for creative coding
|
#include <JSON.hpp>
Public Types | |
using | iterator = JSONIterator |
using | const_iterator = JSONConstIterator |
Public Member Functions | |
SIV3D_NODISCARD_CXX20 | JSON () |
SIV3D_NODISCARD_CXX20 | JSON (std::shared_ptr< detail::JSONDetail > &&detail) |
SIV3D_NODISCARD_CXX20 | JSON (std::nullptr_t) |
SIV3D_NODISCARD_CXX20 | JSON (const JSON &)=default |
SIV3D_NODISCARD_CXX20 | JSON (JSON &&)=default |
SIV3D_NODISCARD_CXX20 | JSON (const std::initializer_list< std::pair< String, JSON >> &list) |
SIV3D_NODISCARD_CXX20 | JSON (const Array< JSON > &array) |
template<class Type , std::enable_if_t<!std::is_same_v< std::decay_t< Type >, JSON > &&std::is_constructible_v< JSON, Type >> * = nullptr> | |
SIV3D_NODISCARD_CXX20 | JSON (const Array< Type > &arr) |
template<class Type , std::enable_if_t< std::is_constructible_v< JSON, Type >> * = nullptr> | |
SIV3D_NODISCARD_CXX20 | JSON (const std::initializer_list< Type > &list) |
SIV3D_NODISCARD_CXX20 | JSON (StringView value) |
template<class StringViewish , std::enable_if_t< std::is_constructible_v< StringView, StringViewish >> * = nullptr> | |
SIV3D_NODISCARD_CXX20 | JSON (const StringViewish &value) |
SIV3D_NODISCARD_CXX20 | JSON (int64 value) |
SIV3D_NODISCARD_CXX20 | JSON (uint64 value) |
SIV3D_NODISCARD_CXX20 | JSON (double value) |
SIV3D_NODISCARD_CXX20 | JSON (bool value) |
SIV3D_CONCEPT_SIGNED_INTEGRAL SIV3D_NODISCARD_CXX20 | JSON (SignedInt value) |
SIV3D_CONCEPT_UNSIGNED_INTEGRAL SIV3D_NODISCARD_CXX20 | JSON (UnsignedInt value) |
SIV3D_CONCEPT_FLOATING_POINT SIV3D_NODISCARD_CXX20 | JSON (Float value) |
template<class Type , std::enable_if_t<!std::is_constructible_v< StringView, Type > &&!std::is_arithmetic_v< Type >> * = nullptr> | |
SIV3D_NODISCARD_CXX20 | JSON (const Type &value) |
JSON & | operator= (std::nullptr_t) |
JSON & | operator= (const JSON &value) |
JSON & | operator= (const std::initializer_list< std::pair< String, JSON >> &list) |
JSON & | operator= (const Array< JSON > &array) |
template<class Type , std::enable_if_t<!std::is_same_v< std::decay_t< Type >, JSON > &&std::is_constructible_v< JSON, Type >> * = nullptr> | |
JSON & | operator= (const Array< Type > &arr) |
template<class Type , std::enable_if_t< std::is_constructible_v< JSON, Type >> * = nullptr> | |
JSON & | operator= (const std::initializer_list< Type > &list) |
JSON & | operator= (StringView value) |
template<class StringViewish , std::enable_if_t< std::is_constructible_v< StringView, StringViewish >> * = nullptr> | |
JSON & | operator= (const StringViewish &value) |
JSON & | operator= (int64 value) |
JSON & | operator= (uint64 value) |
JSON & | operator= (double value) |
JSON & | operator= (bool value) |
SIV3D_CONCEPT_SIGNED_INTEGRAL JSON & | operator= (SignedInt value) |
SIV3D_CONCEPT_UNSIGNED_INTEGRAL JSON & | operator= (UnsignedInt value) |
SIV3D_CONCEPT_FLOATING_POINT JSON & | operator= (Float value) |
template<class Type , std::enable_if_t<!std::is_constructible_v< StringView, Type > &&!std::is_arithmetic_v< Type >> * = nullptr, class = decltype(Formatter(std::declval<FormatData&>(), std::declval<Type>()))> | |
JSON & | operator= (const Type &value) |
bool | operator== (const JSON &other) const |
bool | operator!= (const JSON &other) const |
bool | isEmpty () const |
operator bool () const | |
bool | isNull () const |
bool | isBool () const |
bool | isNumber () const |
bool | isInteger () const |
bool | isUnsigned () const |
bool | isFloat () const |
bool | isString () const |
bool | isArray () const |
bool | isObject () const |
JSONValueType | getType () const |
bool | hasElement (StringView name) const |
String | getString () const |
template<class Type > | |
Type | get () const |
template<class Type , class U > | |
Type | getOr (U &&defaultValue) const |
template<class Type > | |
Optional< Type > | getOpt () const |
JSON | operator[] (StringView name) |
const JSON | operator[] (StringView name) const |
JSON | operator[] (size_t index) |
const JSON | operator[] (size_t index) const |
JSON | access (StringView jsonPointer) |
const JSON | access (StringView jsonPointer) const |
void | push_back (const JSON &value) |
void | clear () const |
void | erase (StringView name) |
void | erase (size_t index) |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
JSONArrayView | arrayView () const |
size_t | size () const |
String | format (char32 space=U' ', size_t spaceCount=2) const |
JSON データを文字列にフォーマットした結果を返します。 More... | |
String | formatMinimum () const |
std::string | formatUTF8 (char32 space=U' ', size_t spaceCount=2) const |
std::string | formatUTF8Minimum () const |
bool | save (FilePathView path) const |
JSON データをファイルに保存します。 More... | |
bool | saveMinimum (FilePathView path) const |
JSON データを、不要なスペースを消したコンパクトな形式でファイルに保存します。 More... | |
Blob | toBSON () const |
BSON 形式にシリアライズした結果を返します。 More... | |
Blob | toCBOR () const |
CBOR 形式にシリアライズした結果を返します。 More... | |
Blob | toMessagePack () const |
MessagePack 形式にシリアライズした結果を返します。 More... | |
Static Public Member Functions | |
static JSON | Invalid () |
static JSON | Load (FilePathView path, AllowExceptions allowExceptions=AllowExceptions::No) |
JSON ファイルをパースして JSON オブジェクトを返します。 More... | |
template<class Reader , std::enable_if_t< std::is_base_of_v< IReader, Reader >> * = nullptr> | |
static JSON | Load (Reader &&reader, AllowExceptions allowExceptions=AllowExceptions::No) |
static JSON | Load (std::unique_ptr< IReader > &&reader, AllowExceptions allowExceptions=AllowExceptions::No) |
static JSON | Parse (StringView str, AllowExceptions allowExceptions=AllowExceptions::No) |
JSON 文字列をパースして JSON オブジェクトを返します。 More... | |
static JSON | FromBSON (const Blob &bson, AllowExceptions allowExceptions=AllowExceptions::No) |
BSON 形式のデータから JSON オブジェクトをデシリアライズします。 More... | |
static JSON | FromCBOR (const Blob &cbor, AllowExceptions allowExceptions=AllowExceptions::No) |
CBOR 形式のデータから JSON オブジェクトをデシリアライズします。 More... | |
static JSON | FromMessagePack (const Blob &msgpack, AllowExceptions allowExceptions=AllowExceptions::No) |
MessagePack 形式のデータから JSON オブジェクトをデシリアライズします。 More... | |
Friends | |
void | Formatter (FormatData &formatData, const JSON &value) |
JSON 形式のデータの読み書き
using s3d::JSON::iterator = JSONIterator |
SIV3D_NODISCARD_CXX20 s3d::JSON::JSON | ( | ) |
SIV3D_NODISCARD_CXX20 s3d::JSON::JSON | ( | std::shared_ptr< detail::JSONDetail > && | detail | ) |
SIV3D_NODISCARD_CXX20 s3d::JSON::JSON | ( | std::nullptr_t | ) |
|
default |
|
default |
SIV3D_NODISCARD_CXX20 s3d::JSON::JSON | ( | const std::initializer_list< std::pair< String, JSON >> & | list | ) |
SIV3D_NODISCARD_CXX20 s3d::JSON::JSON | ( | const Array< Type > & | arr | ) |
SIV3D_NODISCARD_CXX20 s3d::JSON::JSON | ( | const std::initializer_list< Type > & | list | ) |
SIV3D_NODISCARD_CXX20 s3d::JSON::JSON | ( | StringView | value | ) |
SIV3D_NODISCARD_CXX20 s3d::JSON::JSON | ( | const StringViewish & | value | ) |
SIV3D_NODISCARD_CXX20 s3d::JSON::JSON | ( | int64 | value | ) |
SIV3D_NODISCARD_CXX20 s3d::JSON::JSON | ( | uint64 | value | ) |
SIV3D_NODISCARD_CXX20 s3d::JSON::JSON | ( | double | value | ) |
SIV3D_NODISCARD_CXX20 s3d::JSON::JSON | ( | bool | value | ) |
SIV3D_CONCEPT_SIGNED_INTEGRAL SIV3D_NODISCARD_CXX20 s3d::JSON::JSON | ( | SignedInt | value | ) |
SIV3D_CONCEPT_UNSIGNED_INTEGRAL SIV3D_NODISCARD_CXX20 s3d::JSON::JSON | ( | UnsignedInt | value | ) |
SIV3D_CONCEPT_FLOATING_POINT SIV3D_NODISCARD_CXX20 s3d::JSON::JSON | ( | Float | value | ) |
SIV3D_NODISCARD_CXX20 s3d::JSON::JSON | ( | const Type & | value | ) |
JSON s3d::JSON::access | ( | StringView | jsonPointer | ) |
const JSON s3d::JSON::access | ( | StringView | jsonPointer | ) | const |
JSONArrayView s3d::JSON::arrayView | ( | ) | const |
iterator s3d::JSON::begin | ( | ) |
const_iterator s3d::JSON::begin | ( | ) | const |
void s3d::JSON::clear | ( | ) | const |
iterator s3d::JSON::end | ( | ) |
const_iterator s3d::JSON::end | ( | ) | const |
void s3d::JSON::erase | ( | size_t | index | ) |
void s3d::JSON::erase | ( | StringView | name | ) |
String s3d::JSON::formatMinimum | ( | ) | const |
std::string s3d::JSON::formatUTF8 | ( | char32 | space = U' ' , |
size_t | spaceCount = 2 |
||
) | const |
std::string s3d::JSON::formatUTF8Minimum | ( | ) | const |
|
static |
|
static |
|
static |
Type s3d::JSON::get | ( | ) | const |
Optional<Type> s3d::JSON::getOpt | ( | ) | const |
Type s3d::JSON::getOr | ( | U && | defaultValue | ) | const |
String s3d::JSON::getString | ( | ) | const |
JSONValueType s3d::JSON::getType | ( | ) | const |
bool s3d::JSON::hasElement | ( | StringView | name | ) | const |
|
static |
bool s3d::JSON::isArray | ( | ) | const |
bool s3d::JSON::isBool | ( | ) | const |
bool s3d::JSON::isEmpty | ( | ) | const |
bool s3d::JSON::isFloat | ( | ) | const |
bool s3d::JSON::isInteger | ( | ) | const |
bool s3d::JSON::isNull | ( | ) | const |
bool s3d::JSON::isNumber | ( | ) | const |
bool s3d::JSON::isObject | ( | ) | const |
bool s3d::JSON::isString | ( | ) | const |
bool s3d::JSON::isUnsigned | ( | ) | const |
|
static |
|
static |
|
static |
|
explicit |
bool s3d::JSON::operator!= | ( | const JSON & | other | ) | const |
JSON& s3d::JSON::operator= | ( | bool | value | ) |
JSON& s3d::JSON::operator= | ( | const Array< Type > & | arr | ) |
JSON& s3d::JSON::operator= | ( | const std::initializer_list< Type > & | list | ) |
JSON& s3d::JSON::operator= | ( | const StringViewish & | value | ) |
JSON& s3d::JSON::operator= | ( | const Type & | value | ) |
JSON& s3d::JSON::operator= | ( | double | value | ) |
SIV3D_CONCEPT_FLOATING_POINT JSON& s3d::JSON::operator= | ( | Float | value | ) |
SIV3D_CONCEPT_SIGNED_INTEGRAL JSON& s3d::JSON::operator= | ( | SignedInt | value | ) |
JSON& s3d::JSON::operator= | ( | std::nullptr_t | ) |
JSON& s3d::JSON::operator= | ( | StringView | value | ) |
SIV3D_CONCEPT_UNSIGNED_INTEGRAL JSON& s3d::JSON::operator= | ( | UnsignedInt | value | ) |
bool s3d::JSON::operator== | ( | const JSON & | other | ) | const |
JSON s3d::JSON::operator[] | ( | size_t | index | ) |
const JSON s3d::JSON::operator[] | ( | size_t | index | ) | const |
JSON s3d::JSON::operator[] | ( | StringView | name | ) |
const JSON s3d::JSON::operator[] | ( | StringView | name | ) | const |
|
static |
void s3d::JSON::push_back | ( | const JSON & | value | ) |
bool s3d::JSON::save | ( | FilePathView | path | ) | const |
bool s3d::JSON::saveMinimum | ( | FilePathView | path | ) | const |
JSON データを、不要なスペースを消したコンパクトな形式でファイルに保存します。
path | ファイルパス |
size_t s3d::JSON::size | ( | ) | const |
Blob s3d::JSON::toBSON | ( | ) | const |
BSON 形式にシリアライズした結果を返します。
Blob s3d::JSON::toCBOR | ( | ) | const |
CBOR 形式にシリアライズした結果を返します。
Blob s3d::JSON::toMessagePack | ( | ) | const |
MessagePack 形式にシリアライズした結果を返します。
|
friend |