Member function documentation
- int nz::udx_ver2::Jsonb::arrayLength ( ) const
- Number of elements in this JSON array (if it is a JSON array).
- Jsonb nz::udx_ver2::Jsonb::clone ( ) const
- Makes a (deep) copy of this object.
- static int nz::udx_ver2::Jsonb::cmp ( const Jsonb & lhs, const Jsonb & rhs ) static
- Compares two JSON documents.
- static Jsonb nz::udx_ver2::Jsonb::concat ( const Jsonb & a, const Jsonb & b ) static
- Concatenates two JSON documents.
- static Jsonb nz::udx_ver2::Jsonb::concat ( const char * a, const Jsonb & b ) static
- Concatenates two JSON documents.
- static Jsonb nz::udx_ver2::Jsonb::concat ( const Jsonb & a, const char * b ) static
- Concatenates two JSON documents.
- static Jsonb nz::udx_ver2::Jsonb::concat ( const char * a, const char * b ) static
- Concatenates two JSON documents.
- bool nz::udx_ver2::Jsonb::contained ( const Jsonb & other ) const
- Checks if this JSON document is a subset of another JSON document.
- bool nz::udx_ver2::Jsonb::contained ( const char * other ) const
- Checks if this JSON document is a subset of another JSON document.
- bool nz::udx_ver2::Jsonb::contains ( const Jsonb & other ) const
- Checks if this JSON document is a superset of another JSON document.
- bool nz::udx_ver2::Jsonb::contains ( const char * other ) const
- Checks if this JSON document is a superset of another JSON document.
- bool nz::udx_ver2::Jsonb::exists ( const char * key ) const
- Checks if a key exists in this JSON document.
- NullableBool nz::udx_ver2::Jsonb::exists ( const JsonPath & path ) const
- Checks if JsonPath query returns any item.
- NullableBool nz::udx_ver2::Jsonb::exists ( const JsonPath & path, bool silent ) const
- Checks if JsonPath query returns any item.
- NullableBool nz::udx_ver2::Jsonb::exists ( const JsonPath & path, const Jsonb & vars ) const
- Checks if JsonPath query returns any item.
- NullableBool nz::udx_ver2::Jsonb::exists ( const JsonPath & path, const Jsonb & vars, bool silent ) const
- Checks if JsonPath query returns any item.
- bool nz::udx_ver2::Jsonb::existsAll ( const Jsonb & keys ) const
- Checks if all provided keys exist in this JSON document.
- bool nz::udx_ver2::Jsonb::existsAll ( const Jsonb & keys, bool silent ) const
- Checks if all provided keys exist in this JSON document.
- bool nz::udx_ver2::Jsonb::existsAll ( const char * keys ) const
- Checks if all provided keys exist in this JSON document.
- bool nz::udx_ver2::Jsonb::existsAll ( const char * keys, bool silent ) const
- Checks if all provided keys exist in this JSON document.
- bool nz::udx_ver2::Jsonb::existsAny ( const Jsonb & keys ) const
- Checks if any of the provided keys exists in this JSON document.
- bool nz::udx_ver2::Jsonb::existsAny ( const Jsonb & keys, bool silent ) const
- Checks if any of the provided keys exists in this JSON document.
- bool nz::udx_ver2::Jsonb::existsAny ( const char * keys ) const
- Checks if any of the provided keys exists in this JSON document.
- bool nz::udx_ver2::Jsonb::existsAny ( const char * keys, bool silent ) const
- Checks if any of the provided keys exists in this JSON document.
- int nz::udx_ver2::Jsonb::fill ( char * ptr ) const
- Fills ptr with the data of this object.
- Jsonb nz::udx_ver2::Jsonb::get ( const char * key ) const
- Gets JSON value by key.
- Jsonb nz::udx_ver2::Jsonb::get ( int index ) const
- Gets JSON element by index.
- Jsonb nz::udx_ver2::Jsonb::get ( const Jsonb & path ) const
- Gets JSON element by path.
- Jsonb& nz::udx_ver2::Jsonb::insert ( const Jsonb & path, const Jsonb & value )
- Inserts a new value into this JSON document.
- Jsonb& nz::udx_ver2::Jsonb::insert ( const char * path, const Jsonb & value )
- Inserts a new value into this JSON document.
- Jsonb& nz::udx_ver2::Jsonb::insert ( const Jsonb & path, const char * value )
- Inserts a new value into this JSON document.
- Jsonb& nz::udx_ver2::Jsonb::insert ( const char * path, const char * value )
- Inserts a new value into this JSON document.
- Jsonb& nz::udx_ver2::Jsonb::insert ( const Jsonb & path, const Jsonb & value, bool after )
- Inserts a new value into this JSON document.
- Jsonb& nz::udx_ver2::Jsonb::insert ( const char * path, const Jsonb & value, bool after )
- Inserts a new value into this JSON document.
- Jsonb& nz::udx_ver2::Jsonb::insert ( const Jsonb & path, const char * value, bool after )
- Inserts a new value into this JSON document.
- Jsonb& nz::udx_ver2::Jsonb::insert ( const char * path, const char * value, bool after )
- Inserts a new value into this JSON document.
- NullableBool nz::udx_ver2::Jsonb::match ( const JsonPath & path ) const
- Returns the result of JsonPath predicate check.
- NullableBool nz::udx_ver2::Jsonb::match ( const JsonPath & path, bool silent ) const
- Returns the result of JsonPath predicate check.
- NullableBool nz::udx_ver2::Jsonb::match ( const JsonPath & path, const Jsonb & vars ) const
- Returns the result of JsonPath predicate check.
- NullableBool nz::udx_ver2::Jsonb::match ( const JsonPath & path, const Jsonb & vars, bool silent ) const
- Returns the result of JsonPath predicate check.
- bool nz::udx_ver2::Jsonb::operator!= ( const Jsonb & rhs ) const
- Inequality operator.
- bool nz::udx_ver2::Jsonb::operator!= ( const char * rhs ) const
- Inequality operator.
- Jsonb nz::udx_ver2::Jsonb::operator+ ( const Jsonb & rhs ) const
- Concatemates this JSON document with another JSON document.
- Jsonb nz::udx_ver2::Jsonb::operator+ ( const char * rhs ) const
- Concatemates this JSON document with another JSON document.
- Jsonb& nz::udx_ver2::Jsonb::operator+= ( const Jsonb & rhs )
- Concatemates this JSON document with another JSON document and assigns the result back to this.
- Jsonb& nz::udx_ver2::Jsonb::operator+= ( const char * rhs )
- Concatemates this JSON document with another JSON document and assigns the result back to this.
- Jsonb nz::udx_ver2::Jsonb::operator- ( int rhs ) const
- Removes an element from a JSON array using index.
- Jsonb nz::udx_ver2::Jsonb::operator- ( const char * rhs ) const
- Removes a key - value pair from a JSON object using key.
- Jsonb& nz::udx_ver2::Jsonb::operator-= ( int rhs )
- Removes an element from a JSON array using index and assigns the result back to this.
- Jsonb& nz::udx_ver2::Jsonb::operator-= ( const char * rhs )
- Removes a key - value pair from a JSON object using key and assigns the result back to this.
- bool nz::udx_ver2::Jsonb::operator< ( const Jsonb & rhs ) const
- Less than operator.
- bool nz::udx_ver2::Jsonb::operator< ( const char * rhs ) const
- Less than operator.
- bool nz::udx_ver2::Jsonb::operator<= ( const Jsonb & rhs ) const
-
Less than or equal operator.
- Parameters
- rhs Right operand.
- Returns
trueIfthisis less than or equal torhs.
- bool nz::udx_ver2::Jsonb::operator<= ( const char * rhs ) const
- Less than or equal operator.
- Jsonb& nz::udx_ver2::Jsonb::operator= ( const Jsonb & rhs )
-
Assignment operator.
Re-initializes the left operand with a copy of data from the right operand (deep copy).
- Parameters
- rhs Right operand.
- Returns
- Jsonb& Reference to
this.
- bool nz::udx_ver2::Jsonb::operator== ( const Jsonb & rhs ) const
-
Equality operator.
- Parameters
- rhs Right operand.
- Returns
trueIfthisis equal torhs.
- bool nz::udx_ver2::Jsonb::operator== ( const char * rhs ) const
-
Equality operator.
- Parameters
- rhs Right operand as a JSON string.
- Exceptions
- SQLError invalid JSON string for rhs triggers an error.
- Returns
trueIfthisis equal torhs.
- bool nz::udx_ver2::Jsonb::operator> ( const Jsonb & rhs ) const
-
Greater than operator.
- Parameters
- rhs Right operand.
- Returns
trueIfthisis greater thanrhs.
- bool nz::udx_ver2::Jsonb::operator> ( const char * rhs ) const
-
Greater than operator.
- Parameters
- rhs Right operand as a JSON string.
- Exceptions
- SQLError invalid JSON string for rhs triggers an error.
- Returns
trueIfthisis greater thanrhs.
- bool nz::udx_ver2::Jsonb::operator>= ( const Jsonb & rhs ) const
- Greater than or equal operator.
- bool nz::udx_ver2::Jsonb::operator>= ( const char * rhs ) const
-
Greater than or equal operator.
- Parameters
- rhs Right operand as a JSON string.
- Exceptions
- SQLError invalid JSON string for rhs triggers an error.
- Returns
trueIfthisis greater than or equal torhs.
- Jsonb nz::udx_ver2::Jsonb::operator[] ( int index ) const
-
Gets JSON element by index.
- Parameters
- index Zero-based index of the element. Negative index is allowed.
- Exceptions
- SQLError Out-of-range index triggers an error. SQLError this must be a JSON array, or error is triggered.
- Returns
- Jsonb Element at
index.
- Jsonb nz::udx_ver2::Jsonb::operator[] ( const char * key ) const
- Gets JSON value by key.
- Parameters
- key Key in a key - value pair.
- Exceptions
- SQLError Non-existent key triggers an error.
- Returns
- Jsonb Value of the provided
key.
- char* nz::udx_ver2::Jsonb::pretty ( ) const
-
Converts to indented string.
- Returns
- Char* indented string.
- int nz::udx_ver2::Jsonb::query ( const JsonPath & path, Jsonb & out ) const
-
Gets all JSON elements returned by JsonPath query and wraps result into an array (alias to queryArray()).
- Parameters
- path JsonPath query.
- Exceptions
- SQLError In JsonPath's strict mode, any strutural inconsistency between path and this JSON document will trigger an error.
- Returns
- int Number of items returned.
- int nz::udx_ver2::Jsonb::query ( const JsonPath & path, Jsonb & out, bool silent ) const
-
Gets all JSON elements returned by JsonPath query and wraps result into an array (alias to queryArray()).
- Parameters
- path JsonPath query.
- Returns
- int Number of items returned.
- int nz::udx_ver2::Jsonb::query ( const JsonPath & path, Jsonb & out, const Jsonb & vars ) const
-
Gets all JSON elements returned by JsonPath query and wraps result into an array (alias to queryArray()).
- Parameters
- path JsonPath query.
- Exceptions
- SQLError In JsonPath's strict mode, any strutural inconsistency between path and this JSON document will trigger an error.
- Returns
- int Number of items returned.
- int nz::udx_ver2::Jsonb::query ( const JsonPath & path, Jsonb & out, const Jsonb & vars, bool silent ) const
-
Gets all JSON elements returned by JsonPath query and wraps result into an array (alias to queryArray()).
- Parameters
- path JsonPath query.
- Returns
- int Number of items returned.
- int nz::udx_ver2::Jsonb::queryArray ( const JsonPath & path, Jsonb & out ) const
-
Gets all JSON elements returned by JsonPath query and wraps result into an array.
- Parameters
- path JsonPath query.
- Exceptions
- SQLError In JsonPath's strict mode, any strutural inconsistency between path and this JSON document will trigger an error.
- Returns
- int Number of items returned.
- int nz::udx_ver2::Jsonb::queryArray ( const JsonPath & path, Jsonb & out, bool silent ) const
- Gets all JSON elements returned by JsonPath query and wraps result into an array.
- int nz::udx_ver2::Jsonb::queryArray ( const JsonPath & path, Jsonb & out, const Jsonb & vars ) const
-
Gets all JSON elements returned by JsonPath query and wraps result into an array.
- Parameters
- path JsonPath query.
- Exceptions
- SQLError In JsonPath's strict mode, any strutural inconsistency between path and this JSON document will trigger an error.
- Returns
- int Number of items returned.
- int nz::udx_ver2::Jsonb::queryArray ( const JsonPath & path, Jsonb & out, const Jsonb & vars, bool silent ) const
-
Gets all JSON elements returned by JsonPath query and wraps result into an array.
- Parameters
- path JsonPath query.
- Returns
- int Number of items returned.
- bool nz::udx_ver2::Jsonb::queryFirst ( const JsonPath & path, Jsonb & out ) const
-
Gets the first JSON element returned by JsonPath query.
- Parameters
- path JsonPath query.
- Exceptions
- SQLError In JsonPath's strict mode, any strutural inconsistency between path and this JSON document will trigger an error.
- Returns
trueIf there is a result (stored inout).
- bool nz::udx_ver2::Jsonb::queryFirst ( const JsonPath & path, Jsonb & out, bool silent ) const
-
Gets the first JSON element returned by JsonPath query.
- Parameters
- path JsonPath query.
- Returns
trueIf there is a result (stored inout).
- bool nz::udx_ver2::Jsonb::queryFirst ( const JsonPath & path, Jsonb & out, const Jsonb & vars ) const
-
Gets the first JSON element returned by JsonPath query.
- Parameters
- path JsonPath query.
- Exceptions
- SQLError In JsonPath's strict mode, any strutural inconsistency between path and this JSON document will trigger an error.
- Returns
trueIf there is a result (stored inout).
- bool nz::udx_ver2::Jsonb::queryFirst ( const JsonPath & path, Jsonb & out, const Jsonb & vars, bool silent ) const
-
Gets the first JSON element returned by JsonPath query.
- Parameters
- path JsonPath query.
- Returns
trueIf there is a result (stored inout).
- Jsonb& nz::udx_ver2::Jsonb::remove ( const char * key )
-
Removes a key - value pair from a JSON object using key.
- Parameters
- key Key of to-be-removed pair.
- Exceptions
- SQLError Using this method on a JSON scalar triggers an error.
- Returns
- Jsonb& Reference to
this, which can be used for method chaining.
- Jsonb& nz::udx_ver2::Jsonb::remove ( int index )
-
Removes an element from a JSON array using index.
- Parameters
- index Index of to-be-removed element. Negative index is allowed. Out-of-range index is ignored.
- Exceptions
- SQLError this must be a JSON array, or error is triggered.
- Returns
- Jsonb& Reference to
this, which can be used for method chaining.
- Jsonb& nz::udx_ver2::Jsonb::removeArray ( const Jsonb & keys )
-
Removes multiple key - value pairs from a JSON object using an array of keys.
- Parameters
- keys Keys of to-be-removed pairs. Must be a JSON array.
- Exceptions
- SQLError Using this method on a JSON scalar triggers an error.
- Returns
- Jsonb& Reference to
this, which can be used for method chaining.
- Jsonb& nz::udx_ver2::Jsonb::removeArray ( const char * keys )
-
Removes multiple key - value pairs from a JSON object using an array of keys.
- Parameters
- keys Keys of to-be-removed pairs. Must be a JSON array.
- Exceptions
- SQLError Using this method on a JSON scalar triggers an error.
- Returns
- Jsonb& Reference to
this, which can be used for method chaining.
- Jsonb& nz::udx_ver2::Jsonb::removePath ( const Jsonb & path )
-
Removes an JSON element identified by
path.- Parameters
- path Path to to-be-removed element. Must be a JSON array. Non-existent path is ignored.
- Exceptions
- SQLError Using this method on a JSON scalar triggers an error.
- Returns
- Jsonb& Reference to
this, which can be used for method chaining.
- Jsonb& nz::udx_ver2::Jsonb::removePath ( const char * path )
-
Removes an JSON element identified by
path.- Parameters
- path Path to to-be-removed element. Must be a JSON array. Non-existent path is ignored.
- Exceptions
- SQLError Using this method on a JSON scalar triggers an error.
- Returns
- Jsonb& Reference to
this, which can be used for method chaining.
- Jsonb& nz::udx_ver2::Jsonb::set ( const Jsonb & path, const Jsonb & value )
-
Sets value for an element identified by
path.- Parameters
- path Path to an existing element. Must be a JSON array.
- Note
- By default, if the element does not exist, a new element is created.
- Returns
- Jsonb& Reference to
this, which can be used for method chaining.
- Jsonb& nz::udx_ver2::Jsonb::set ( const char * path, const Jsonb & value )
-
Sets value for an element identified by
path.- Parameters
- path Path to an existing element. Must be a JSON array.
- Note
- By default, if the element does not exist, a new element is created.
- Returns
- Jsonb& Reference to
this, which can be used for method chaining.
- Jsonb& nz::udx_ver2::Jsonb::set ( const Jsonb & path, const char * value )
-
Sets value for an element identified by
path.- Parameters
- path Path to an existing element. Must be a JSON array.
- Note
- By default, if the element does not exist, a new element is created.
- Returns
- Jsonb& Reference to
this, which can be used for method chaining.
- Jsonb& nz::udx_ver2::Jsonb::set ( const char * path, const char * value )
-
Sets value for an element identified by
path.- Parameters
- path Path to an existing element. Must be a JSON array.
- Note
- By default, if the element does not exist, a new element is created.
- Returns
- Jsonb& Reference to
this, which can be used for method chaining.
- Jsonb& nz::udx_ver2::Jsonb::set ( const Jsonb & path, const Jsonb & value, bool create )
-
Sets value for an element identified by
path.- Parameters
- path Path to an existing element. Must be a JSON array.
- Returns
- Jsonb& Reference to
this, which can be used for method chaining.
- Jsonb& nz::udx_ver2::Jsonb::set ( const char * path, const Jsonb & value, bool create )
-
Sets value for an element identified by
path.- Parameters
- path Path to an existing element. Must be a JSON array.
- Returns
- Jsonb& Reference to
this, which can be used for method chaining.
- Jsonb& nz::udx_ver2::Jsonb::set ( const Jsonb & path, const char * value, bool create )
-
Sets value for an element identified by
path.- Parameters
- path Path to an existing element. Must be a JSON array.
- Returns
- Jsonb& Reference to
this, which can be used for method chaining.
- Jsonb& nz::udx_ver2::Jsonb::set ( const char * path, const char * value, bool create )
-
Sets value for an element identified by
path.- Parameters
- path Path to an existing element. Must be a JSON array.
- Returns
- Jsonb& Reference to
this, which can be used for method chaining.
- Jsonb& nz::udx_ver2::Jsonb::stripNulls ( )
-
Recursively removes all key - value pairs whose value is
nullfrom a JSON object.- Note
- This method does not remove
nullsfrom a JSON array.
- Returns
- Jsonb& Reference to
this.
- bool nz::udx_ver2::Jsonb::toBool ( ) const
-
Converts to bool.
- Exceptions
- SQLError this must be a JSON boolean, or error is triggered.
- Returns
- bool Value of the JSON boolean.
- double nz::udx_ver2::Jsonb::toDouble ( ) const
-
Converts to double.
- Exceptions
- SQLError this must be a JSON numeric, or error is triggered.
- Returns
- double Value of the JSON numeric.
- float nz::udx_ver2::Jsonb::toFloat ( ) const
-
Converts to float.
- Exceptions
- SQLError this must be a JSON numeric, or error is triggered.
- Returns
- float Value of the JSON numeric.
- int16 nz::udx_ver2::Jsonb::toInt16 ( ) const
-
Converts to int16.
- Exceptions
- SQLError this must be a JSON numeric, or error is triggered.
- Returns
- int16 Value of the JSON numeric.
- int32 nz::udx_ver2::Jsonb::toInt32 ( ) const
-
Converts to int32.
- Exceptions
- SQLError this must be a JSON numeric, or error is triggered.
- Returns
- int32 Value of the JSON numeric.
- int64 nz::udx_ver2::Jsonb::toInt64 ( ) const
-
Converts to int64.
- Exceptions
- SQLError this must be a JSON numeric, or error is triggered.
- Returns
- int64 Value of the JSON numeric.
- int8 nz::udx_ver2::Jsonb::toInt8 ( ) const
-
Converts to int8.
- Exceptions
- SQLError this must be a JSON numeric, or error is triggered.
- Returns
- int8 Value of the JSON numeric.
- char* nz::udx_ver2::Jsonb::toString ( ) const
-
Converts to string.
- Note
- Caller is responsible for freeing return pointer.
- Returns
- char* JSON string.
- JbvType nz::udx_ver2::Jsonb::type ( ) const
-
Type of this JSON document.
- Returns
- JbvType Type of JSON document.
JbvType JBV_NULL JBV_STRING JBV_NUMERIC JBV_BOOL JBV_ARRAY JBV_OBJECT
- const char* nz::udx_ver2::Jsonb::typeName ( ) const
-
Type name of this JSON document.
- Returns
- const char* Type name of this JSON document.
JbvType Type name JBV_NULL "null" JBV_STRING "string" JBV_NUMERIC "number" JBV_BOOL "boolean" JBV_ARRAY "array" JBV_OBJECT "object"