3#include <boost/algorithm/string.hpp>
9 void name::set( std::string_view str ) {
10 const auto len =
str.size();
11 SYS_ASSERT(
len <= 13, name_type_exception,
"Name is longer than 13 characters (${name}) ", (
"name", std::string(str)));
14 "Name not properly normalized (name: ${name}, normalized: ${normalized}) ",
15 (
"name", std::string(str))(
"normalized",
to_string()));
20 static const char* charmap =
".12345abcdefghijklmnopqrstuvwxyz";
22 std::string str(13,
'.');
25 for(
uint32_t i = 0; i <= 12; ++i ) {
26 char c = charmap[tmp & (i == 0 ? 0x0f : 0x1f)];
28 tmp >>= (i == 0 ? 4 : 5);
31 boost::algorithm::trim_right_if( str, [](
char c ){
return c ==
'.'; } );
#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
Defines exception's used by fc.
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)
constexpr uint64_t string_to_uint64_t(std::string_view str)
unsigned __int64 uint64_t
Immutable except for fc::from_variant.
std::string to_string() const