class eosio::symbol_code

Class List > eosio :: symbol_code

Public Functions

Type Name
constexpr symbol_code ()
Construct a new symbol_code object defaulting to a value of 0.
constexpr symbol_code (uint64_t raw)
Construct a new symbol_code object initialising value with raw.
constexpr symbol_code (std::string_view str)
Construct a new symbol_code object initialising value with str.
constexpr bool is_valid () const
constexpr uint32_t length () const
constexpr uint64_t raw () const
constexpr operator bool () const
char * write_as_string (char * begin, char * end) const
Writes the symbol_code as a string to the provided char buffer.
std::string to_string () const
Returns the name value as a string by calling write_as_string() and returning the buffer produced by write_as_string()

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_code (1/3)

constexpr eosio::symbol_code::symbol_code()

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

Default constructor, construct a new symbol_code

function symbol_code (2/3)

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

Construct a new symbol_code object initialising value with raw.

Construct a new symbol_code 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_code (3/3)

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

Construct a new symbol_code object initialising value with str.

Construct a new symbol_code given an string.

Parameters:

  • str - The string value which validated then converted to unit64_t

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

Casts a symbol code to raw

Returns:

Returns an instance of raw based on the value of a symbol_code

function operator bool

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

Explicit cast to bool of the symbol_code

Returns:

Returns true if the symbol_code is set to the default value of 0 else true.

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

Returns the name value as a string by calling write_as_string() and returning the buffer produced by write_as_string()

Returns the symbol_code as a string.

Friends Documentation

friend operator==

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

Equivalency operator.

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

Returns:

boolean - true if both provided symbol_codes are the same

friend operator!=

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

Inverted equivalency operator.

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

Returns:

boolean - true if both provided symbol_codes are not the same

friend operator<

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

Less than operator.

Less than operator. Returns true if a < b.

Returns:

boolean - true if symbol_code a is less than b


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