MongoDB C++ Driver
mongocxx-3.0.2
|
A low-level interface for constructing BSON documents and arrays. More...
#include <core.hpp>
Public Member Functions | |
core (bool is_array) | |
Constructs an empty BSON datum. More... | |
void | key_view (stdx::string_view key) |
Appends a key passed as a non-owning stdx::string_view. More... | |
void | key_owned (std::string key) |
Appends a key passed as a STL string. More... | |
void | open_document () |
Opens a sub-document within this BSON datum. | |
void | open_array () |
Opens a sub-array within this BSON datum. | |
void | close_document () |
Closes the current sub-document within this BSON datum. | |
void | close_array () |
Closes the current sub-array within this BSON datum. | |
void | concatenate (const document::view &view) |
Appends the keys from a BSON document into this BSON datum. More... | |
void | append (const types::b_double &value) |
Append a BSON double. | |
void | append (const types::b_utf8 &value) |
Append a BSON UTF-8 string. | |
void | append (const types::b_document &value) |
Append a BSON document. | |
void | append (const types::b_array &value) |
Append a BSON array. | |
void | append (const types::b_binary &value) |
Append a BSON binary datum. | |
void | append (const types::b_undefined &value) |
Append a BSON undefined. | |
void | append (const types::b_oid &value) |
Append a BSON ObjectId. | |
void | append (const types::b_bool &value) |
Append a BSON boolean. | |
void | append (const types::b_date &value) |
Append a BSON date. | |
void | append (const types::b_null &value) |
Append a BSON null. | |
void | append (const types::b_regex &value) |
Append a BSON regex. | |
void | append (const types::b_dbpointer &value) |
Append a BSON DBPointer. | |
void | append (const types::b_code &value) |
Append a BSON JavaScript code. | |
void | append (const types::b_symbol &value) |
Append a BSON symbol. | |
void | append (const types::b_codewscope &value) |
Append a BSON JavaScript code with scope. | |
void | append (const types::b_int32 &value) |
Append a BSON 32-bit signed integer. | |
void | append (const types::b_timestamp &value) |
Append a BSON replication timestamp. | |
void | append (const types::b_int64 &value) |
Append a BSON 64-bit signed integer. | |
void | append (const types::b_minkey &value) |
Append a BSON min-key. | |
void | append (const types::b_maxkey &value) |
Append a BSON max-key. | |
void | append (const types::value &value) |
Append a BSON variant value. | |
void | append (std::string str) |
Append a STL string as a BSON UTF-8 string. | |
void | append (stdx::string_view str) |
Append a string view as a BSON UTF-8 string. | |
template<typename T > | |
void | append (T *v) |
Append a char* or const char*. More... | |
void | append (bool value) |
Append a native boolean as a BSON boolean. | |
void | append (double value) |
Append a native double as a BSON double. | |
void | append (std::int32_t value) |
Append a native int32_t as a BSON 32-bit signed integer. | |
void | append (std::int64_t value) |
Append a native int64_t as a BSON 64-bit signed integer. | |
void | append (const oid &value) |
Append an oid as a BSON ObjectId. | |
void | append (document::view view) |
Append the given document view. | |
void | append (array::view view) |
Append the given array view. | |
document::view | view_document () const |
Get a view over the document. More... | |
array::view | view_array () const |
Get a view over the array. More... | |
document::value | extract_document () |
Transfer ownership of the underlying document to the caller. More... | |
array::value | extract_array () |
Transfer ownership of the underlying document to the caller. More... | |
void | clear () |
Delete the contents of the underlying BSON datum. More... | |
A low-level interface for constructing BSON documents and arrays.
|
explicit |
Constructs an empty BSON datum.
is_array | true if the top-level BSON datum should be an array. |
|
inline |
Append a char* or const char*.
We disable all other pointer types to prevent the surprising implicit conversion to bool.
void bsoncxx::builder::core::clear | ( | ) |
Delete 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.
void bsoncxx::builder::core::concatenate | ( | const document::view & | view | ) |
Appends the keys from a BSON document into this BSON datum.
array::value bsoncxx::builder::core::extract_array | ( | ) |
Transfer ownership of the underlying document to the caller.
document::value bsoncxx::builder::core::extract_document | ( | ) |
Transfer ownership of the underlying document to the caller.
void bsoncxx::builder::core::key_owned | ( | std::string | key | ) |
Appends a key passed as a STL string.
Transfers ownership of the key to this class.
key | A string key. |
void bsoncxx::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. |
array::view bsoncxx::builder::core::view_array | ( | ) | const |
Get a view over the array.
document::view bsoncxx::builder::core::view_document | ( | ) | const |
Get a view over the document.