Menu

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
void print () const
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==
friend constexpr bool operator !=
friend constexpr bool operator<
Less than operator.
friend constexpr bool operator==
Equivalency operator.
friend constexpr bool operator !=
Inverted equivalency operator.
friend constexpr bool operator<
Less than operator.
friend DataStream & operator<<
Serialize a symbol_code.
friend DataStream & operator>>
Deserialize a symbol_code.

Detailed Description

the symbol code as a uint64_t value

Public Functions Documentation

function symbol_code (4/6)

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 (5/6)

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 (6/6)

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 (2/2)

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

Checks if the symbol code is valid

Returns:

true - if symbol is valid

function length (2/2)

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 (2/2)

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 (2/2)

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 (2/2)

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 (2/2)

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()

function print

void eosio::symbol_code::print() const

Prints a symbol_code

Parameters:

  • sym_code symbol code to be printed

function symbol_code (4/6)

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 (5/6)

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 (6/6)

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 (2/2)

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

Checks if the symbol code is valid

Returns:

true - if symbol is valid

function length (2/2)

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 (2/2)

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 (2/2)

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 (2/2)

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 (2/2)

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== (2/2)

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

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

Returns:

boolean - true if both provided symbol_codes are the same

friend operator != (2/2)

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

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

Returns:

boolean - true if both provided symbol_codes are not the same

friend operator< (2/2)

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

friend operator== (2/2)

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 != (2/2)

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< (2/2)

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

friend operator<<

template<typename DataStream>
DataStream& operator<<(
    DataStream & ds,
    const eosio::symbol_code sym_code
)

Serialize a symbol_code.

Serialize a symbol_code into a stream

Parameters:

  • ds - The stream to write
  • sym - The value to serialize

Template parameters:

  • DataStream - Type of datastream buffer

Returns:

DataStream& - Reference to the datastream

friend operator>>

template<typename DataStream>
DataStream& operator>>(
    DataStream & ds,
    eosio::symbol_code & sym_code
)

Deserialize a symbol_code.

Deserialize a symbol_code from a stream

Parameters:

  • ds - The stream to read
  • symbol - The destination for deserialized value

Template parameters:

  • DataStream - Type of datastream buffer

Returns:

DataStream& - Reference to the datastream


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