17 #include <bsoncxx/builder/stream/array_context-fwd.hpp>
18 #include <bsoncxx/builder/stream/key_context-fwd.hpp>
19 #include <bsoncxx/builder/stream/single_context-fwd.hpp>
21 #include <bsoncxx/array/value.hpp>
22 #include <bsoncxx/builder/concatenate.hpp>
23 #include <bsoncxx/builder/core.hpp>
24 #include <bsoncxx/builder/stream/closed_context.hpp>
25 #include <bsoncxx/builder/stream/helpers.hpp>
26 #include <bsoncxx/stdx/type_traits.hpp>
28 #include <bsoncxx/config/prelude.hpp>
70 detail::is_invocable<T, array_context<>>,
71 detail::is_invocable<T, single_context>,
72 detail::is_alike<T, finalize_type>>
74 _core->
append(std::forward<T>(t));
86 template <
typename Func>
89 detail::disjunction<detail::is_invocable<Func, array_context>,
90 detail::is_invocable<Func, single_context>>>
92 detail::invoke(std::forward<Func>(func), *
this);
106 template <
typename T>
108 std::is_same<base, closed_context>,
109 detail::is_alike<T, finalize_type>>
120 BSONCXX_INLINE key_context<array_context>
operator<<(
const open_document_type) {
122 return wrap_document();
175 BSONCXX_INLINE base unwrap() {
179 BSONCXX_INLINE array_context<array_context> wrap_array() {
180 return array_context<array_context>(_core);
183 BSONCXX_INLINE key_context<array_context> wrap_document() {
184 return key_context<array_context>(_core);
195 #include <bsoncxx/config/postlude.hpp>
A read-only BSON array that owns its underlying buffer.
Definition: value.hpp:36
A low-level interface for constructing BSON documents and arrays.
Definition: core.hpp:45
core & append(const types::b_double &value)
Appends a BSON double.
bsoncxx::v_noabi::array::value extract_array()
Transfers ownership of the underlying document to the caller.
core & concatenate(const bsoncxx::v_noabi::document::view &view)
Appends the keys from a BSON document into this BSON datum.
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.
A stream context which expects any number of values.
Definition: array_context.hpp:51
array_context operator<<(concatenate_array array)
<< operator for concatenating another array.
Definition: array_context.hpp:134
base operator<<(const close_array_type)
<< operator for closing a subarray in the core builder.
Definition: array_context.hpp:154
array_context(core *core)
Create an array_context given a core builder.
Definition: array_context.hpp:59
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:73
A streaming interface for constructing a BSON array.
Definition: array.hpp:42
bsoncxx::v_noabi::array::view view() const
Definition: array.hpp:52
A stream context which appends a single value.
Definition: single_context.hpp:38
The top-level namespace for bsoncxx library entities.
Definition: element-fwd.hpp:19
Container to concatenate an array.
Definition: concatenate.hpp:64
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