class eosio::symbol

Class List > eosio :: symbol

Public Functions

Type Name
constexpr symbol ()
Construct a new symbol object defaulting to a value of 0.
constexpr symbol (uint64_t raw)
Construct a new symbol object initialising value with raw.
constexpr symbol (symbol_code sc, uint8_t precision)
Construct a new symbol object initialising value with a symbol maximum of 7 characters, packs the symbol and precision into the uint64_t value.
constexpr symbol (std::string_view ss, uint8_t precision)
Construct a new symbol object initialising value with a symbol maximum of 7 characters, packs the symbol and precision into the uint64_t value.
constexpr bool is_valid () const
constexpr uint8_t precision () const
constexpr symbol_code code () const
constexpr uint64_t raw () const
constexpr operator bool () const
void print (bool show_precision = true) const
Print the symbol

Friends

Type Name
friend constexpr bool operator==
Equivalency operator.
friend constexpr bool operator!=
Inverted equivalency operator.
friend constexpr bool operator<
Less than operator.

Public Functions Documentation

function symbol (1/4)

constexpr eosio::symbol::symbol()

Construct a new symbol object defaulting to a value of 0.

Default constructor, construct a new symbol

function symbol (2/4)

explicit constexpr eosio::symbol::symbol(
    uint64_t raw
)

Construct a new symbol object initialising value with raw.

Construct a new symbol given a scoped enumerated type of raw (uint64_t).

Parameters:

  • raw - The raw value which is a scoped enumerated type of unit64_t

function symbol (3/4)

constexpr eosio::symbol::symbol(
    symbol_code sc,
    uint8_t precision
)

Construct a new symbol object initialising value with a symbol maximum of 7 characters, packs the symbol and precision into the uint64_t value.

Construct a new symbol given a symbol_code and a uint8_t precision.

Parameters:

  • sc - The symbol_code
  • precision - The number of decimal places used for the symbol

function symbol (4/4)

constexpr eosio::symbol::symbol(
    std::string_view ss,
    uint8_t precision
)

Construct a new symbol object initialising value with a symbol maximum of 7 characters, packs the symbol and precision into the uint64_t value.

Construct a new symbol given a string and a uint8_t precision.

Parameters:

  • ss - The string containing the symbol
  • precision - The number of decimal places used for the symbol

function is_valid

constexpr bool eosio::symbol::is_valid() const

Is this symbol valid

function precision

constexpr uint8_t eosio::symbol::precision() const

This symbol's precision

function code

constexpr symbol_code eosio::symbol::code() const

Returns representation of symbol name

function raw

constexpr uint64_t eosio::symbol::raw() const

Returns uint64_t repreresentation of the symbol

function operator bool

explicit constexpr eosio::symbol::operator bool() const

function print

void eosio::symbol::print(
    bool show_precision = true
) const

Print the symbol

Print the symbol

Friends Documentation

friend operator==

constexpr bool operator==(
    const symbol & a,
    const symbol & b
)

Equivalency operator.

Equivalency operator. Returns true if a == b (are the same)

Returns:

boolean - true if both provided symbols are the same

friend operator!=

constexpr bool operator!=(
    const symbol & a,
    const symbol & b
)

Inverted equivalency operator.

Inverted equivalency operator. Returns true if a != b (are different)

Returns:

boolean - true if both provided symbols are not the same

friend operator<

constexpr bool operator<(
    const symbol & a,
    const symbol & b
)

Less than operator.

Less than operator. Returns true if a < b.

Returns:

boolean - true if symbol a is less than b


The documentation for this class was generated from the following file: libraries/eosiolib/symbol.hpp