xentara-utils v1.2.1
Xentara utilities library
Loading...
Searching...
No Matches
xentara::utils::cbor::ExtendedDataType Class Referencefinal

A CBOR data type with additional information. More...

#include <cbor/DataType.hpp>

Public Member Functions

constexpr ExtendedDataType () noexcept=default
 Default constructor.
 
constexpr operator DataType () const noexcept
 Conversion to a fundamental data type.
 
constexpr auto dataType () const noexcept -> DataType
 Returns the fundamental data type.
 
constexpr auto bits () const noexcept -> int
 Returns the number of bits.
 

Detailed Description

A CBOR data type with additional information.

This class adds bit sizes to arithmetic data types (DataType::UnsignedInteger, DataType::NegativeInteger, DataType::FloatingPoint, and DataType::Boolean).

Constructor & Destructor Documentation

◆ ExtendedDataType()

constexpr xentara::utils::cbor::ExtendedDataType::ExtendedDataType ( )
constexprdefaultnoexcept

Default constructor.

Creates an object with type DataType::Null.

Member Function Documentation

◆ bits()

constexpr auto xentara::utils::cbor::ExtendedDataType::bits ( ) const -> int
constexprnoexcept

Returns the number of bits.

Returns

The number of bits, or 0 if the fundamental data type does not use bit sizes.

CBOR supports the following bit sizes for the different fundamental data types:

◆ dataType()

constexpr auto xentara::utils::cbor::ExtendedDataType::dataType ( ) const -> DataType
constexprnoexcept

Returns the fundamental data type.

◆ operator DataType()

constexpr xentara::utils::cbor::ExtendedDataType::operator DataType ( ) const
constexprnoexcept

Conversion to a fundamental data type.