MongoDB C++ Driver mongocxx-3.11.0
Loading...
Searching...
No Matches
bsoncxx::v_noabi::builder::stream::array Class Reference

#include <bsoncxx/v_noabi/bsoncxx/builder/stream/array.hpp>

Description

A streaming interface for constructing a BSON array.

Warning
Use of the stream builder is discouraged. See Working with BSON for more details.

Public Member Functions

 array ()
 Default constructor.
 
void clear ()
 Reset the underlying BSON to an empty array.
 
bsoncxx::v_noabi::array::value extract ()
 Transfer ownership of the underlying array to the caller.
 
 operator bsoncxx::v_noabi::array::view () const
 
bsoncxx::v_noabi::array::view view () const
 
- Public Member Functions inherited from bsoncxx::v_noabi::builder::stream::array_context<>
 array_context (core *core)
 Create an array_context given a core builder.
 
 operator array_context<> ()
 Conversion operator which provides a rooted array context given any stream currently in a nested array_context.
 
 operator single_context ()
 Conversion operator for single_context.
 
array_context operator<< (concatenate_array array)
 << operator for concatenating another array.
 
base operator<< (const close_array_type)
 << operator for closing a subarray in the core builder.
 
array_context< array_contextoperator<< (const open_array_type)
 << operator for opening a new subarray in the core builder.
 
key_context< array_contextoperator<< (const open_document_type)
 << operator for opening a new subdocument in the core builder.
 
detail::requires_t< array_context &, detail::disjunction< detail::is_invocable< Func, array_context >, detail::is_invocable< Func, single_context > > > operator<< (Func &&func)
 << operator for accepting a callable of the form void(array_context) or void(single_context) and invoking it to perform 1 or more value appends to the core builder.
 
detail::requires_t< bsoncxx::v_noabi::array::value, std::is_same< base, closed_context >, detail::is_alike< T, finalize_type > > operator<< (T &&)
 << operator for finalizing the stream.
 
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.
 

Constructor & Destructor Documentation

◆ array()

bsoncxx::v_noabi::builder::stream::array::array ( )
inline

Default constructor.

Member Function Documentation

◆ clear()

void bsoncxx::v_noabi::builder::stream::array::clear ( )
inline

Reset the underlying BSON to an empty array.

◆ extract()

bsoncxx::v_noabi::array::value bsoncxx::v_noabi::builder::stream::array::extract ( )
inline

Transfer ownership of the underlying array to the caller.

Returns
An array::value with ownership of the array.
Warning
After calling extract() it is illegal to call any methods on this class, unless it is subsequenly moved into.

◆ operator bsoncxx::v_noabi::array::view()

bsoncxx::v_noabi::builder::stream::array::operator bsoncxx::v_noabi::array::view ( ) const
inline
Returns
A view of the BSON array.

◆ view()

bsoncxx::v_noabi::array::view bsoncxx::v_noabi::builder::stream::array::view ( ) const
inline
Returns
A view of the BSON array.

The documentation for this class was generated from the following file: