17 #include <bsoncxx/array/value.hpp>
18 #include <bsoncxx/builder/concatenate.hpp>
19 #include <bsoncxx/builder/core.hpp>
20 #include <bsoncxx/builder/stream/closed_context.hpp>
21 #include <bsoncxx/builder/stream/helpers.hpp>
22 #include <bsoncxx/stdx/type_traits.hpp>
24 #include <bsoncxx/config/prelude.hpp>
27 inline namespace v_noabi {
51 template <
class base = closed_context>
71 detail::is_invocable<T, array_context<>>,
72 detail::is_invocable<T, single_context>,
73 detail::is_alike<T, finalize_type>>
75 _core->
append(std::forward<T>(t));
87 template <
typename Func>
90 detail::disjunction<detail::is_invocable<Func, array_context>,
91 detail::is_invocable<Func, single_context>>>
93 detail::invoke(std::forward<Func>(func), *
this);
107 template <
typename T>
108 BSONCXX_INLINE detail::requires_t<bsoncxx::array::value,
109 std::is_same<base, closed_context>,
110 detail::is_alike<T, finalize_type>>
121 BSONCXX_INLINE key_context<array_context>
operator<<(
const open_document_type) {
123 return wrap_document();
176 BSONCXX_INLINE base unwrap() {
180 BSONCXX_INLINE array_context<array_context> wrap_array() {
181 return array_context<array_context>(_core);
184 BSONCXX_INLINE key_context<array_context> wrap_document() {
185 return key_context<array_context>(_core);
196 #include <bsoncxx/config/postlude.hpp>
A low-level interface for constructing BSON documents and arrays.
Definition: core.hpp:43
core & concatenate(const document::view &view)
Appends the keys from a BSON document into this BSON datum.
core & append(const types::b_double &value)
Appends a BSON double.
core & open_array()
Opens a sub-array within this BSON datum.
core & open_document()
Opens a sub-document within this BSON datum.
core & close_array()
Closes the current sub-array within this BSON datum.
array::value extract_array()
Transfers ownership of the underlying document to the caller.
A stream context which expects any number of values.
Definition: array_context.hpp:52
array_context operator<<(concatenate_array array)
<< operator for concatenating another array.
Definition: array_context.hpp:135
base operator<<(const close_array_type)
<< operator for closing a subarray in the core builder.
Definition: array_context.hpp:155
array_context(core *core)
Create an array_context given a core builder.
Definition: array_context.hpp:60
detail::requires_not_t< array_context &, detail::is_invocable< T, array_context<> >, detail::is_invocable< T, single_context >, detail::is_alike< T, finalize_type > > operator<<(T &&t)
<< operator for accepting a real value and appending it to the core builder.
Definition: array_context.hpp:74
A streaming interface for constructing a BSON array.
Definition: array.hpp:40
bsoncxx::array::view view() const
Definition: array.hpp:50
A stream context which appends a single value.
Definition: single_context.hpp:36
The top-level namespace for bsoncxx library entities.
Definition: element.hpp:24
Container to concatenate an array.
Definition: concatenate.hpp:62
The type of a stream manipulator to close a subarray.
Definition: helpers.hpp:71
The type of a stream manipulator to open a subarray.
Definition: helpers.hpp:56