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

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

Description

A streaming interface for constructing a BSON document.

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

Public Member Functions

 document ()
 Default constructor.
 
void clear ()
 Reset the underlying BSON to an empty document.
 
bsoncxx::v_noabi::document::value extract ()
 Transfer ownership of the underlying document to the caller.
 
 operator bsoncxx::v_noabi::document::view () const
 
bsoncxx::v_noabi::document::view view () const
 
- Public Member Functions inherited from bsoncxx::v_noabi::builder::stream::key_context<>
 key_context (core *core)
 Create a key_context given a core builder.
 
 operator key_context<> ()
 Conversion operator which provides a rooted document given any stream currently in a nested key_context.
 
key_context operator<< (concatenate_doc doc)
 << operator for concatenating another document.
 
value_context< key_contextoperator<< (const char(&v)[n])
 << operator for accepting a literal key and appending it to the core builder.
 
base operator<< (const close_document_type)
 << operator for closing a subdocument in the core builder.
 
value_context< key_contextoperator<< (std::string str)
 << operator for accepting a std::string key and appending it to the core builder.
 
value_context< key_contextoperator<< (stdx::string_view str)
 << operator for accepting a stdx::string_view key and appending it to the core builder.
 
detail::requires_t< bsoncxx::v_noabi::document::value, std::is_same< base, closed_context >, detail::is_alike< T, finalize_type > > operator<< (T &&)
 << operator for finalizing the stream.
 
detail::requires_t< key_context &, detail::is_invocable< T, key_context > > operator<< (T &&func)
 << operator for accepting a callable of the form void(key_context) and invoking it to perform 1 or more key, value appends to the core builder.
 

Constructor & Destructor Documentation

◆ document()

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

Default constructor.

Member Function Documentation

◆ clear()

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

Reset the underlying BSON to an empty document.

◆ extract()

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

Transfer ownership of the underlying document to the caller.

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

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

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

◆ view()

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

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