Constructors

Synopses

Declared in <bdljsn_json.h>

Create a Json object holding the JsonNull singleton.

Json();

Create a Json object by moving from the specified original.

Create a Json object holding JsonNull using basicAllocator.

explicit
Json(bslma::Allocator* basicAllocator);

Same as the related overload above for Json.

explicit
Json(
    bdldfp::Decimal64 value,
    bslma::Allocator* basicAllocator = 0);

Create a Json object holding the specified boolean value.

explicit
Json(
    bool boolean,
    bslma::Allocator* basicAllocator = 0);

Same as the related overload above for Json.

explicit
Json(
    double value,
    bslma::Allocator* basicAllocator = 0);

Create a Json object holding the specified numeric value.

explicit
Json(
    float value,
    bslma::Allocator* basicAllocator = 0);

Create a Json object holding the specified numeric value.

explicit
Json(
    int value,
    bslma::Allocator* basicAllocator = 0);

Same as the related overload above for Json.

explicit
Json(
    long value,
    bslma::Allocator* basicAllocator = 0);

Same as the related overload above for Json.

explicit
Json(
    long long value,
    bslma::Allocator* basicAllocator = 0);

Create a Json object holding the specified numeric value.

explicit
Json(
    unsigned int value,
    bslma::Allocator* basicAllocator = 0);

Same as the related overload above for Json.

explicit
Json(
    unsigned long value,
    bslma::Allocator* basicAllocator = 0);

Same as the related overload above for Json.

explicit
Json(
    unsigned long long value,
    bslma::Allocator* basicAllocator = 0);

Create a Json object having the same value as the specified original. Use the specified basicAllocator to supply memory.

Json(
    bslmf::MovableRef<Json> original,
    bslma::Allocator* basicAllocator);

Create a Json object by moving from the specified array.

Json(
    bslmf::MovableRef<JsonArray> array,
    bslma::Allocator* basicAllocator = 0);

Create a Json object by moving from the specified number.

explicit
Json(
    bslmf::MovableRef<JsonNumber> number,
    bslma::Allocator* basicAllocator = 0);

Same as the related overload above for Json.

Json(
    bslmf::MovableRef<JsonObject> object,
    bslma::Allocator* basicAllocator = 0);

Create a Json object having the same value as original.

Json(
    Json const& original,
    bslma::Allocator* basicAllocator = 0);

Create a Json object holding the specified array.

Json(
    JsonArray const& array,
    bslma::Allocator* basicAllocator = 0);

Create a Json object holding the JsonNull value.

explicit
Json(
    JsonNull const& null,
    bslma::Allocator* basicAllocator = 0);

Create a Json object holding the specified number.

explicit
Json(
    JsonNumber const& number,
    bslma::Allocator* basicAllocator = 0);

Same as the related overload above for Json.

Json(
    JsonObject const& object,
    bslma::Allocator* basicAllocator = 0);

Same as the related overload above for Json.

explicit
Json(
    std::string_view const& string,
    bslma::Allocator* basicAllocator = 0);

Create a Json object holding the specified string.

explicit
Json(
    char const* string,
    bslma::Allocator* basicAllocator = 0);

Create a Json object by moving from the specified string.

template<class t_STRING_TYPE>
Json(
    BloombergLP::bslmf::MovableRef_Deduced<t_STRING_TYPE> string,
    bslma::Allocator* basicAllocator = 0)
requires bsl::is_same<t_STRING_TYPE,
                                bsl::string>::value;

Create a Json object from the specified initializer.

template<class t_JSON_INITIALIZER>
Json(
    t_JSON_INITIALIZER const& initializer,
    bslma::Allocator* basicAllocator = 0)
requires bsl::is_same<t_JSON_INITIALIZER,
                        Json_Initializer>::value;

Parameters

Name

Description

original

source value

basicAllocator

memory allocator; null uses the default

value

numeric value to store

boolean

boolean value to store

array

array value to store

number

number value to store

object

object value to store

null

null value to store

string

UTF‐8 string value to store

initializer

list‐initialization value

Created with MrDocs