Menu

Class List > eosio :: name

wraps a uint64_t to ensure it is only passed to methods that expect a Name More...

Public Types

Type Name
enum raw { }

Public Attributes

Type Name
uint64_t value

Public Functions

Type Name
constexpr name ()
constexpr name (uint64_t v)
constexpr name (name::raw r)
constexpr name (std::string_view str)
constexpr uint8_t length () const
constexpr name suffix () const
constexpr operator raw () const
constexpr operator bool () const
char * write_as_string (char * begin, char * end) const
Writes the name as a string to the provided char buffer.
std::string to_string () const

Public Static Functions

Type Name
static constexpr uint8_t char_to_value (char c)
Converts a (eosio::name style) Base32 symbol into its corresponding value.

Friends

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

Detailed Description

Wraps a uint64_t to ensure it is only passed to methods that expect a Name and that no mathematical operations occur. It also enables specialization of print so that it is printed as a base32 string.

Public Types Documentation

enum raw

enum eosio::name::raw {
};

Public Attributes Documentation

variable value

uint64_t eosio::name::value;

Public Functions Documentation

function name (1/4)

constexpr eosio::name::name()

function name (2/4)

explicit constexpr eosio::name::name(
    uint64_t v
)

function name (3/4)

explicit constexpr eosio::name::name(
    name::raw r
)

function name (4/4)

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

function length

constexpr uint8_t eosio::name::length() const

Returns the length of the name

function suffix

constexpr name eosio::name::suffix() const

Returns the suffix of the name

function operator raw

constexpr eosio::name::operator raw() const

function operator bool

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

function write_as_string

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

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

Writes the name as a string to the provided char buffer

Precondition:

Appropriate Size Precondition: (begin + 13) <= end and (begin + 13) 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 name.

function to_string

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

Public Static Functions Documentation

function char_to_value

static static constexpr uint8_t eosio::name::char_to_value(
    char c
)

Converts a (eosio::name style) Base32 symbol into its corresponding value.

Converts a (eosio::name style) Base32 symbol into its corresponding value

Parameters:

  • c - Character to be converted

Returns:

constexpr char - Converted value

Friends Documentation

friend operator==

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

Equivalency operator.

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

Returns:

boolean - true if both provided names are the same

friend operator!=

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

Inverted equivalency operator.

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

Returns:

boolean - true if both provided names are not the same

friend operator<

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

Less than operator.

Less than operator. Returns true if a < b.

Returns:

boolean - true if name a is less than b


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