4#include <sysio/chain/core_symbol.hpp>
20 static constexpr uint64_t string_to_symbol_c(
uint8_t precision,
const char* str) {
27 result |= (
uint64_t(str[i]) << (8*(1+i)));
34#define SY(P,X) ::sysio::chain::string_to_symbol_c(P,#X)
43 SYS_ASSERT (str[i] >=
'A' && str[i] <=
'Z', symbol_type_exception,
"invalid character in symbol name");
44 result |= (
uint64_t(str[i]) << (8*(i+1)));
72 SYS_ASSERT(!
s.empty(), symbol_type_exception,
"creating symbol from empty string");
73 auto comma_pos =
s.find(
',');
74 SYS_ASSERT(comma_pos != string::npos, symbol_type_exception,
"missing comma in symbol");
75 auto prec_part =
s.substr(0, comma_pos);
77 string name_part =
s.substr(comma_pos + 1);
79 return symbol(string_to_symbol(
p, name_part.c_str()));
85 const auto&
s =
name();
90 return all_of(
name.begin(),
name.end(), [](
char c)->bool { return (c >=
'A' && c <=
'Z'); });
130 template <
typename DataStream>
133 return ds <<
s.to_string();
#define SYS_ASSERT(expr, exc_type, FORMAT,...)
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
const string & get_string() const
friend DataStream & operator<<(DataStream &ds, const symbol &s)
symbol(uint64_t v=CORE_SYMBOL)
static bool valid_name(const string &name)
static constexpr uint8_t max_precision
void reflector_init() const
symbol(uint8_t p, const char *s)
symbol_code to_symbol_code() const
uint64_t precision() const
static symbol from_string(const string &from)
Defines exception's used by fc.
#define FC_CAPTURE_LOG_AND_RETHROW(...)
fc::string to_string(double)
void from_variant(const fc::variant &v, sysio::chain::chain_id_type &cid)
void to_variant(const sysio::chain::shared_public_key &var, fc::variant &vo)
fc::string trim(const fc::string &)
int64_t to_int64(const fc::string &)
bool operator<(const permission_level &lhs, const permission_level &rhs)
bool operator==(const permission_level &lhs, const permission_level &rhs)
bool operator!=(const permission_level &lhs, const permission_level &rhs)
bool operator>(const permission_level &lhs, const permission_level &rhs)
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
unsigned __int64 uint64_t
defines visit functions for T Unless this is specialized, visit() will not be defined for T.
Immutable except for fc::from_variant.