|
|
bool | operator== (const Value &c1, const Value &c2) |
| |
|
bool | operator!= (const Value &c1, const Value &c2) |
| |
◆ Type
| Enumerator |
|---|
| Unrecognized | The value's type is unrecognized.
|
| Null | The value is null.
|
| Bool | The value is a boolean.
|
| Number | The value is a number. JSON does not have separate types for integers and floats.
|
| String | The value is a string.
|
| Array | The value is an array.
|
| Object | The value is an object.
|
◆ Value() [1/10]
| launchdarkly::Value::Value |
( |
struct LDValue * |
ptr | ) |
|
|
inlineexplicit |
Constructs a Value from a raw pointer. Ownership is transferred to the Value.
- Parameters
-
◆ Value() [2/10]
| launchdarkly::Value::Value |
( |
| ) |
|
|
inlineexplicit |
Constructs a null-type Value. Represents the JSON "null".
◆ Value() [3/10]
| launchdarkly::Value::Value |
( |
bool |
b | ) |
|
|
inlineexplicit |
Constructs a Value from a boolean.
- Parameters
-
◆ Value() [4/10]
| launchdarkly::Value::Value |
( |
double |
b | ) |
|
|
inlineexplicit |
Constructs a Value from a double.
- Parameters
-
◆ Value() [5/10]
| launchdarkly::Value::Value |
( |
const char * |
b | ) |
|
|
inlineexplicit |
Constructs a Value from a string literal.
- Parameters
-
| b | String literal. The pointer must remain valid for the duration of the program. |
◆ Value() [6/10]
| launchdarkly::Value::Value |
( |
const std::string & |
b | ) |
|
|
inlineexplicit |
Constructs a Value from an std::string.
- Parameters
-
| b | String object. The string is cloned. |
◆ Value() [7/10]
| launchdarkly::Value::Value |
( |
const Array & |
array | ) |
|
|
inline |
Implicit construction of a Value from an Array builder.
- Parameters
-
◆ Value() [8/10]
| launchdarkly::Value::Value |
( |
const Object & |
obj | ) |
|
|
inline |
Implicit construction of a Value from an Object builder.
- Parameters
-
◆ Value() [9/10]
| launchdarkly::Value::Value |
( |
const Value & |
other | ) |
|
|
inline |
◆ Value() [10/10]
| launchdarkly::Value::Value |
( |
Value && |
other | ) |
|
|
inlinenoexcept |
Move constructs a Value from another Value.
- Parameters
-
| other | The Value to consume. |
◆ ~Value()
| launchdarkly::Value::~Value |
( |
| ) |
|
|
inline |
Destroys the Value and any child Values.
◆ count()
| size_t launchdarkly::Value::count |
( |
| ) |
const |
|
inline |
Count how many elements are in an array-type or object-type Value.
- Returns
- Element count, or 0 if not array or object-type.
◆ get_bool()
| bool launchdarkly::Value::get_bool |
( |
| ) |
const |
|
inline |
Retrieve the boolean value.
- Returns
- Boolean value, or false if not a bool.
◆ get_number()
| double launchdarkly::Value::get_number |
( |
| ) |
const |
|
inline |
Retrieve the number value.
- Returns
- Number value, or 0.0 if not a number.
◆ get_string()
| std::string launchdarkly::Value::get_string |
( |
| ) |
const |
|
inline |
Retrieve the string value.
- Returns
- String value, or empty string if not a string.
◆ into_unordered_map()
| std::unordered_map<std::string, Value> launchdarkly::Value::into_unordered_map |
( |
| ) |
const |
|
inline |
Construct an unordered map of key/Values from an object-type Value. The new keys/values are cloned from the Value, which may be an expensive operation.
- Returns
- Map of key/values if object-type, otherwise empty unordered map.
◆ into_vector()
| std::vector<Value> launchdarkly::Value::into_vector |
( |
| ) |
const |
|
inline |
Construct a vector of individual Values from an array-type (or object-type) Value. The new values are cloned from the Value, which may be an expensive operation.
- Returns
- Vector of Values if array-type/object-type, or an empty vector.
◆ is_null()
| bool launchdarkly::Value::is_null |
( |
| ) |
const |
|
inline |
Check if Value represents null.
- Returns
- True if null-type.
◆ operator=() [1/2]
| Value& launchdarkly::Value::operator= |
( |
const Value & |
other | ) |
|
|
inline |
Copy assigns this Value from another Value.
- Parameters
-
◆ operator=() [2/2]
| Value& launchdarkly::Value::operator= |
( |
Value && |
other | ) |
|
|
inlinenoexcept |
Move assigns this Value from another Value.
- Parameters
-
| other | The Value to move from. |
◆ parse_json()
| static Value launchdarkly::Value::parse_json |
( |
const char * |
json | ) |
|
|
inlinestatic |
Constructs a Value from a JSON string.
- Parameters
-
- Returns
- Constructed Value. The Value may be of type null if the JSON couldn't be parsed.
◆ release()
| struct LDValue* launchdarkly::Value::release |
( |
| ) |
|
|
inline |
Releases the managed LDValue pointer. Only necessary when interfacing with C code where ownership must be transferred.
- Returns
- Previously managed pointer. The caller is now responsible for managing its lifetime.
◆ serialize_formatted_json()
| std::string launchdarkly::Value::serialize_formatted_json |
( |
| ) |
|
|
inline |
Serializes the Value to formatted JSON string.
- Returns
- JSON string.
◆ serialize_json()
| std::string launchdarkly::Value::serialize_json |
( |
| ) |
|
|
inline |
Serializes the Value to a compact JSON string.
- Returns
- JSON string.
◆ type()
| Type launchdarkly::Value::type |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following file:
- c-sdk-common/include/launchdarkly/experimental/cpp/value.hpp