Constructors

Synopses

Declared in <bdljsn_jsonnumber.h>

Create a JsonNumber having the value "0". Optionally specify an allocator (e.g., the address of a bslma::Allocator object) used to supply memory.

Create a JsonNumber by moving from the specified original object.

Create a JsonNumber having the same value and allocator as text.

Create a JsonNumber having the value "0" that uses the specified allocator to supply memory.

explicit
JsonNumber(allocator_type const& allocator);

Same as the related overload above for JsonNumber.

explicit
JsonNumber(
    bdldfp::Decimal64 value,
    allocator_type const& allocator = allocator_type());

Same as the related overload above for JsonNumber.

explicit
JsonNumber(
    double value,
    allocator_type const& allocator = allocator_type());

Create a JsonNumber having the specified value.

explicit
JsonNumber(
    float value,
    allocator_type const& allocator = allocator_type());

Create a JsonNumber having the specified value.

explicit
JsonNumber(
    int value,
    allocator_type const& allocator = allocator_type());

Same as the related overload above for JsonNumber.

explicit
JsonNumber(
    long value,
    allocator_type const& allocator = allocator_type());

Same as the related overload above for JsonNumber.

explicit
JsonNumber(
    long long value,
    allocator_type const& allocator = allocator_type());

Same as the related overload above for JsonNumber.

explicit
JsonNumber(
    unsigned int value,
    allocator_type const& allocator = allocator_type());

Create a JsonNumber from the specified unsigned long value.

explicit
JsonNumber(
    unsigned long value,
    allocator_type const& allocator = allocator_type());

Create a JsonNumber having the specified value.

explicit
JsonNumber(
    unsigned long long value,
    allocator_type const& allocator = allocator_type());

Create a JsonNumber by moving from original using allocator.

Create a JsonNumber having the same value as the specified text.

explicit
JsonNumber(
    bslmf::MovableRef<bsl::string> text,
    allocator_type const& allocator);

Create a JsonNumber having the same value as the specified original.

JsonNumber(
    JsonNumber const& original,
    allocator_type const& allocator = allocator_type());

Same as the related overload above for JsonNumber.

explicit
JsonNumber(
    std::string_view const& text,
    allocator_type const& allocator = allocator_type());

Create a JsonNumber having the value of the specified text.

explicit
JsonNumber(
    char const* text,
    allocator_type const& allocator = allocator_type());

Parameters

Name

Description

original

object to move from

text

JSON number text to move from

allocator

allocator used to supply memory

value

numeric value to store

Created with MrDocs