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

#include <bsoncxx/v_noabi/bsoncxx/decimal128.hpp>

Description

Represents an IEEE 754-2008 BSON Decimal128 value in a platform-independent way.

Public Member Functions

 decimal128 ()=default
 Constructs a BSON Decimal128 value representing zero.
 
 decimal128 (stdx::string_view str)
 Constructs a BSON Decimal128 from a string.
 
 decimal128 (uint64_t high, uint64_t low) noexcept
 Constructs a BSON Decimal128 from high and low 64-bit big-endian parts.
 
uint64_t high () const
 Accessor for high 64 bits.
 
uint64_t low () const
 Accessor for low 64 bits.
 
std::string to_string () const
 Converts this decimal128 value to a string representation.
 

Related Symbols

(Note that these are not member symbols.)

bool operator== (const decimal128 &lhs, const decimal128 &rhs)
 Relational operators for decimal128.
 
bool operator!= (const decimal128 &lhs, const decimal128 &rhs)
 Relational operators for decimal128.
 

Constructor & Destructor Documentation

◆ decimal128() [1/3]

bsoncxx::v_noabi::decimal128::decimal128 ( )
default

Constructs a BSON Decimal128 value representing zero.

◆ decimal128() [2/3]

bsoncxx::v_noabi::decimal128::decimal128 ( uint64_t high,
uint64_t low )
inlinenoexcept

Constructs a BSON Decimal128 from high and low 64-bit big-endian parts.

Parameters
highThe high 64-bits.
lowThe low 64-bits.

◆ decimal128() [3/3]

bsoncxx::v_noabi::decimal128::decimal128 ( stdx::string_view str)
explicit

Constructs a BSON Decimal128 from a string.

Parameters
strA string representation of a decimal number.
Exceptions
bsoncxx::v_noabi::exceptionif the string isn't a valid BSON Decimal128 representation.

Member Function Documentation

◆ high()

uint64_t bsoncxx::v_noabi::decimal128::high ( ) const
inline

Accessor for high 64 bits.

◆ low()

uint64_t bsoncxx::v_noabi::decimal128::low ( ) const
inline

Accessor for low 64 bits.

◆ to_string()

std::string bsoncxx::v_noabi::decimal128::to_string ( ) const

Converts this decimal128 value to a string representation.

Returns
A string representation of a IEEE 754-2008 decimal number.

Friends And Related Symbol Documentation

◆ operator!=

bool operator!= ( const decimal128 & lhs,
const decimal128 & rhs )
friend

Relational operators for decimal128.

◆ operator==

bool operator== ( const decimal128 & lhs,
const decimal128 & rhs )
friend

Relational operators for decimal128.


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