MongoDB C++ Driver mongocxx-3.10.1
Loading...
Searching...
No Matches
Public Member Functions | List of all members
bsoncxx::v_noabi::types::bson_value::view Class Reference

A view-only variant that can contain any BSON type. More...

#include <view.hpp>

Public Member Functions

 view () noexcept
 Default constructs a bson_value::view.
 
bsoncxx::v_noabi::type type () const
 
const b_doubleget_double () const
 
const b_stringget_utf8 () const
 
const b_stringget_string () const
 
const b_documentget_document () const
 
const b_arrayget_array () const
 
const b_binaryget_binary () const
 
const b_undefinedget_undefined () const
 
const b_oidget_oid () const
 
const b_boolget_bool () const
 
const b_dateget_date () const
 
const b_nullget_null () const
 
const b_regexget_regex () const
 
const b_dbpointerget_dbpointer () const
 
const b_codeget_code () const
 
const b_symbolget_symbol () const
 
const b_codewscopeget_codewscope () const
 
const b_int32get_int32 () const
 
const b_timestampget_timestamp () const
 
const b_int64get_int64 () const
 
const b_decimal128get_decimal128 () const
 
const b_minkeyget_minkey () const
 
const b_maxkeyget_maxkey () const
 

Detailed Description

A view-only variant that can contain any BSON type.

Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

Constructor & Destructor Documentation

◆ view()

bsoncxx::v_noabi::types::bson_value::view::view ( )
noexcept

Default constructs a bson_value::view.

The resulting view will be initialized to point at a bson_value of type k_null.

Member Function Documentation

◆ get_array()

const b_array & bsoncxx::v_noabi::types::bson_value::view::get_array ( ) const
Returns
The underlying BSON array value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_binary()

const b_binary & bsoncxx::v_noabi::types::bson_value::view::get_binary ( ) const
Returns
The underlying BSON binary data value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_bool()

const b_bool & bsoncxx::v_noabi::types::bson_value::view::get_bool ( ) const
Returns
The underlying BSON boolean value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_code()

const b_code & bsoncxx::v_noabi::types::bson_value::view::get_code ( ) const
Returns
The underlying BSON JavaScript code value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_codewscope()

const b_codewscope & bsoncxx::v_noabi::types::bson_value::view::get_codewscope ( ) const
Returns
The underlying BSON JavaScript code with scope value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_date()

const b_date & bsoncxx::v_noabi::types::bson_value::view::get_date ( ) const
Returns
The underlying BSON date value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_dbpointer()

const b_dbpointer & bsoncxx::v_noabi::types::bson_value::view::get_dbpointer ( ) const
Returns
The underlying BSON DBPointer value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_decimal128()

const b_decimal128 & bsoncxx::v_noabi::types::bson_value::view::get_decimal128 ( ) const
Returns
The underlying BSON Decimal128 value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_document()

const b_document & bsoncxx::v_noabi::types::bson_value::view::get_document ( ) const
Returns
The underlying BSON document value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_double()

const b_double & bsoncxx::v_noabi::types::bson_value::view::get_double ( ) const
Returns
The underlying BSON double value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_int32()

const b_int32 & bsoncxx::v_noabi::types::bson_value::view::get_int32 ( ) const
Returns
The underlying BSON 32-bit signed integer value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_int64()

const b_int64 & bsoncxx::v_noabi::types::bson_value::view::get_int64 ( ) const
Returns
The underlying BSON 64-bit signed integer value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_maxkey()

const b_maxkey & bsoncxx::v_noabi::types::bson_value::view::get_maxkey ( ) const
Returns
The underlying BSON max-key value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_minkey()

const b_minkey & bsoncxx::v_noabi::types::bson_value::view::get_minkey ( ) const
Returns
The underlying BSON min-key value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_null()

const b_null & bsoncxx::v_noabi::types::bson_value::view::get_null ( ) const
Returns
The underlying BSON null value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_oid()

const b_oid & bsoncxx::v_noabi::types::bson_value::view::get_oid ( ) const
Returns
The underlying BSON ObjectId value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_regex()

const b_regex & bsoncxx::v_noabi::types::bson_value::view::get_regex ( ) const
Returns
The underlying BSON regex value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_string()

const b_string & bsoncxx::v_noabi::types::bson_value::view::get_string ( ) const
Returns
The underlying BSON UTF-8 string value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_symbol()

const b_symbol & bsoncxx::v_noabi::types::bson_value::view::get_symbol ( ) const
Returns
The underlying BSON symbol value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_timestamp()

const b_timestamp & bsoncxx::v_noabi::types::bson_value::view::get_timestamp ( ) const
Returns
The underlying BSON replication timestamp value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_undefined()

const b_undefined & bsoncxx::v_noabi::types::bson_value::view::get_undefined ( ) const
Returns
The underlying BSON undefined value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_utf8()

const b_string & bsoncxx::v_noabi::types::bson_value::view::get_utf8 ( ) const
Returns
The underlying BSON UTF-8 string value.
Deprecated:
use get_string instead.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ type()

bsoncxx::v_noabi::type bsoncxx::v_noabi::types::bson_value::view::type ( ) const
Returns
The type of the underlying BSON value stored in this object.

Friends And Related Symbol Documentation

◆ operator!=

bool operator!= ( const bson_value::view ,
const bson_value::view  
)
friend

Compare two bson_value::views for equality.

◆ operator==

bool operator== ( const bson_value::view ,
const bson_value::view  
)
friend

Compare two bson_value::views for equality.


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