Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
sysio::chain::name Struct Reference

Immutable except for fc::from_variant. More...

#include <name.hpp>

Public Member Functions

constexpr bool empty () const
 
constexpr bool good () const
 
 name (std::string_view str)
 
constexpr name (uint64_t v)
 
constexpr name ()=default
 
std::string to_string () const
 
constexpr uint64_t to_uint64_t () const
 
constexpr operator bool () const
 

Friends

struct fc::reflector< name >
 
void fc::from_variant (const fc::variant &v, sysio::chain::name &check)
 
std::ostream & operator<< (std::ostream &out, const name &n)
 
constexpr bool operator< (const name &a, const name &b)
 
constexpr bool operator> (const name &a, const name &b)
 
constexpr bool operator<= (const name &a, const name &b)
 
constexpr bool operator>= (const name &a, const name &b)
 
constexpr bool operator== (const name &a, const name &b)
 
constexpr bool operator!= (const name &a, const name &b)
 
constexpr bool operator== (const name &a, uint64_t b)
 
constexpr bool operator!= (const name &a, uint64_t b)
 

Detailed Description

Definition at line 43 of file name.hpp.

Constructor & Destructor Documentation

◆ name() [1/3]

sysio::chain::name::name ( std::string_view str)
inlineexplicit

Definition at line 56 of file name.hpp.

56{ set( str ); }
bool set
Here is the caller graph for this function:

◆ name() [2/3]

sysio::chain::name::name ( uint64_t v)
inlineexplicitconstexpr

Definition at line 57 of file name.hpp.

57: value(v) {}

◆ name() [3/3]

sysio::chain::name::name ( )
constexprdefault

Member Function Documentation

◆ empty()

bool sysio::chain::name::empty ( ) const
inlineconstexpr

Definition at line 53 of file name.hpp.

53{ return 0 == value; }
Here is the caller graph for this function:

◆ good()

bool sysio::chain::name::good ( ) const
inlineconstexpr

Definition at line 54 of file name.hpp.

54{ return !empty(); }
constexpr bool empty() const
Definition name.hpp:53
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator bool()

sysio::chain::name::operator bool ( ) const
inlineexplicitconstexpr

Definition at line 77 of file name.hpp.

77{ return value != 0; }

◆ to_string()

std::string sysio::chain::name::to_string ( ) const

Definition at line 19 of file name.cpp.

19 {
20 static const char* charmap = ".12345abcdefghijklmnopqrstuvwxyz";
21
22 std::string str(13,'.');
23
24 uint64_t tmp = value;
25 for( uint32_t i = 0; i <= 12; ++i ) {
26 char c = charmap[tmp & (i == 0 ? 0x0f : 0x1f)];
27 str[12-i] = c;
28 tmp >>= (i == 0 ? 4 : 5);
29 }
30
31 boost::algorithm::trim_right_if( str, []( char c ){ return c == '.'; } );
32 return str;
33 }
return str
Definition CLI11.hpp:1359
unsigned int uint32_t
Definition stdint.h:126
unsigned __int64 uint64_t
Definition stdint.h:136
Here is the caller graph for this function:

◆ to_uint64_t()

uint64_t sysio::chain::name::to_uint64_t ( ) const
inlineconstexpr

Definition at line 61 of file name.hpp.

61{ return value; }
Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ fc::from_variant

void fc::from_variant ( const fc::variant & v,
sysio::chain::name & check )
friend

◆ fc::reflector< name >

friend struct fc::reflector< name >
friend

Definition at line 45 of file name.hpp.

◆ operator!= [1/2]

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

Definition at line 72 of file name.hpp.

72{ return a.value != b.value; }
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181

◆ operator!= [2/2]

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

Definition at line 75 of file name.hpp.

75{ return a.value != b; }

◆ operator<

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

Definition at line 67 of file name.hpp.

67{ return a.value < b.value; }

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const name & n )
friend

Definition at line 63 of file name.hpp.

63 {
64 return out << n.to_string();
65 }

◆ operator<=

bool operator<= ( const name & a,
const name & b )
friend

Definition at line 69 of file name.hpp.

69{ return a.value <= b.value; }

◆ operator== [1/2]

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

Definition at line 71 of file name.hpp.

71{ return a.value == b.value; }

◆ operator== [2/2]

bool operator== ( const name & a,
uint64_t b )
friend

Definition at line 74 of file name.hpp.

74{ return a.value == b; }

◆ operator>

bool operator> ( const name & a,
const name & b )
friend

Definition at line 68 of file name.hpp.

68{ return a.value > b.value; }

◆ operator>=

bool operator>= ( const name & a,
const name & b )
friend

Definition at line 70 of file name.hpp.

70{ return a.value >= b.value; }

The documentation for this struct was generated from the following files: