Menu

Defines CPP API for managing symbols.

Classes

Type Name
class eosio::symbol_code
class eosio::symbol
class eosio::extended_symbol
struct Stores
Stores the symbol code.
struct Extended

Variables

Type Name
uint64_t value
uint64_t value
symbol symbol
the symbol
name contract
the token contract hosting the symbol

Functions

Variables Documentation

variable value

uint64_t eosio::symbol_code::value;

variable value

uint64_t eosio::symbol::value;

variable symbol

symbol eosio::extended_symbol::symbol;

the symbol

variable contract

name eosio::extended_symbol::contract;

the token contract hosting the symbol

Functions Documentation

function symbol_code

constexpr eosio::symbol_code::symbol_code()

function symbol_code

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

function symbol_code

explicit constexpr eosio::symbol_code::symbol_code(
    std::string_view str
)

function is_valid

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

Checks if the symbol code is valid

Returns:

true - if symbol is valid

function length

constexpr uint32_t eosio::symbol_code::length() const

Returns the character length of the provided symbol

Returns:

length - character length of the provided symbol

function raw

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

function operator bool

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

function write_as_string

char* eosio::symbol_code::write_as_string(
    char * begin,
    char * end
) const

Writes the symbol_code as a string to the provided char buffer.

Writes the symbol_code as a string to the provided char buffer

Precondition:

Appropriate Size Precondition: (begin + 7) <= end and (begin + 7) does not overflow

Precondition:

Valid Memory Region Precondition: The range [begin, end) must be a valid range of memory to write to.

Parameters:

  • begin - The start of the char buffer
  • end - Just past the end of the char buffer

Returns:

char* - Just past the end of the last character written (returns begin if the Appropriate Size Precondition is not satisfied)

Post

If the Appropriate Size Precondition is satisfied, the range [begin, returned pointer) contains the string representation of the symbol_code.

function to_string

std::string eosio::symbol_code::to_string() const

function symbol

constexpr eosio::symbol::symbol()

function symbol

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

function symbol

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

function symbol

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

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

function extended_symbol

constexpr eosio::extended_symbol::extended_symbol()

function extended_symbol

constexpr eosio::extended_symbol::extended_symbol(
    symbol sym,
    name con
)

function get_symbol

constexpr symbol eosio::extended_symbol::get_symbol() const

function get_contract

constexpr name eosio::extended_symbol::get_contract() const

function print

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

Print the extended symbol

Print the extended symbol