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

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

Description

A traditional builder-style interface for constructing a BSON document.

Public Member Functions

 document ()
 Default constructor.
 
 document (document &&doc) noexcept
 Move 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
 Conversion operator that provides a view of the current builder contents.
 
documentoperator= (document &&doc) noexcept
 Move assignment operator.
 
bsoncxx::v_noabi::document::view view () const
 
- Public Member Functions inherited from bsoncxx::v_noabi::builder::basic::sub_document
BSONCXX_ABI_NO_EXPORT void append ()
 Inductive base-case for the variadic append(...)
 
template<typename Arg , typename... Args>
void append (Arg &&a, Args &&... args)
 Appends multiple basic::kvp key-value pairs.
 

Constructor & Destructor Documentation

◆ document() [1/2]

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

Default constructor.

◆ document() [2/2]

bsoncxx::v_noabi::builder::basic::document::document ( document && doc)
inlinenoexcept

Move constructor.

Member Function Documentation

◆ clear()

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

Reset the underlying BSON to an empty document.

◆ extract()

bsoncxx::v_noabi::document::value bsoncxx::v_noabi::builder::basic::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 subsequently moved into.

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

bsoncxx::v_noabi::builder::basic::document::operator bsoncxx::v_noabi::document::view ( ) const
inline

Conversion operator that provides a view of the current builder contents.

Returns
A view of the current builder contents.

◆ operator=()

document & bsoncxx::v_noabi::builder::basic::document::operator= ( document && doc)
inlinenoexcept

Move assignment operator.

◆ view()

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

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