MongoDB C++ Driver 4.1.0
|
#include <bsoncxx/v_noabi/bsoncxx/builder/core.hpp>
A low-level interface for constructing BSON documents and arrays.
Public Member Functions | |
core (bool is_array) | |
Constructs an empty BSON datum. | |
uint8_t * | append (binary_sub_type sub_type, uint32_t length) |
Appends a BSON binary datum by allocating space that the caller must fill with content. | |
core & | append (bool value) |
Appends a native boolean as a BSON boolean. | |
core & | append (bsoncxx::v_noabi::array::view view) |
Appends the given array view. | |
core & | append (bsoncxx::v_noabi::document::view view) |
Appends the given document view. | |
core & | append (decimal128 value) |
Appends a decimal128 object as a BSON Decimal128. | |
core & | append (double value) |
Appends a native double as a BSON double. | |
core & | append (oid const &value) |
Appends an oid as a BSON ObjectId. | |
core & | append (std::int32_t value) |
Appends a native int32_t as a BSON 32-bit signed integer. | |
core & | append (std::int64_t value) |
Appends a native int64_t as a BSON 64-bit signed integer. | |
core & | append (std::string str) |
Appends an STL string as a BSON UTF-8 string. | |
core & | append (stdx::string_view str) |
Appends a string view as a BSON UTF-8 string. | |
template<typename T> | |
core & | append (T *v) |
Appends a char* or char const*. | |
core & | append (types::b_array const &value) |
Appends a BSON array. | |
core & | append (types::b_binary const &value) |
Appends a BSON binary datum. | |
core & | append (types::b_bool const &value) |
Appends a BSON boolean. | |
core & | append (types::b_code const &value) |
Appends a BSON JavaScript code. | |
core & | append (types::b_codewscope const &value) |
Appends a BSON JavaScript code with scope. | |
core & | append (types::b_date const &value) |
Appends a BSON date. | |
core & | append (types::b_dbpointer const &value) |
Appends a BSON DBPointer. | |
core & | append (types::b_decimal128 const &value) |
Appends a BSON Decimal128. | |
core & | append (types::b_document const &value) |
Appends a BSON document. | |
core & | append (types::b_double const &value) |
Appends a BSON double. | |
core & | append (types::b_int32 const &value) |
Appends a BSON 32-bit signed integer. | |
core & | append (types::b_int64 const &value) |
Appends a BSON 64-bit signed integer. | |
core & | append (types::b_maxkey const &value) |
Appends a BSON max-key. | |
core & | append (types::b_minkey const &value) |
Appends a BSON min-key. | |
core & | append (types::b_null const &value) |
Appends a BSON null. | |
core & | append (types::b_oid const &value) |
Appends a BSON ObjectId. | |
core & | append (types::b_regex const &value) |
Appends a BSON regex. | |
core & | append (types::b_string const &value) |
Append a BSON UTF-8 string. | |
core & | append (types::b_symbol const &value) |
Appends a BSON symbol. | |
core & | append (types::b_timestamp const &value) |
Appends a BSON replication timestamp. | |
core & | append (types::b_undefined const &value) |
Appends a BSON undefined. | |
core & | append (types::bson_value::view const &value) |
Appends a BSON variant value. | |
void | clear () |
Deletes the contents of the underlying BSON datum. After calling clear(), the state of this class will be the same as it was immediately after construction. | |
core & | close_array () |
Closes the current sub-array within this BSON datum. | |
core & | close_binary () |
Closes the current sub-binary within this BSON datum. | |
core & | close_document () |
Closes the current sub-document within this BSON datum. | |
core & | concatenate (bsoncxx::v_noabi::document::view const &view) |
Appends the keys from a BSON document into this BSON datum. | |
bsoncxx::v_noabi::array::value | extract_array () |
Transfers ownership of the underlying document to the caller. | |
bsoncxx::v_noabi::document::value | extract_document () |
Transfers ownership of the underlying document to the caller. | |
core & | key_owned (std::string key) |
Appends a key passed as an STL string. Transfers ownership of the key to this class. | |
core & | key_view (stdx::string_view key) |
Appends a key passed as a non-owning stdx::string_view. | |
core & | open_array () |
Opens a sub-array within this BSON datum. | |
core & | open_binary ()=delete |
A sub-binary must be opened by invoking bsoncxx::v_noabi::builder::basic::sub_binary::allocate() | |
core & | open_document () |
Opens a sub-document within this BSON datum. | |
bsoncxx::v_noabi::array::view | view_array () const |
Gets a view over the array. | |
bsoncxx::v_noabi::document::view | view_document () const |
Gets a view over the document. | |
|
explicit |
Constructs an empty BSON datum.
is_array | True if the top-level BSON datum should be an array. |
uint8_t * bsoncxx::v_noabi::builder::core::append | ( | binary_sub_type | sub_type, |
uint32_t | length ) |
Appends a BSON binary datum by allocating space that the caller must fill with content.
bsoncxx::v_noabi::exception | if the current BSON datum is a document that is waiting for a key to be appended to start a new key/value pair. bsoncxx::v_noabi::exception if the binary fails to append. |
core & bsoncxx::v_noabi::builder::core::append | ( | bool | value | ) |
Appends a native boolean as a BSON boolean.
bsoncxx::v_noabi::exception | if the current BSON datum is a document that is waiting for a key to be appended to start a new key/value pair. |
core & bsoncxx::v_noabi::builder::core::append | ( | bsoncxx::v_noabi::array::view | view | ) |
Appends the given array view.
bsoncxx::v_noabi::exception | if the current BSON datum is a document that is waiting for a key to be appended to start a new key/value pair. |
core & bsoncxx::v_noabi::builder::core::append | ( | bsoncxx::v_noabi::document::view | view | ) |
Appends the given document view.
bsoncxx::v_noabi::exception | if the current BSON datum is a document that is waiting for a key to be appended to start a new key/value pair. |
core & bsoncxx::v_noabi::builder::core::append | ( | decimal128 | value | ) |
Appends a decimal128 object as a BSON Decimal128.
bsoncxx::v_noabi::exception | if the current BSON datum is a document that is waiting for a key to be appended to start a new key/value pair. |
core & bsoncxx::v_noabi::builder::core::append | ( | double | value | ) |
Appends a native double as a BSON double.
bsoncxx::v_noabi::exception | if the current BSON datum is a document that is waiting for a key to be appended to start a new key/value pair. |
Appends an oid as a BSON ObjectId.
bsoncxx::v_noabi::exception | if the current BSON datum is a document that is waiting for a key to be appended to start a new key/value pair. |
core & bsoncxx::v_noabi::builder::core::append | ( | std::int32_t | value | ) |
Appends a native int32_t as a BSON 32-bit signed integer.
bsoncxx::v_noabi::exception | if the current BSON datum is a document that is waiting for a key to be appended to start a new key/value pair. |
core & bsoncxx::v_noabi::builder::core::append | ( | std::int64_t | value | ) |
Appends a native int64_t as a BSON 64-bit signed integer.
bsoncxx::v_noabi::exception | if the current BSON datum is a document that is waiting for a key to be appended to start a new key/value pair. |
core & bsoncxx::v_noabi::builder::core::append | ( | std::string | str | ) |
Appends an STL string as a BSON UTF-8 string.
bsoncxx::v_noabi::exception | if the current BSON datum is a document that is waiting for a key to be appended to start a new key/value pair. |
core & bsoncxx::v_noabi::builder::core::append | ( | stdx::string_view | str | ) |
Appends a string view as a BSON UTF-8 string.
bsoncxx::v_noabi::exception | if the current BSON datum is a document that is waiting for a key to be appended to start a new key/value pair. |
|
inline |
Appends a char* or char const*.
We disable all other pointer types to prevent the surprising implicit conversion to bool.
bsoncxx::v_noabi::exception | if the current BSON datum is a document that is waiting for a key to be appended to start a new key/value pair. |
core & bsoncxx::v_noabi::builder::core::append | ( | types::b_array const & | value | ) |
Appends a BSON array.
bsoncxx::v_noabi::exception | if the current BSON datum is a document that is waiting for a key to be appended to start a new key/value pair. bsoncxx::v_noabi::exception if the array fails to append. |
core & bsoncxx::v_noabi::builder::core::append | ( | types::b_binary const & | value | ) |
Appends a BSON binary datum.
bsoncxx::v_noabi::exception | if the current BSON datum is a document that is waiting for a key to be appended to start a new key/value pair. bsoncxx::v_noabi::exception if the binary fails to append. |
core & bsoncxx::v_noabi::builder::core::append | ( | types::b_bool const & | value | ) |
Appends a BSON boolean.
bsoncxx::v_noabi::exception | if the current BSON datum is a document that is waiting for a key to be appended to start a new key/value pair. bsoncxx::v_noabi::exception if the boolean fails to append. |
core & bsoncxx::v_noabi::builder::core::append | ( | types::b_code const & | value | ) |
Appends a BSON JavaScript code.
bsoncxx::v_noabi::exception | if the current BSON datum is a document that is waiting for a key to be appended to start a new key/value pair. bsoncxx::v_noabi::exception if the JavaScript code fails to append. |
core & bsoncxx::v_noabi::builder::core::append | ( | types::b_codewscope const & | value | ) |
Appends a BSON JavaScript code with scope.
bsoncxx::v_noabi::exception | if the current BSON datum is a document that is waiting for a key to be appended to start a new key/value pair. bsoncxx::v_noabi::exception if the JavaScript code with scope fails to append. |
core & bsoncxx::v_noabi::builder::core::append | ( | types::b_date const & | value | ) |
Appends a BSON date.
bsoncxx::v_noabi::exception | if the current BSON datum is a document that is waiting for a key to be appended to start a new key/value pair. bsoncxx::v_noabi::exception if the date fails to append. |
core & bsoncxx::v_noabi::builder::core::append | ( | types::b_dbpointer const & | value | ) |
Appends a BSON DBPointer.
bsoncxx::v_noabi::exception | if the current BSON datum is a document that is waiting for a key to be appended to start a new key/value pair. bsoncxx::v_noabi::exception if the DBPointer fails to append. |
core & bsoncxx::v_noabi::builder::core::append | ( | types::b_decimal128 const & | value | ) |
Appends a BSON Decimal128.
bsoncxx::v_noabi::exception | if the current BSON datum is a document that is waiting for a key to be appended to start a new key/value pair. bsoncxx::v_noabi::exception if the Decimal128 fails to append. |
core & bsoncxx::v_noabi::builder::core::append | ( | types::b_document const & | value | ) |
Appends a BSON document.
bsoncxx::v_noabi::exception | if the current BSON datum is a document that is waiting for a key to be appended to start a new key/value pair. bsoncxx::v_noabi::exception if the document fails to append. |
core & bsoncxx::v_noabi::builder::core::append | ( | types::b_double const & | value | ) |
Appends a BSON double.
bsoncxx::v_noabi::exception | if the current BSON datum is a document that is waiting for a key to be appended to start a new key/value pair. bsoncxx::v_noabi::exception if the double fails to append. |
core & bsoncxx::v_noabi::builder::core::append | ( | types::b_int32 const & | value | ) |
Appends a BSON 32-bit signed integer.
bsoncxx::v_noabi::exception | if the current BSON datum is a document that is waiting for a key to be appended to start a new key/value pair. bsoncxx::v_noabi::exception if the 32-bit signed integer fails to append. |
core & bsoncxx::v_noabi::builder::core::append | ( | types::b_int64 const & | value | ) |
Appends a BSON 64-bit signed integer.
bsoncxx::v_noabi::exception | if the current BSON datum is a document that is waiting for a key to be appended to start a new key/value pair. bsoncxx::v_noabi::exception if the 64-bit signed integer fails to append. |
core & bsoncxx::v_noabi::builder::core::append | ( | types::b_maxkey const & | value | ) |
Appends a BSON max-key.
bsoncxx::v_noabi::exception | if the current BSON datum is a document that is waiting for a key to be appended to start a new key/value pair. bsoncxx::v_noabi::exception if the max-key fails to append. |
core & bsoncxx::v_noabi::builder::core::append | ( | types::b_minkey const & | value | ) |
Appends a BSON min-key.
bsoncxx::v_noabi::exception | if the current BSON datum is a document that is waiting for a key to be appended to start a new key/value pair. bsoncxx::v_noabi::exception if the min-key fails to append. |
core & bsoncxx::v_noabi::builder::core::append | ( | types::b_null const & | value | ) |
Appends a BSON null.
bsoncxx::v_noabi::exception | if the current BSON datum is a document that is waiting for a key to be appended to start a new key/value pair. bsoncxx::v_noabi::exception if null fails to append. |
core & bsoncxx::v_noabi::builder::core::append | ( | types::b_oid const & | value | ) |
Appends a BSON ObjectId.
bsoncxx::v_noabi::exception | if the current BSON datum is a document that is waiting for a key to be appended to start a new key/value pair. bsoncxx::v_noabi::exception if the ObjectId fails to append. |
core & bsoncxx::v_noabi::builder::core::append | ( | types::b_regex const & | value | ) |
Appends a BSON regex.
bsoncxx::v_noabi::exception | if the current BSON datum is a document that is waiting for a key to be appended to start a new key/value pair. bsoncxx::v_noabi::exception if the regex fails to append. |
core & bsoncxx::v_noabi::builder::core::append | ( | types::b_string const & | value | ) |
Append a BSON UTF-8 string.
bsoncxx::v_noabi::exception | if the current BSON datum is a document that is waiting for a key to be appended to start a new key/value pair. bsoncxx::v_noabi::exception if the string fails to append. |
core & bsoncxx::v_noabi::builder::core::append | ( | types::b_symbol const & | value | ) |
Appends a BSON symbol.
bsoncxx::v_noabi::exception | if the current BSON datum is a document that is waiting for a key to be appended to start a new key/value pair. bsoncxx::v_noabi::exception if the symbol fails to append. |
core & bsoncxx::v_noabi::builder::core::append | ( | types::b_timestamp const & | value | ) |
Appends a BSON replication timestamp.
bsoncxx::v_noabi::exception | if the current BSON datum is a document that is waiting for a key to be appended to start a new key/value pair. bsoncxx::v_noabi::exception if the timestamp fails to append. |
core & bsoncxx::v_noabi::builder::core::append | ( | types::b_undefined const & | value | ) |
Appends a BSON undefined.
bsoncxx::v_noabi::exception | if the current BSON datum is a document that is waiting for a key to be appended to start a new key/value pair. bsoncxx::v_noabi::exception if undefined fails to append. |
core & bsoncxx::v_noabi::builder::core::append | ( | types::bson_value::view const & | value | ) |
Appends a BSON variant value.
bsoncxx::v_noabi::exception | if the current BSON datum is a document that is waiting for a key to be appended to start a new key/value pair. |
void bsoncxx::v_noabi::builder::core::clear | ( | ) |
Deletes the contents of the underlying BSON datum. After calling clear(), the state of this class will be the same as it was immediately after construction.
core & bsoncxx::v_noabi::builder::core::close_array | ( | ) |
Closes the current sub-array within this BSON datum.
bsoncxx::v_noabi::exception | if the current BSON datum is not an open sub-array. |
core & bsoncxx::v_noabi::builder::core::close_binary | ( | ) |
Closes the current sub-binary within this BSON datum.
bsoncxx::v_noabi::exception | if the binary contents were never allocated. |
core & bsoncxx::v_noabi::builder::core::close_document | ( | ) |
Closes the current sub-document within this BSON datum.
bsoncxx::v_noabi::exception | if the current BSON datum is not an open sub-document. |
core & bsoncxx::v_noabi::builder::core::concatenate | ( | bsoncxx::v_noabi::document::view const & | view | ) |
Appends the keys from a BSON document into this BSON datum.
view
are kept. Otherwise (if this BSON datum is an array), the original keys from view
are discarded.bsoncxx::v_noabi::exception | if one of the keys fails to append. |
bsoncxx::v_noabi::array::value bsoncxx::v_noabi::builder::core::extract_array | ( | ) |
Transfers ownership of the underlying document to the caller.
bsoncxx::v_noabi::exception | if the precondition is violated. |
bsoncxx::v_noabi::document::value bsoncxx::v_noabi::builder::core::extract_document | ( | ) |
Transfers ownership of the underlying document to the caller.
bsoncxx::v_noabi::exception | if the precondition is violated. |
core & bsoncxx::v_noabi::builder::core::key_owned | ( | std::string | key | ) |
Appends a key passed as an STL string. Transfers ownership of the key to this class.
key | A string key. |
bsoncxx::v_noabi::exception | if the current BSON datum is an array or if the previous value appended to the builder was a key. |
core & bsoncxx::v_noabi::builder::core::key_view | ( | stdx::string_view | key | ) |
Appends a key passed as a non-owning stdx::string_view.
key | A null-terminated array of characters. |
bsoncxx::v_noabi::exception | if the current BSON datum is an array or if the previous value appended to the builder was also a key. |
core & bsoncxx::v_noabi::builder::core::open_array | ( | ) |
Opens a sub-array within this BSON datum.
bsoncxx::v_noabi::exception | if the current BSON datum is a document that is waiting for a key to be appended to start a new key/value pair. |
|
delete |
A sub-binary must be opened by invoking bsoncxx::v_noabi::builder::basic::sub_binary::allocate()
core & bsoncxx::v_noabi::builder::core::open_document | ( | ) |
Opens a sub-document within this BSON datum.
bsoncxx::v_noabi::exception | if the current BSON datum is a document that is waiting for a key to be appended to start a new key/value pair. |
bsoncxx::v_noabi::array::view bsoncxx::v_noabi::builder::core::view_array | ( | ) | const |
Gets a view over the array.
bsoncxx::v_noabi::exception | if the precondition is violated. |
bsoncxx::v_noabi::document::view bsoncxx::v_noabi::builder::core::view_document | ( | ) | const |
Gets a view over the document.
bsoncxx::v_noabi::exception | if the precondition is violated. |