Loading...
Searching...
No Matches
bsoncxx::v1::types Namespace Reference

## Description

Declares entities representing a BSON type value.

Note
  A "BSON type value" refers to the value of a BSON element without its key.

## Classes

struct | b_array
| BSON type value "Array". More...
struct | b_binary
| BSON type value "Binary Data". More...
struct | b_bool
| BSON type value "Boolean". More...
struct | b_code
| BSON type value "JavaScript Code". More...
struct | b_codewscope
| BSON type value "JavaScript Code With Scope". More...
struct | b_date
| BSON type value "UTC Datetime". More...
struct | b_dbpointer
| BSON type value "DBPointer". More...
struct | b_decimal128
| BSON type value "Decimal128". More...
struct | b_document
| BSON type value "Embedded Document". More...
struct | b_double
| BSON type value "64-bit Binary Floating Point". More...
struct | b_int32
| BSON type value "32-bit Integer". More...
struct | b_int64
| BSON type value "64-bit Integer". More...
struct | b_maxkey
| BSON type value "Max Key". More...
struct | b_minkey
| BSON type value "Min Key". More...
struct | b_null
| BSON type value "Null Value". More...
struct | b_oid
| BSON type value "ObjectID". More...
struct | b_regex
| BSON type value "Regular Expression". More...
struct | b_string
| BSON type value "UTF-8 String". More...
struct | b_symbol
| BSON type value "Symbol". More...
struct | b_timestamp
| BSON type value "Timestamp". More...
struct | b_undefined
| BSON type value "Undefined (Value)". More...
class | value
| A union of BSON type values. More...
class | view
| A non-owning, read-only union of BSON type values. More...

## Enumerations

enum class | binary_subtype : std::uint8_t
| Enumeration identifying a BSON binary subtype. More...
enum class | id : std::int8_t
| Enumeration identifying a BSON type. More...

## Functions

std::string | to_string (binary_subtype rhs)
| Return the name of the enumerator (e.g. "binary" given k_binary).
std::string | to_string (id rhs)
| Return the name of the enumerator (e.g. "double" given k_double).

## Enumeration Type Documentation

## binary_subtype

enum class bsoncxx::v1::types::binary_subtype : std::uint8_t

strong

Enumeration identifying a BSON binary subtype.

Enumerator
k_binary | 0x00 | Generic binary subtype.
k_function | 0x01 | Function.

k_binary_deprecated

0x02

Binary (Old).

Deprecated

k_uuid_deprecated

0x03

UUID (Old).

Deprecated

k_uuid | 0x04 | UUID.
k_md5 | 0x05 | MD5.
k_encrypted | 0x06 | Encrypted BSON value.
k_column | 0x07 | Compressed BSON column.
k_sensitive | 0x08 | Sensitive.
k_vector | 0x09 | Vector.
k_user | 0x80 | User defined (up to 0xFF, inclusive).

## id

enum class bsoncxx::v1::types::id : std::int8_t

strong

Enumeration identifying a BSON type.

Enumerator
k_minkey | -0x01 | Min key.
k_double | 0x01 | 64-bit binary floating point.
k_string | 0x02 | UTF-8 string.
k_document | 0x03 | Embedded document.
k_array | 0x04 | Array.
k_binary | 0x05 | Binary data.

k_undefined

0x06

Undefined value.

Deprecated

k_oid | 0x07 | ObjectId.
k_bool | 0x08 | Boolean.
k_date | 0x09 | UTC datetime.
k_null | 0x0A | Null value.
k_regex | 0x0B | Regular expression.

k_dbpointer

0x0C

DBPointer.

Deprecated

k_code | 0x0D | JavaScript code.

k_symbol

0x0E

Symbol.

Deprecated

k_codewscope

0x0F

JavaScript code with scope.

Deprecated

k_int32 | 0x10 | 32-bit integer.
k_timestamp | 0x11 | Timestamp.
k_int64 | 0x12 | 64-bit integer.
k_decimal128 | 0x13 | 128-bit decimal floating point.
k_maxkey | 0x7F | Max key.

## Function Documentation

## to_string() [1/2]

std::string bsoncxx::v1::types::to_string | ( | binary_subtype | rhs | ) |

Return the name of the enumerator (e.g. "binary" given k_binary).

Note
  Values in the range [0x80, 0xFF] are all equivalent to "k_user".

## to_string() [2/2]

std::string bsoncxx::v1::types::to_string | ( | id | rhs | ) |

Return the name of the enumerator (e.g. "double" given k_double).