[#BloombergLP-bdljsn-Json-2constructor-0b3] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdljsn.adoc[bdljsn]::xref:BloombergLP/bdljsn/Json.adoc[Json]::Json :relfileprefix: ../../../ :mrdocs: Constructors == Synopses Declared in `<bdljsn_json.h>` Create a `Json` object having the type (and the singleton value) of `JsonNull`. Optionally specify the `basicAllocator` used to supply memory. If `basicAllocator` is not specified, the currently installed default allocator is used to supply memory. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdljsn/Json/2constructor-0765.adoc[Json](); ---- [.small]#xref:BloombergLP/bdljsn/Json/2constructor-0765.adoc[_» more..._]# Create a `Json` object having the same value as the specified `original` object by moving (in constant time) the contents of `original` to the new `JsonObject`. The allocator associated with `original` is propagated for use in the newly‐created `Json` object. `original` is left in a valid but unspecified state. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdljsn/Json/2constructor-095.adoc[Json](xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef<Json>] original); ---- [.small]#xref:BloombergLP/bdljsn/Json/2constructor-095.adoc[_» more..._]# Same as the related overload above for `Json`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bdljsn/Json/2constructor-0bf4.adoc[Json](xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator); ---- [.small]#xref:BloombergLP/bdljsn/Json/2constructor-0bf4.adoc[_» more..._]# Same as the related overload above for `Json`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bdljsn/Json/2constructor-061.adoc[Json]( xref:BloombergLP/bdldfp/Decimal64.adoc[bdldfp::Decimal64] value, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdljsn/Json/2constructor-061.adoc[_» more..._]# Create a `Json` object having the type `bool` and the same value as the specified `boolean`. Optionally specify the `basicAllocator` used to supply memory. If `basicAllocator` is not specified, the currently installed default allocator is used to supply memory. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bdljsn/Json/2constructor-08b.adoc[Json]( bool boolean, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdljsn/Json/2constructor-08b.adoc[_» more..._]# Same as the related overload above for `Json`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bdljsn/Json/2constructor-06fc.adoc[Json]( double value, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdljsn/Json/2constructor-06fc.adoc[_» more..._]# Create a `Json` object having the type `JsonNumber` and the specified `value`. Optionally specify the `basicAllocator` used to supply memory. If `basicAllocator` is not specified, the currently installed default allocator is used to supply memory. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bdljsn/Json/2constructor-0d.adoc[Json]( float value, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdljsn/Json/2constructor-0d.adoc[_» more..._]# Create a `Json` object having the type `JsonNumber` and the the specified `value`. Optionally specify the `basicAllocator` used to supply memory. If `basicAllocator` is not specified, the currently installed default allocator is used to supply memory. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bdljsn/Json/2constructor-00.adoc[Json]( int value, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdljsn/Json/2constructor-00.adoc[_» more..._]# Same as the related overload above for `Json`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bdljsn/Json/2constructor-0764.adoc[Json]( long value, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdljsn/Json/2constructor-0764.adoc[_» more..._]# Same as the related overload above for `Json`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bdljsn/Json/2constructor-03.adoc[Json]( long long value, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdljsn/Json/2constructor-03.adoc[_» more..._]# Create a `Json` object having the type `JsonNumber` and the specified `value`. Optionally specify the `basicAllocator` used to supply memory. If `basicAllocator` is not specified, the currently installed default allocator is used to supply memory. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bdljsn/Json/2constructor-0cc.adoc[Json]( unsigned int value, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdljsn/Json/2constructor-0cc.adoc[_» more..._]# Same as the related overload above for `Json`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bdljsn/Json/2constructor-0bec.adoc[Json]( unsigned long value, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdljsn/Json/2constructor-0bec.adoc[_» more..._]# Same as the related overload above for `Json`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bdljsn/Json/2constructor-0c8.adoc[Json]( unsigned long long value, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdljsn/Json/2constructor-0c8.adoc[_» more..._]# Create a `Json` object having the same value as the specified `original`. Use the specified `basicAllocator` to supply memory. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdljsn/Json/2constructor-0b5d.adoc[Json]( xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef<Json>] original, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator); ---- [.small]#xref:BloombergLP/bdljsn/Json/2constructor-0b5d.adoc[_» more..._]# Create a `Json` object having the type `JsonArray`/`JsonObject`/ `JsonNumber` and the value of the specified `array`/`object`/ `number` object by moving the contents of `array`/`object`/`number` to the new object. Optionally specify `basicAllocator` used to supply memory. If `basicAllocator` is not specified, the allocator associated with `array`/`object`/`number` is propagated for use in the newly‐created `Json` object. The allocator or `array`/`object`/ `number` is unchanged and is otherwise left in (valid) unspecified state. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdljsn/Json/2constructor-06f9.adoc[Json]( xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef<JsonArray>] array, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdljsn/Json/2constructor-06f9.adoc[_» more..._]# Create a `Json` object having the type `JsonNumber` and the value of the specified `number` object by moving the contents of `number` to the new object. Optionally specify `basicAllocator` used to supply memory. If `basicAllocator` is not specified, the allocator associated with `number` is propagated for use in the newly‐created `Json` object. The allocator of `number` is unchanged and is otherwise left in (valid) unspecified state. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bdljsn/Json/2constructor-04.adoc[Json]( xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef<JsonNumber>] number, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdljsn/Json/2constructor-04.adoc[_» more..._]# Same as the related overload above for `Json`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdljsn/Json/2constructor-01.adoc[Json]( xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef<JsonObject>] object, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdljsn/Json/2constructor-01.adoc[_» more..._]# Create a `Json` object having the same value as the specified `original`. Optionally specify the `basicAllocator` used to supply memory. If `basicAllocator` is not specified, the currently installed default allocator is used to supply memory. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdljsn/Json/2constructor-062.adoc[Json]( xref:BloombergLP/bdljsn/Json.adoc[Json] const& original, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdljsn/Json/2constructor-062.adoc[_» more..._]# Create a `Json` object having the type `JsonArray`/`JsonObject`/ `JsonNumber` and the value of the specified `array`/`object`/`number`. Optionally specify `basicAllocator` used to supply memory. If `basicAllocator` is not specified, the currently installed default allocator is used to supply memory. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdljsn/Json/2constructor-066.adoc[Json]( xref:BloombergLP/bdljsn/JsonArray.adoc[JsonArray] const& array, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdljsn/Json/2constructor-066.adoc[_» more..._]# Create a `Json` object having the type `JsonNull` and the same value as the specified `null`. Optionally specify the `basicAllocator` used to supply memory. If `basicAllocator` is not specified, the currently installed default allocator is used to supply memory. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bdljsn/Json/2constructor-0b0.adoc[Json]( xref:BloombergLP/bdljsn/JsonNull-0b.adoc[JsonNull] const& null, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdljsn/Json/2constructor-0b0.adoc[_» more..._]# Create a `Json` object having the type `JsonNumber` and the value of the specified `number`. Optionally specify `basicAllocator` used to supply memory. If `basicAllocator` is not specified, the currently installed default allocator is used to supply memory. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bdljsn/Json/2constructor-0bfa.adoc[Json]( xref:BloombergLP/bdljsn/JsonNumber.adoc[JsonNumber] const& number, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdljsn/Json/2constructor-0bfa.adoc[_» more..._]# Same as the related overload above for `Json`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdljsn/Json/2constructor-0b50.adoc[Json]( xref:BloombergLP/bdljsn/JsonObject.adoc[JsonObject] const& object, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdljsn/Json/2constructor-0b50.adoc[_» more..._]# Same as the related overload above for `Json`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bdljsn/Json/2constructor-09a.adoc[Json]( std::string_view const& string, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdljsn/Json/2constructor-09a.adoc[_» more..._]# Create a `Json` object having the type `bsl::string` and the same value as the specified `string`. Optionally specify the `basicAllocator` used to supply memory. If `basicAllocator` is not specified, the currently installed default allocator is used to supply memory. The behavior is undefined unless `string` is valid UTF‐8 (see `bdlde::Utf8Util::isValid`). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bdljsn/Json/2constructor-0be9.adoc[Json]( char const* string, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdljsn/Json/2constructor-0be9.adoc[_» more..._]# Create a `Json` object having the type `bsl::string` and the same value as the specified `string` by moving (in constant time) the contents of `string` to the new `Json` object. Optionally specify the `basicAllocator` used to supply memory. If `basicAllocator` is not specified, the allocator associated with `string` is propagated for use in the newly‐created `Json` object. `string` is left in a valid but unspecified state. This function does not participate in overload resolution unless the specified `t_STRING_TYPE` is `bsl::string`. The behavior is undefined unless `string` is valid UTF‐8 (see `bdlde::Utf8Util::isValid`). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_STRING_TYPE> xref:BloombergLP/bdljsn/Json/2constructor-086.adoc[Json]( xref:BloombergLP/bslmf/MovableRef_Deduced.adoc[BloombergLP::bslmf::MovableRef_Deduced<t_STRING_TYPE>] string, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0, void* = 0) requires bsl::is_same<t_STRING_TYPE, bsl::string>::value; ---- [.small]#xref:BloombergLP/bdljsn/Json/2constructor-086.adoc[_» more..._]# Create a `Json` object having the same structure as the specified `initializer`. Optionally specify the `basicAllocator` used to supply memory. If `basicAllocator` is not specified, the currently installed default allocator is used to supply memory. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_JSON_INITIALIZER> xref:BloombergLP/bdljsn/Json/2constructor-09f.adoc[Json]( t_JSON_INITIALIZER const& initializer, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0, void* = 0) requires bsl::is_same<t_JSON_INITIALIZER, Json_Initializer>::value; ---- [.small]#xref:BloombergLP/bdljsn/Json/2constructor-09f.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#