18 #include <bsoncxx/builder/core.hpp> 19 #include <bsoncxx/builder/stream/closed_context.hpp> 20 #include <bsoncxx/builder/stream/value_context.hpp> 21 #include <bsoncxx/stdx/string_view.hpp> 22 #include <bsoncxx/util/functor.hpp> 24 #include <bsoncxx/config/prelude.hpp> 27 BSONCXX_INLINE_NAMESPACE_BEGIN
48 template <
class base = closed_context>
68 template <std::
size_t n>
70 _core->
key_view(stdx::string_view{v, n - 1});
110 template <
typename T>
112 typename std::enable_if<util::is_functor<T, void(key_context<>)>::value,
key_context>::
type&
113 operator<<(T&& func) {
129 template <
typename T>
130 BSONCXX_INLINE
typename std::enable_if<
131 std::is_same<base, closed_context>::value &&
132 std::is_same<typename std::remove_reference<T>::type,
const finalize_type>::value,
174 BSONCXX_INLINE base unwrap() {
183 BSONCXX_INLINE_NAMESPACE_END
186 #include <bsoncxx/config/postlude.hpp> A low-level interface for constructing BSON documents and arrays.
Definition: core.hpp:42
key_context(core *core)
Create a key_context given a core builder.
Definition: key_context.hpp:57
A read-only BSON document that owns its underlying buffer.
Definition: value.hpp:33
Definition: helpers.hpp:68
core & close_document()
Closes the current sub-document within this BSON datum.
key_context operator<<(concatenate_doc doc)
<< operator for concatenating another document.
Definition: key_context.hpp:149
core & key_owned(std::string key)
Appends a key passed as an STL string.
core & key_view(stdx::string_view key)
Appends a key passed as a non-owning stdx::string_view.
value_context< key_context > operator<<(const char(&v)[n])
<< operator for accepting a literal key and appending it to the core builder.
Definition: key_context.hpp:69
A stream context which expects a key, which can later be followed by value, then more key/value pairs...
Definition: array_context.hpp:32
Container to concatenate a document.
Definition: concatenate.hpp:30
Definition: helpers.hpp:38
type
An enumeration of each BSON type.
Definition: types.hpp:39
document::value extract_document()
Transfers ownership of the underlying document to the caller.
core & concatenate(const document::view &view)
Appends the keys from a BSON document into this BSON datum.
base operator<<(const close_document_type)
<< operator for closing a subdocument in the core builder.
Definition: key_context.hpp:160
A stream context which expects a value, which can later be followed by more key/value pairs...
Definition: value_context.hpp:48
Top level namespace for MongoDB C++ BSON functionality.
Definition: element.hpp:24