Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
fc Namespace Reference

namespace sysio::chain More...

Namespaces

namespace  crypto
 
namespace  detail
 
namespace  ecc
 
namespace  em
 
namespace  equihash
 
namespace  ip
 
namespace  json_relaxed
 
namespace  persistence_util
 
namespace  raw
 
namespace  rpc
 
namespace  tracked
 

Classes

class  actor
 
class  aes_decoder
 
class  aes_encoder
 
struct  aligned
 
class  api
 
class  api_base
 
class  api_connection
 
class  appender
 
struct  appender_config
 
class  appender_factory
 
class  array
 
class  array< char, N >
 
class  array< unsigned char, N >
 
class  bigint
 
class  binary_api_connection
 
struct  blake2b_state
 
class  blake2b_wrapper
 
struct  blob
 
class  bloom_filter
 
class  bloom_parameters
 
class  blowfish
 
class  buffered_istream
 Reads data from an unbuffered stream and enables peek functionality. More...
 
class  buffered_ostream
 
class  cfile
 
class  cfile_datastream
 
class  comma_numpunct
 
class  console_appender
 
class  datastream
 
class  datastream< Container, typename std::enable_if_t<(std::is_same_v< std::vector< char >, Container >||std::is_same_v< std::deque< char >, Container >)> >
 
class  datastream< fc::cfile, void >
 
class  datastream< size_t, void >
 
class  datastream< Streambuf, typename std::enable_if_t< std::is_base_of_v< std::streambuf, Streambuf > > >
 
class  datastream< T, std::enable_if_t< std::is_same_v< T, char * >||std::is_same_v< T, const char * >||std::is_same_v< T, const unsigned char * > > >
 
struct  deduce
 
struct  deduce< const T & >
 
struct  deduce< const T && >
 
struct  deduce< T & >
 
struct  deduce< T && >
 
struct  device_adaptor
 
struct  diffie_hellman
 
class  directory_iterator
 
class  dmlog_appender
 
class  enum_type
 
class  exception
 Used to generate a useful error report when an exception is thrown. More...
 
class  exception_factory
 
struct  false_type
 
class  file_mapping
 
class  fixed_string
 
struct  from_static_variant
 
class  from_variant_visitor
 
class  fwd
 Used to forward declare value types. More...
 
class  gelf_appender
 
class  generic_api
 
struct  get_typename
 
struct  get_typename< __int128 >
 
struct  get_typename< bool >
 
struct  get_typename< char >
 
struct  get_typename< double >
 
struct  get_typename< fc::array< T, N > >
 
struct  get_typename< fc::exception >
 
struct  get_typename< flat_set< T > >
 
struct  get_typename< float >
 
struct  get_typename< int16_t >
 
struct  get_typename< int32_t >
 
struct  get_typename< int64_t >
 
struct  get_typename< int8_t >
 
struct  get_typename< path >
 
struct  get_typename< signed_int >
 
struct  get_typename< std::deque< T > >
 
struct  get_typename< std::map< K, V > >
 
struct  get_typename< std::optional< T > >
 
struct  get_typename< std::vector< char > >
 
struct  get_typename< std::vector< T > >
 
struct  get_typename< string >
 
struct  get_typename< uint160_t >
 
struct  get_typename< uint16_t >
 
struct  get_typename< uint32_t >
 
struct  get_typename< uint64_t >
 
struct  get_typename< uint8_t >
 
struct  get_typename< unsigned __int128 >
 
struct  get_typename< unsigned_int >
 
struct  get_typename< value >
 
struct  get_typename< void >
 
struct  has_reflector_init
 
class  hmac
 
class  http_client
 
class  http_client_impl
 
struct  identity_member
 
struct  if_enum
 
struct  if_enum< fc::true_type >
 
class  iobuffer
 
class  iprocess
 abstract interface for interacting with external processes More...
 
struct  is_class
 
struct  is_tuple
 
class  json
 
class  local_api_connection
 
class  local_binary_api_connection
 
struct  log_config
 
class  log_context
 provides information about where and when a log message was generated. More...
 
class  log_level
 
class  log_message
 aggregates a message along with the context and associated meta-information. More...
 
class  logger
 
struct  logger_config
 
struct  logging_config
 
class  mapped_region
 
class  mb_datastream
 
class  mb_peek_datastream
 
class  message_buffer
 abstraction for a message buffer that spans a chain of physical buffers More...
 
class  microseconds
 
class  mmap_struct
 A struct that has been mapped from a file. More...
 
class  mock_time_traits
 mock out fc::time_point::now() and provide a mock deadline timer More...
 
class  mutable_variant_object
 An order-preserving dictionary of variants. More...
 
class  noncopyable
 
class  optional_delegate
 
class  optional_delegate< R(Args...)>
 
struct  optional_trace
 
struct  overloaded
 
class  path
 wraps boost::filesystem::path to provide platform independent path manipulation. More...
 
class  private_key
 
class  process
 start and manage an local process More...
 
class  public_key
 
class  real128
 
class  recursive_directory_iterator
 
struct  reflect_init
 
struct  reflector
 defines visit functions for T Unless this is specialized, visit() will not be defined for T. More...
 
struct  reflector_init_visitor
 
struct  remove_reference
 
struct  remove_reference< T & >
 
struct  remove_reference< T && >
 
class  ripemd160
 
struct  safe
 
struct  sblock
 
class  scoped_exit
 
class  sha1
 
class  sha224
 
class  sha256
 
class  sha3
 
struct  sha3_impl
 
class  sha512
 
struct  signed_int
 serializes a 32 bit signed interger in as few bytes as possible More...
 
class  simple_lock_file
 
class  size_stream
 
struct  ssl_bignum
 
struct  ssl_wrapper
 
class  std_exception_wrapper
 wrapper for std::exception More...
 
class  temp_directory
 
class  temp_file
 
class  temp_file_base
 
class  time_point
 
class  time_point_sec
 
struct  to_static_variant
 
class  to_variant_visitor
 
class  tracked_storage
 tracks the size of storage allocated to its underlying multi_index More...
 
struct  true_type
 
struct  tuple
 
struct  tuple<>
 
class  udp_socket
 
class  udt_epoll_service
 
class  uint128
 an implementation of 128 bit unsigned integer More...
 
class  unhandled_exception
 re-thrown whenever an unhandled exception is caught.Any exceptions thrown by 3rd party libraries that are not caught get wrapped in an unhandled_exception exception. More...
 
class  unique_ptr
 
struct  unsigned_int
 
class  url
 
class  variant
 stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's. More...
 
class  variant_object
 An order-preserving dictionary of variants. More...
 
class  variant_stream
 
class  vector
 
struct  visitor
 
struct  vtable
 
struct  vtable_copy_visitor
 
class  zipkin
 
class  zipkin_config
 
struct  zipkin_span
 
struct  zipkin_trace
 

Typedefs

typedef boost::any any
 
typedef uint32_t api_id_type
 
typedef std::shared_ptr< api_baseapi_ptr
 
using bytes = std::vector<char>
 
typedef hmac< fc::sha224hmac_sha224
 
typedef hmac< fc::sha256hmac_sha256
 
typedef hmac< fc::sha512hmac_sha512
 
typedef bytes signature
 
typedef ripemd160 uint160_t
 
typedef ripemd160 uint160
 
typedef sha256 uint256
 
typedef fc::sha512 uint512
 
typedef std::shared_ptr< exceptionexception_ptr
 
typedef std::optional< exceptionoexception
 
typedef std::shared_ptr< iprocessiprocess_ptr
 
typedef std::shared_ptr< processprocess_ptr
 
typedef std::shared_ptr< buffered_istreambuffered_istream_ptr
 
typedef std::shared_ptr< buffered_ostreambuffered_ostream_ptr
 
typedef std::vector< log_messagelog_messages
 
typedef boost::asio::basic_deadline_timer< boost::posix_time::ptime, mock_time_traitsmock_deadline_timer
 
typedef std::optional< fc::stringostring
 
typedef std::optional< fc::pathopath
 
typedef std::optional< fc::variant_objectovariant_object
 
typedef std::string string
 
typedef std::optional< time_pointotime_point
 
typedef decltype(nullptr) nullptr_t
 
using yield_function_t = optional_delegate<void()>
 
template<size_t Size>
using UInt
 
template<size_t Size>
using Int
 
typedef std::vector< fc::variantvariants
 
typedef std::optional< variantovariant
 
typedef const char * const_char_ptr
 
using Scalar = libff::bigint<libff::alt_bn128_q_limbs>
 
typedef boost::multiprecision::uint128_t m128
 
typedef const variant_objectconst_variant_object_ptr
 
typedef const variantsconst_variants_ptr
 
typedef const blobconst_blob_ptr
 
typedef const stringconst_string_ptr
 
using params = sysio::chain_apis::account_query_db::get_accounts_by_authorizers_params
 

Enumerations

enum class  alt_bn128_error : int32_t {
  operand_component_invalid , operand_not_in_curve , pairing_list_size_error , operand_outside_g2 ,
  input_len_error , invalid_scalar_size
}
 
enum class  blake2b_error : int32_t { input_len_error }
 
enum class  k1_recover_error : int32_t { init_error , input_error , invalid_signature , recover_error }
 
enum class  modular_arithmetic_error : int32_t { modulus_len_zero }
 
enum  exception_code {
  unspecified_exception_code = 0 , unhandled_exception_code = 1 , timeout_exception_code = 2 , file_not_found_exception_code = 3 ,
  parse_error_exception_code = 4 , invalid_arg_exception_code = 5 , key_not_found_exception_code = 6 , bad_cast_exception_code = 7 ,
  out_of_range_exception_code = 8 , canceled_exception_code = 9 , assert_exception_code = 10 , eof_exception_code = 11 ,
  std_exception_code = 13 , invalid_operation_exception_code = 14 , unknown_host_exception_code = 15 , null_optional_code = 16 ,
  udt_error_code = 17 , aes_error_code = 18 , overflow_code = 19 , underflow_code = 20 ,
  divide_by_zero_code = 21
}
 
enum  mode_t { read_only , write_only , read_write }
 

Functions

void to_variant (const sysio::chain::shared_public_key &var, fc::variant &vo)
 
void to_variant (const sysio::chain::chain_id_type &cid, fc::variant &v)
 
void from_variant (const fc::variant &v, sysio::chain::chain_id_type &cid)
 
template<typename ST , typename T >
datastream< ST > & operator<< (datastream< ST > &s, const sysio::chain::may_not_exist< T > &v)
 
template<typename ST , typename T >
datastream< ST > & operator>> (datastream< ST > &s, sysio::chain::may_not_exist< T > &v)
 
template<typename T >
void to_variant (const sysio::chain::may_not_exist< T > &e, fc::variant &v)
 
template<typename T >
void from_variant (const fc::variant &v, sysio::chain::may_not_exist< T > &e)
 
void to_variant (const sysio::chain::asset &var, fc::variant &vo)
 
void from_variant (const fc::variant &var, sysio::chain::asset &vo)
 
void from_variant (const fc::variant &var, sysio::chain::extended_asset &vo)
 
template<uint16_t IntervalMs, uint64_t EpochMs>
void to_variant (const sysio::chain::block_timestamp< IntervalMs, EpochMs > &t, fc::variant &v)
 
template<uint16_t IntervalMs, uint64_t EpochMs>
void from_variant (const fc::variant &v, sysio::chain::block_timestamp< IntervalMs, EpochMs > &t)
 
template<typename OidType >
void to_variant (const chainbase::oid< OidType > &oid, variant &v)
 
template<typename OidType >
void from_variant (const variant &v, chainbase::oid< OidType > &oid)
 
void float64_to_double (const float64_t &f, double &d)
 
void double_to_float64 (const double &d, float64_t &f)
 
void float128_to_uint128 (const float128_t &f, sysio::chain::uint128_t &u)
 
void uint128_to_float128 (const sysio::chain::uint128_t &u, float128_t &f)
 
void to_variant (const float64_t &f, variant &v)
 
void from_variant (const variant &v, float64_t &f)
 
void to_variant (const float128_t &f, variant &v)
 
void from_variant (const variant &v, float128_t &f)
 
void to_variant (const sysio::chain::shared_string &s, variant &v)
 
void from_variant (const variant &v, sysio::chain::shared_string &s)
 
void to_variant (const sysio::chain::shared_blob &b, variant &v)
 
void from_variant (const variant &v, sysio::chain::shared_blob &b)
 
void to_variant (const blob &b, variant &v)
 
void from_variant (const variant &v, blob &b)
 
template<typename T >
void to_variant (const sysio::chain::shared_vector< T > &sv, variant &v)
 
template<typename T >
void from_variant (const variant &v, sysio::chain::shared_vector< T > &sv)
 
void to_variant (const sysio::chain::name &c, fc::variant &v)
 
void from_variant (const fc::variant &v, sysio::chain::name &check)
 
void to_variant (const sysio::chain::symbol &var, fc::variant &vo)
 
void from_variant (const fc::variant &var, sysio::chain::symbol &vo)
 
void to_variant (const sysio::chain::symbol_code &var, fc::variant &vo)
 
void from_variant (const fc::variant &var, sysio::chain::symbol_code &vo)
 
std::size_t hash_value (const fc::sha256 &v)
 
template<typename T , size_t N>
bool operator== (const array< T, N > &a, const array< T, N > &b)
 
template<typename T , size_t N>
bool operator< (const array< T, N > &a, const array< T, N > &b)
 
template<typename T , size_t N>
bool operator> (const array< T, N > &a, const array< T, N > &b)
 
template<typename T , size_t N>
bool operator!= (const array< T, N > &a, const array< T, N > &b)
 
template<typename T , size_t N>
void to_variant (const array< T, N > &bi, variant &v)
 
template<typename T , size_t N>
void from_variant (const variant &v, array< T, N > &bi)
 
uint64_t endian_reverse_u64 (uint64_t x)
 
uint32_t endian_reverse_u32 (uint32_t x)
 
bloom_filter operator& (const bloom_filter &a, const bloom_filter &b)
 
bloom_filter operator| (const bloom_filter &a, const bloom_filter &b)
 
bloom_filter operator^ (const bloom_filter &a, const bloom_filter &b)
 
std::string smaz_compress (const std::string &in)
 
std::string smaz_decompress (const std::string &compressed)
 
string zlib_compress (const string &in)
 
template<typename T , typename... U>
void to_variant (const boost::container::vector< T, U... > &vec, fc::variant &vo)
 
template<typename T , typename... U>
void from_variant (const fc::variant &v, boost::container::vector< T, U... > &vec)
 
template<typename... U>
void to_variant (const boost::container::vector< char, U... > &vec, fc::variant &vo)
 
template<typename... U>
void from_variant (const fc::variant &v, boost::container::vector< char, U... > &vec)
 
template<typename T , typename... U>
void to_variant (const flat_set< T, U... > &s, fc::variant &vo)
 
template<typename T , typename... U>
void from_variant (const fc::variant &v, flat_set< T, U... > &s)
 
template<typename T , typename... U>
void to_variant (const flat_multiset< T, U... > &s, fc::variant &vo)
 
template<typename T , typename... U>
void from_variant (const fc::variant &v, flat_multiset< T, U... > &s)
 
template<typename K , typename V , typename... U>
void to_variant (const flat_map< K, V, U... > &m, fc::variant &vo)
 
template<typename K , typename V , typename... U>
void from_variant (const variant &v, flat_map< K, V, U... > &m)
 
template<typename K , typename V , typename... U>
void to_variant (const flat_multimap< K, V, U... > &m, fc::variant &vo)
 
template<typename K , typename V , typename... U>
void from_variant (const variant &v, flat_multimap< K, V, U... > &m)
 
unsigned aes_encrypt (unsigned char *plaintext, int plaintext_len, unsigned char *key, unsigned char *iv, unsigned char *ciphertext)
 
unsigned aes_decrypt (unsigned char *ciphertext, int ciphertext_len, unsigned char *key, unsigned char *iv, unsigned char *plaintext)
 
unsigned aes_cfb_decrypt (unsigned char *ciphertext, int ciphertext_len, unsigned char *key, unsigned char *iv, unsigned char *plaintext)
 
std::vector< char > aes_encrypt (const fc::sha512 &key, const std::vector< char > &plain_text)
 
std::vector< char > aes_decrypt (const fc::sha512 &key, const std::vector< char > &cipher_text)
 
void aes_save (const fc::path &file, const fc::sha512 &key, std::vector< char > plain_text)
 
std::vector< char > aes_load (const fc::path &file, const fc::sha512 &key)
 
std::variant< alt_bn128_error, bytesalt_bn128_add (const bytes &op1, const bytes &op2)
 
std::variant< alt_bn128_error, bytesalt_bn128_mul (const bytes &g1_point, const bytes &scalar)
 
std::variant< alt_bn128_error, bool > alt_bn128_pair (const bytes &g1_g2_pairs, const yield_function_t &yield)
 
std::vector< char > from_base32 (const fc::string &b32)
 
fc::string to_base32 (const std::vector< char > &vec)
 
fc::string to_base32 (const char *data, size_t len)
 
std::vector< char > from_base36 (const fc::string &b36)
 
fc::string to_base36 (const std::vector< char > &vec)
 
fc::string to_base36 (const char *data, size_t len)
 
std::string to_base58 (const char *d, size_t s, const fc::yield_function_t &yield)
 
std::string to_base58 (const std::vector< char > &data, const fc::yield_function_t &yield)
 
std::vector< char > from_base58 (const std::string &base58_str)
 
size_t from_base58 (const std::string &base58_str, char *out_data, size_t out_data_len)
 
std::string base64_encode (unsigned char const *bytes_to_encode, unsigned int in_len)
 
std::string base64_encode (char const *bytes_to_encode, unsigned int in_len)
 
std::string base64_encode (const std::string &enc)
 
std::string base64_decode (const std::string &encoded_string)
 
std::string base64url_encode (unsigned char const *bytes_to_encode, unsigned int in_len)
 
std::string base64url_encode (char const *bytes_to_encode, unsigned int in_len)
 
std::string base64url_encode (const std::string &enc)
 
std::string base64url_decode (const std::string &encoded_string)
 
void to_variant (const bigint &bi, variant &v)
 
void from_variant (const variant &v, bigint &bi)
 
std::variant< blake2b_error, bytesblake2b (uint32_t _rounds, const bytes &_h, const bytes &_m, const bytes &_t0_offset, const bytes &_t1_offset, bool _f, const yield_function_t &yield)
 
uint64_t city_hash64 (const char *buf, size_t len)
 
uint32_t city_hash32 (const char *buf, size_t len)
 
size_t city_hash_size_t (const char *buf, size_t len)
 
uint128 city_hash128 (const char *s, size_t len)
 
uint64_t city_hash_crc_64 (const char *buf, size_t len)
 
uint128 city_hash_crc_128 (const char *s, size_t len)
 
array< uint64_t, 4 > city_hash_crc_256 (const char *s, size_t len)
 
template<typename T >
fc::sha256 digest (const T &value)
 
void to_variant (const ecc::private_key &var, variant &vo)
 
void from_variant (const variant &var, ecc::private_key &vo)
 
void to_variant (const ecc::public_key &var, variant &vo)
 
void from_variant (const variant &var, ecc::public_key &vo)
 
void to_variant (const em::private_key &var, variant &vo)
 
void from_variant (const variant &var, em::private_key &vo)
 
void to_variant (const em::public_key &var, variant &vo)
 
void from_variant (const variant &var, em::public_key &vo)
 
void to_variant (const crypto::r1::private_key &var, variant &vo)
 
void from_variant (const variant &var, crypto::r1::private_key &vo)
 
void to_variant (const crypto::r1::public_key &var, variant &vo)
 
void from_variant (const variant &var, crypto::r1::public_key &vo)
 
uint8_t from_hex (char c)
 
fc::string to_hex (const char *d, uint32_t s)
 
std::string to_hex (const std::vector< char > &data)
 
size_t from_hex (const fc::string &hex_str, char *out_data, size_t out_data_len)
 
std::variant< k1_recover_error, bytesk1_recover (const bytes &signature, const bytes &digest)
 
std::variant< modular_arithmetic_error, bytesmodexp (const bytes &_base, const bytes &_exponent, const bytes &_modulus)
 
void generate_key_pair (public_key &pub, private_key &priv)
 
bool operator== (const private_key &a, const private_key &b)
 
void to_variant (const public_key &bi, variant &v)
 
void from_variant (const variant &v, public_key &bi)
 
void to_variant (const private_key &bi, variant &v)
 
void from_variant (const variant &v, private_key &bi)
 
void to_variant (const crypto::private_key &var, variant &vo, const fc::yield_function_t &yield=fc::yield_function_t())
 
void from_variant (const variant &var, crypto::private_key &vo)
 
void to_variant (const crypto::public_key &var, variant &vo, const fc::yield_function_t &yield=fc::yield_function_t())
 
void from_variant (const variant &var, crypto::public_key &vo)
 
void rand_bytes (char *buf, int count)
 
void rand_pseudo_bytes (char *buf, int count)
 
void to_variant (const ripemd160 &bi, variant &v)
 
void from_variant (const variant &v, ripemd160 &bi)
 
void to_variant (const sha1 &bi, variant &v)
 
void from_variant (const variant &v, sha1 &bi)
 
void to_variant (const sha224 &bi, variant &v)
 
void from_variant (const variant &v, sha224 &bi)
 
void to_variant (const sha256 &bi, variant &v)
 
void from_variant (const variant &v, sha256 &bi)
 
uint64_t hash64 (const char *buf, size_t len)
 
void to_variant (const sha3 &bi, variant &v)
 
void from_variant (const variant &v, sha3 &bi)
 
void to_variant (const sha512 &bi, variant &v)
 
void from_variant (const variant &v, sha512 &bi)
 
void to_variant (const crypto::signature &var, variant &vo, const fc::yield_function_t &yield=fc::yield_function_t())
 
void from_variant (const variant &var, crypto::signature &vo)
 
void to_variant (const exception &e, variant &v)
 
void from_variant (const variant &e, exception &ll)
 
template<typename T >
fc::exception_ptr copy_exception (T &&e)
 
 FC_DECLARE_EXCEPTION (timeout_exception, timeout_exception_code, "Timeout")
 
 FC_DECLARE_EXCEPTION (file_not_found_exception, file_not_found_exception_code, "File Not Found")
 
 FC_DECLARE_EXCEPTION (parse_error_exception, parse_error_exception_code, "Parse Error")
 report's parse errors
 
 FC_DECLARE_EXCEPTION (invalid_arg_exception, invalid_arg_exception_code, "Invalid Argument")
 
 FC_DECLARE_EXCEPTION (key_not_found_exception, key_not_found_exception_code, "Key Not Found")
 reports when a key, guid, or other item is not found.
 
 FC_DECLARE_EXCEPTION (bad_cast_exception, bad_cast_exception_code, "Bad Cast")
 
 FC_DECLARE_EXCEPTION (out_of_range_exception, out_of_range_exception_code, "Out of Range")
 
 FC_DECLARE_EXCEPTION (invalid_operation_exception, invalid_operation_exception_code, "Invalid Operation")
 if an operation is unsupported or not valid this may be thrown
 
 FC_DECLARE_EXCEPTION (unknown_host_exception, unknown_host_exception_code, "Unknown Host")
 if an host name can not be resolved this may be thrown
 
 FC_DECLARE_EXCEPTION (canceled_exception, canceled_exception_code, "Canceled")
 used to report a canceled Operation
 
 FC_DECLARE_EXCEPTION (assert_exception, assert_exception_code, "Assert Exception")
 used inplace of assert() to report violations of pre conditions.
 
 FC_DECLARE_EXCEPTION (eof_exception, eof_exception_code, "End Of File")
 
 FC_DECLARE_EXCEPTION (null_optional, null_optional_code, "null optional")
 
 FC_DECLARE_EXCEPTION (udt_exception, udt_error_code, "UDT error")
 
 FC_DECLARE_EXCEPTION (aes_exception, aes_error_code, "AES error")
 
 FC_DECLARE_EXCEPTION (overflow_exception, overflow_code, "Integer Overflow")
 
 FC_DECLARE_EXCEPTION (underflow_exception, underflow_code, "Integer Underflow")
 
 FC_DECLARE_EXCEPTION (divide_by_zero_exception, divide_by_zero_code, "Integer Divide By Zero")
 
std::string except_str ()
 
void record_assert_trip (const char *filename, uint32_t lineno, const char *expr)
 
bool exists (const path &p)
 
bool is_directory (const path &p)
 
bool is_regular_file (const path &p)
 
void create_directories (const path &p)
 
void remove_all (const path &p)
 
path absolute (const path &p)
 
path make_relative (const path &from, const path &to)
 
path canonical (const path &p)
 
uint64_t file_size (const path &p)
 
uint64_t directory_size (const path &p)
 
bool remove (const path &p)
 
void copy (const path &from, const path &to)
 
void rename (const path &from, const path &to)
 
void resize_file (const path &file, size_t s)
 
void chmod (const path &p, int perm)
 
void create_hard_link (const path &from, const path &to)
 
path unique_path ()
 
path temp_directory_path ()
 
const pathhome_path ()
 
const pathapp_path ()
 
const fc::pathcurrent_path ()
 
void to_variant (const fc::path &, fc::variant &)
 
void from_variant (const fc::variant &, fc::path &)
 
template<typename Storage >
void to_variant (const fixed_string< Storage > &s, variant &v)
 
template<typename Storage >
void from_variant (const variant &v, fixed_string< Storage > &s)
 
template<typename T , unsigned int S, typename U , typename A >
auto operator+ (const fwd< T, S, A > &x, U &&u) -> typename detail::add< T, U >::type
 
template<typename T , unsigned int S, typename U , typename A >
auto operator- (const fwd< T, S, A > &x, U &&u) -> typename detail::sub< T, U >::type
 
template<typename T , unsigned int S, typename U , typename A >
auto operator<< (U &u, const fwd< T, S, A > &f) -> typename detail::insert_op< U, T >::type
 
template<typename T , unsigned int S, typename U , typename A >
auto operator>> (U &u, fwd< T, S, A > &f) -> typename detail::extract_op< U, T >::type
 
template<uint64_t RequiredSize, uint64_t ProvidedSize>
void check_size ()
 
template<typename T , typename... U>
void to_variant (const bip::set< T, U... > &s, fc::variant &vo)
 
template<typename T , typename... U>
void from_variant (const fc::variant &v, bip::set< T, U... > &s)
 
template<typename T , typename... U>
void to_variant (const bip::multiset< T, U... > &s, fc::variant &vo)
 
template<typename T , typename... U>
void from_variant (const fc::variant &v, bip::multiset< T, U... > &s)
 
template<typename K , typename V , typename... U>
void to_variant (const bip::map< K, V, U... > &m, fc::variant &vo)
 
template<typename K , typename V , typename... U>
void from_variant (const variant &v, bip::map< K, V, U... > &m)
 
template<typename K , typename V , typename... U>
void to_variant (const bip::multimap< K, V, U... > &m, fc::variant &vo)
 
template<typename K , typename V , typename... U>
void from_variant (const variant &v, bip::multimap< K, V, U... > &m)
 
fc::path find_executable_in_path (const fc::string name)
 
template<typename STREAM >
device_adaptor< STREAM, bio::sink_tag > to_sink (STREAM &strm)
 
template<typename STREAM >
device_adaptor< STREAM, bio::source_tag > to_source (STREAM &strm)
 
template<typename STREAM >
device_adaptor< STREAM, bio::source_tag > to_seekable (STREAM &strm)
 
void set_console_echo (bool enable_echo)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const __int128 &d)
 
template<typename ST , typename DATA >
datastream< ST > & operator>> (datastream< ST > &ds, __int128 &d)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const unsigned __int128 &d)
 
template<typename ST , typename DATA >
datastream< ST > & operator>> (datastream< ST > &ds, unsigned __int128 &d)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const int64_t &d)
 
template<typename ST , typename DATA >
datastream< ST > & operator>> (datastream< ST > &ds, int64_t &d)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const uint64_t &d)
 
template<typename ST , typename DATA >
datastream< ST > & operator>> (datastream< ST > &ds, uint64_t &d)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const int32_t &d)
 
template<typename ST , typename DATA >
datastream< ST > & operator>> (datastream< ST > &ds, int32_t &d)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const uint32_t &d)
 
template<typename ST , typename DATA >
datastream< ST > & operator>> (datastream< ST > &ds, uint32_t &d)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const int16_t &d)
 
template<typename ST , typename DATA >
datastream< ST > & operator>> (datastream< ST > &ds, int16_t &d)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const uint16_t &d)
 
template<typename ST , typename DATA >
datastream< ST > & operator>> (datastream< ST > &ds, uint16_t &d)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const int8_t &d)
 
template<typename ST , typename DATA >
datastream< ST > & operator>> (datastream< ST > &ds, int8_t &d)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const uint8_t &d)
 
template<typename ST , typename DATA >
datastream< ST > & operator>> (datastream< ST > &ds, uint8_t &d)
 
template<typename IntType , typename EnumType >
void to_variant (const enum_type< IntType, EnumType > &var, variant &vo)
 
template<typename IntType , typename EnumType >
void from_variant (const variant &var, enum_type< IntType, EnumType > &vo)
 
void read_file_contents (const fc::path &filename, std::string &result)
 
std::string escape_string (const std::string_view &str, const json::yield_function_t &yield, bool escape_control_chars=true)
 
void to_variant (const signed_int &var, variant &vo)
 
void from_variant (const variant &var, signed_int &vo)
 
void to_variant (const unsigned_int &var, variant &vo)
 
void from_variant (const variant &var, unsigned_int &vo)
 
void to_variant (log_level e, variant &v)
 
void from_variant (const variant &e, log_level &ll)
 
void to_variant (const log_context &l, variant &v)
 
void from_variant (const variant &l, log_context &c)
 
void to_variant (const log_message &l, variant &v)
 
void from_variant (const variant &l, log_message &c)
 
void configure_logging (const fc::path &log_config)
 
bool configure_logging (const logging_config &l)
 
void set_os_thread_name (const string &name)
 
void set_thread_name (const string &name)
 
const stringget_thread_name ()
 
template<typename R >
std::function< R, fc::tuple<> > make_fused (const std::function< R > &f)
 
template<typename R , typename A >
std::function< R(fc::tuple< A >) > make_fused (const std::function< R(A)> &f)
 
template<typename R , typename A , typename B >
std::function< R(fc::tuple< A, B >) > make_fused (const std::function< R(A, B)> &f)
 
template<typename R , typename A , typename B , typename C >
std::function< R(fc::tuple< A, B, C >) > make_fused (const std::function< R(A, B, C)> &f)
 
template<typename R , typename A , typename B , typename C , typename D >
std::function< R(fc::tuple< A, B, C, D >) > make_fused (const std::function< R(A, B, C, D)> &f)
 
void to_variant (const ip::endpoint &var, variant &vo)
 
void from_variant (const variant &var, ip::endpoint &vo)
 
void to_variant (const ip::address &var, variant &vo)
 
void from_variant (const variant &var, ip::address &vo)
 
void add_platform_root_cas_to_context (boost::asio::ssl::context &ctx)
 
std::vector< boost::asio::ip::udp::endpoint > resolve (boost::asio::io_service &io_service, const std::string &host, uint16_t port)
 
void to_variant (const url &u, fc::variant &v)
 
void from_variant (const fc::variant &v, url &u)
 
void to_variant (const real128 &var, variant &vo)
 
void from_variant (const variant &var, real128 &vo)
 
void throw_bad_enum_cast (int64_t i, const char *e)
 
void throw_bad_enum_cast (const char *k, const char *e)
 
template<typename T >
void to_variant (const T &o, variant &v)
 
template<typename T >
void from_variant (const variant &v, T &o)
 
template<typename Callback >
scoped_exit< Callback > make_scoped_exit (Callback &&c)
 
template<typename variant , int32_t i = 0>
void from_index (variant &v, int index)
 
template<typename VariantType , typename T , std::size_t index = 0>
constexpr std::size_t get_index ()
 
template<typename... T>
void to_variant (const std::variant< T... > &s, fc::variant &v)
 
template<typename... T>
void from_variant (const fc::variant &v, std::variant< T... > &s)
 
int64_t to_int64 (const fc::string &)
 
uint64_t to_uint64 (const fc::string &)
 
double to_double (const fc::string &)
 
fc::string to_string (double)
 
fc::string to_string (uint64_t)
 
fc::string to_string (int64_t)
 
fc::string to_string (uint16_t)
 
std::string to_pretty_string (int64_t)
 
fc::string to_string (int32_t v)
 
fc::string to_string (uint32_t v)
 
fc::string format_string (const fc::string &, const variant_object &, bool minimize=false)
 
fc::string trim (const fc::string &)
 
fc::string to_lower (const fc::string &)
 
string trim_and_normalize_spaces (const string &s)
 
constexpr microseconds seconds (int64_t s)
 
constexpr microseconds milliseconds (int64_t s)
 
constexpr microseconds minutes (int64_t m)
 
constexpr microseconds hours (int64_t h)
 
constexpr microseconds days (int64_t d)
 
void to_variant (const fc::microseconds &, fc::variant &)
 
void from_variant (const fc::variant &, fc::microseconds &)
 
string get_approximate_relative_time_string (const time_point_sec &event_time, const time_point_sec &relative_to_time=fc::time_point::now(), const std::string &ago=" ago")
 
string get_approximate_relative_time_string (const time_point &event_time, const time_point &relative_to_time=fc::time_point::now(), const std::string &ago=" ago")
 
template<typename Functor >
auto call_fused (Functor f, const tuple<> &t) -> decltype(f())
 
tuple make_tuple ()
 
void to_variant (const uint128 &var, variant &vo)
 
void from_variant (const variant &var, uint128 &vo)
 
bool is_valid_utf8 (const std::string_view &str)
 
std::string prune_invalid_utf8 (const std::string_view &str)
 
bool is_utf8 (const std::string &str)
 
void decodeUtf8 (const std::string &input, std::wstring *storage)
 
void encodeUtf8 (const std::wstring &input, std::string *storage)
 
template<typename T >
const Tmin (const T &a, const T &b)
 
constexpr size_t const_strlen (const char *str)
 
template<typename Container >
void move_append (Container &dest, Container &&src)
 
template<typename Container >
void copy_append (Container &dest, const Container &src)
 
template<typename Container >
void deduplicate (Container &entries)
 
template<typename T , typename... Args>
void to_variant (const boost::multi_index_container< T, Args... > &s, fc::variant &v)
 
template<typename T , typename... Args>
void from_variant (const fc::variant &v, boost::multi_index_container< T, Args... > &s)
 
void to_variant (const UInt< 8 > &n, fc::variant &v)
 
void from_variant (const fc::variant &v, UInt< 8 > &n)
 
void to_variant (const UInt< 16 > &n, fc::variant &v)
 
void from_variant (const fc::variant &v, UInt< 16 > &n)
 
void to_variant (const UInt< 32 > &n, fc::variant &v)
 
void from_variant (const fc::variant &v, UInt< 32 > &n)
 
void to_variant (const UInt< 64 > &n, fc::variant &v)
 
void from_variant (const fc::variant &v, UInt< 64 > &n)
 
template<typename T >
void to_variant (const boost::multiprecision::number< T > &n, fc::variant &v)
 
template<typename T >
void from_variant (const fc::variant &v, boost::multiprecision::number< T > &n)
 
template<typename T >
void to_variant (const safe< T > &s, fc::variant &v)
 
template<typename T >
void from_variant (const fc::variant &v, safe< T > &s)
 
template<typename T >
void to_variant (const std::unique_ptr< T > &s, fc::variant &v)
 
template<typename T >
void from_variant (const fc::variant &v, std::unique_ptr< T > &s)
 
void to_variant (const uint8_t &var, fc::variant &vo)
 
void from_variant (const fc::variant &var, uint8_t &vo)
 
void to_variant (const int8_t &var, fc::variant &vo)
 
void from_variant (const fc::variant &var, int8_t &vo)
 
void to_variant (const uint16_t &var, fc::variant &vo)
 
void from_variant (const fc::variant &var, uint16_t &vo)
 
void to_variant (const int16_t &var, fc::variant &vo)
 
void from_variant (const fc::variant &var, int16_t &vo)
 
void to_variant (const uint32_t &var, fc::variant &vo)
 
void from_variant (const fc::variant &var, uint32_t &vo)
 
void to_variant (const int32_t &var, fc::variant &vo)
 
void from_variant (const fc::variant &var, int32_t &vo)
 
void to_variant (const unsigned __int128 &var, fc::variant &vo)
 
void from_variant (const fc::variant &var, unsigned __int128 &vo)
 
void to_variant (const __int128 &var, fc::variant &vo)
 
void from_variant (const fc::variant &var, __int128 &vo)
 
void to_variant (const variant_object &var, fc::variant &vo)
 
void from_variant (const fc::variant &var, variant_object &vo)
 
void to_variant (const mutable_variant_object &var, fc::variant &vo)
 
void from_variant (const fc::variant &var, mutable_variant_object &vo)
 
void to_variant (const std::vector< char > &var, fc::variant &vo)
 
void from_variant (const fc::variant &var, std::vector< char > &vo)
 
template<typename K , typename T >
void to_variant (const std::unordered_map< K, T > &var, fc::variant &vo)
 
template<typename K , typename T >
void from_variant (const fc::variant &var, std::unordered_map< K, T > &vo)
 
template<typename K , typename T >
void to_variant (const std::map< K, T > &var, fc::variant &vo)
 
template<typename K , typename T >
void from_variant (const fc::variant &var, std::map< K, T > &vo)
 
template<typename K , typename T >
void to_variant (const std::multimap< K, T > &var, fc::variant &vo)
 
template<typename K , typename T >
void from_variant (const fc::variant &var, std::multimap< K, T > &vo)
 
template<typename T >
void to_variant (const std::unordered_set< T > &var, fc::variant &vo)
 
template<typename T >
void from_variant (const fc::variant &var, std::unordered_set< T > &vo)
 
template<typename T >
void to_variant (const std::deque< T > &var, fc::variant &vo)
 
template<typename T >
void from_variant (const fc::variant &var, std::deque< T > &vo)
 
template<typename T , typename... U>
void to_variant (const boost::container::deque< T, U... > &d, fc::variant &vo)
 
template<typename T , typename... U>
void from_variant (const fc::variant &v, boost::container::deque< T, U... > &d)
 
template<typename T >
void to_variant (const std::set< T > &var, fc::variant &vo)
 
template<typename T >
void from_variant (const fc::variant &var, std::set< T > &vo)
 
template<typename T , std::size_t S>
void to_variant (const std::array< T, S > &var, fc::variant &vo)
 
template<typename T , std::size_t S>
void from_variant (const fc::variant &var, std::array< T, S > &vo)
 
void to_variant (const time_point &var, fc::variant &vo)
 
void from_variant (const fc::variant &var, time_point &vo)
 
void to_variant (const time_point_sec &var, fc::variant &vo)
 
void from_variant (const fc::variant &var, time_point_sec &vo)
 
void to_variant (long long int s, fc::variant &v)
 
void to_variant (unsigned long long int s, fc::variant &v)
 
void to_variant (const std::string &s, fc::variant &v)
 
template<typename T >
void to_variant (const std::shared_ptr< T > &var, fc::variant &vo)
 
template<typename T >
void from_variant (const fc::variant &var, std::shared_ptr< T > &vo)
 
template<typename A , typename B >
void to_variant (const std::pair< A, B > &t, fc::variant &v)
 
template<typename A , typename B >
void from_variant (const fc::variant &v, std::pair< A, B > &p)
 
void from_variant (const fc::variant &var, string &vo)
 
void from_variant (const fc::variant &var, fc::variants &vo)
 
void from_variant (const fc::variant &var, fc::variant &vo)
 
void from_variant (const fc::variant &var, int64_t &vo)
 
void from_variant (const fc::variant &var, uint64_t &vo)
 
void from_variant (const fc::variant &var, bool &vo)
 
void from_variant (const fc::variant &var, double &vo)
 
void from_variant (const fc::variant &var, float &vo)
 
template<typename T >
void from_variant (const variant &var, std::optional< T > &vo)
 
template<typename T >
void from_variant (const fc::variant &var, std::vector< T > &tmp)
 
template<typename T >
void to_variant (const std::vector< T > &t, fc::variant &v)
 
fc::variant operator+ (const fc::variant &a, const fc::variant &b)
 
fc::variant operator- (const fc::variant &a, const fc::variant &b)
 
fc::variant operator* (const fc::variant &a, const fc::variant &b)
 
fc::variant operator/ (const fc::variant &a, const fc::variant &b)
 
bool operator== (const fc::variant &a, const fc::variant &b)
 
bool operator!= (const fc::variant &a, const fc::variant &b)
 
bool operator< (const fc::variant &a, const fc::variant &b)
 
bool operator> (const fc::variant &a, const fc::variant &b)
 
bool operator! (const fc::variant &a)
 
uint32_t smaz_compress (const char *in, int inlen, char *out, int outlen)
 
void smaz_decompress (const char *in, uint32_t inlen, std::stringstream &ss)
 
void initLibSnark () noexcept
 
Scalar to_scalar (const bytes &be) noexcept
 
std::variant< alt_bn128_error, libff::alt_bn128_G1decode_g1_element (const bytes &bytes64_be) noexcept
 
std::variant< alt_bn128_error, libff::alt_bn128_Fq2decode_fp2_element (const bytes &bytes64_be) noexcept
 
std::variant< alt_bn128_error, libff::alt_bn128_G2decode_g2_element (const bytes &bytes128_be) noexcept
 
bytes encode_g1_element (libff::alt_bn128_G1 p) noexcept
 
std::string base64_encode_impl (unsigned char const *bytes_to_encode, unsigned int in_len, const char *const b64_chars)
 
std::string base64_decode_impl (std::string const &encoded_string, const char *const b64_chars)
 
unsigned char Byte (unsigned int ui)
 
void BytesToBlock (unsigned char const *p, sblock &b)
 
void BlockToBytes (sblock const &b, unsigned char *p)
 
uint64_t Uint128Low64 (const uint128 &x)
 
uint64_t Uint128High64 (const uint128 &x)
 
uint64_t Hash128to64 (const uint128 &x)
 
uint64_t CityHash64WithSeeds (const char *s, size_t len, uint64_t seed0, uint64_t seed1)
 
uint64_t CityHash64WithSeed (const char *s, size_t len, uint64_t seed)
 
uint128 CityHash128WithSeed (const char *s, size_t len, uint128 seed)
 
void CityHashCrc256 (const char *s, size_t len, uint64_t *result)
 
uint128 CityHashCrc128WithSeed (const char *s, size_t len, uint128 seed)
 
const secp256k1_contextk1_recover_context ()
 
ripemd160 operator<< (const ripemd160 &h1, uint32_t i)
 
ripemd160 operator^ (const ripemd160 &h1, const ripemd160 &h2)
 
bool operator>= (const ripemd160 &h1, const ripemd160 &h2)
 
bool operator> (const ripemd160 &h1, const ripemd160 &h2)
 
bool operator< (const ripemd160 &h1, const ripemd160 &h2)
 
bool operator!= (const ripemd160 &h1, const ripemd160 &h2)
 
bool operator== (const ripemd160 &h1, const ripemd160 &h2)
 
sha1 operator<< (const sha1 &h1, uint32_t i)
 
sha1 operator^ (const sha1 &h1, const sha1 &h2)
 
bool operator>= (const sha1 &h1, const sha1 &h2)
 
bool operator> (const sha1 &h1, const sha1 &h2)
 
bool operator< (const sha1 &h1, const sha1 &h2)
 
bool operator!= (const sha1 &h1, const sha1 &h2)
 
bool operator== (const sha1 &h1, const sha1 &h2)
 
sha224 operator<< (const sha224 &h1, uint32_t i)
 
sha224 operator^ (const sha224 &h1, const sha224 &h2)
 
bool operator>= (const sha224 &h1, const sha224 &h2)
 
bool operator> (const sha224 &h1, const sha224 &h2)
 
bool operator< (const sha224 &h1, const sha224 &h2)
 
bool operator!= (const sha224 &h1, const sha224 &h2)
 
bool operator== (const sha224 &h1, const sha224 &h2)
 
sha256 operator<< (const sha256 &h1, uint32_t i)
 
sha256 operator>> (const sha256 &h1, uint32_t i)
 
sha256 operator^ (const sha256 &h1, const sha256 &h2)
 
bool operator>= (const sha256 &h1, const sha256 &h2)
 
bool operator> (const sha256 &h1, const sha256 &h2)
 
bool operator< (const sha256 &h1, const sha256 &h2)
 
bool operator!= (const sha256 &h1, const sha256 &h2)
 
bool operator== (const sha256 &h1, const sha256 &h2)
 
template<class... Ts>
 overloaded (Ts...) -> overloaded< Ts... >
 
 __attribute__ ((always_inline)) inline uint64_t rotl64(uint64_t x
 
sha3 operator<< (const sha3 &h1, uint32_t i)
 
sha3 operator>> (const sha3 &h1, uint32_t i)
 
sha3 operator^ (const sha3 &h1, const sha3 &h2)
 
bool operator>= (const sha3 &h1, const sha3 &h2)
 
bool operator> (const sha3 &h1, const sha3 &h2)
 
bool operator< (const sha3 &h1, const sha3 &h2)
 
bool operator!= (const sha3 &h1, const sha3 &h2)
 
bool operator== (const sha3 &h1, const sha3 &h2)
 
sha512 operator<< (const sha512 &h1, uint32_t i)
 
sha512 operator^ (const sha512 &h1, const sha512 &h2)
 
bool operator>= (const sha512 &h1, const sha512 &h2)
 
bool operator> (const sha512 &h1, const sha512 &h2)
 
bool operator< (const sha512 &h1, const sha512 &h2)
 
bool operator!= (const sha512 &h1, const sha512 &h2)
 
bool operator== (const sha512 &h1, const sha512 &h2)
 
file_not_found_exception parse_error_exception invalid_arg_exception invalid_operation_exception key_not_found_exception bad_cast_exception out_of_range_exception canceled_exception assert_exception eof_exception unknown_host_exception null_optional udt_exception aes_exception overflow_exception underflow_exception (divide_by_zero_exception)) namespace detail
 
bool assert_optional (bool is_valid)
 
bool operator< (const fc::path &l, const fc::path &r)
 
bool operator== (const fc::path &l, const fc::path &r)
 
bool operator!= (const fc::path &l, const fc::path &r)
 
path operator/ (const fc::path &p, const fc::path &o)
 
bool operator== (const directory_iterator &r, const directory_iterator &l)
 
bool operator!= (const directory_iterator &r, const directory_iterator &l)
 
bool operator== (const recursive_directory_iterator &r, const recursive_directory_iterator &l)
 
bool operator!= (const recursive_directory_iterator &r, const recursive_directory_iterator &l)
 
template<typename T , json::parse_type parser_type>
variant variant_from_stream (T &in, uint32_t max_depth)
 
template<typename T >
char parseEscape (T &in)
 
template<typename T >
std::string stringFromStream (T &in)
 
template<typename T >
bool skip_white_space (T &in)
 
template<typename T >
std::string stringFromToken (T &in)
 
template<typename T , json::parse_type parser_type>
variant_object objectFromStream (T &in, uint32_t max_depth)
 
template<typename T , json::parse_type parser_type>
variants arrayFromStream (T &in, uint32_t max_depth)
 
template<typename T , json::parse_type parser_type>
variant number_from_stream (T &in)
 
template<typename T >
variant token_from_stream (T &in)
 
template<typename T >
void to_stream (T &os, const variants &a, const json::yield_function_t &yield, json::output_formatting format)
 
template<typename T >
void to_stream (T &os, const variant_object &o, const json::yield_function_t &yield, json::output_formatting format)
 
template<typename T >
void to_stream (T &os, const variant &v, const json::yield_function_t &yield, json::output_formatting format)
 
std::string pretty_print (const std::string &v, uint8_t indent)
 
string fixed_size (size_t s, const string &str)
 
bool operator== (const logger &l, std::nullptr_t)
 
bool operator!= (const logger &l, std::nullptr_t)
 
fc::variant create_zipkin_variant (zipkin_span::span_data &&span, const std::string &service_name)
 
void check_udt_errors ()
 
udt_epoll_servicedefault_epool_service ()
 
std::shared_ptr< detail::url_implget_null_url ()
 
template<typename octet_iterator >
std::pair< octet_iterator, uint32_tfind_invalid (octet_iterator start, octet_iterator end, const std::pair< uint32_t, uint32_t > &invalid_range)
 
void set_variant_type (variant *v, variant::type_id t)
 
void clean_append (string &app, const std::string_view &s, size_t pos=0, size_t len=string::npos)
 
bool operator<= (const variant &a, const variant &b)
 
template<typename T >
const Tas_type (const T &x)
 
template<typename ST , typename T >
datastream< ST > & history_serialize_container (datastream< ST > &ds, const chainbase::database &db, const T &v)
 
template<typename ST , typename T >
datastream< ST > & history_serialize_container (datastream< ST > &ds, const chainbase::database &db, const std::vector< std::shared_ptr< T > > &v)
 
template<typename ST , typename P , typename T >
datastream< ST > & history_context_serialize_container (datastream< ST > &ds, const chainbase::database &db, const P &context, const std::vector< T > &v)
 
template<typename ST , typename T >
datastream< ST > & operator<< (datastream< ST > &ds, const sysio::state_history::big_vector_wrapper< T > &obj)
 
template<typename ST >
void history_pack_varuint64 (datastream< ST > &ds, uint64_t val)
 
template<typename ST >
void history_pack_big_bytes (datastream< ST > &ds, const sysio::chain::bytes &v)
 
template<typename ST >
void history_pack_big_bytes (datastream< ST > &ds, const std::optional< sysio::chain::bytes > &v)
 
template<typename ST , typename T >
datastream< ST > & operator<< (datastream< ST > &ds, const history_serial_wrapper< std::vector< T > > &obj)
 
template<typename ST , typename P , typename T >
datastream< ST > & operator<< (datastream< ST > &ds, const history_context_wrapper< P, std::vector< T > > &obj)
 
template<typename ST , typename First , typename Second >
datastream< ST > & operator<< (datastream< ST > &ds, const history_serial_wrapper< std::pair< First, Second > > &obj)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const history_serial_wrapper< sysio::chain::account_object > &obj)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const history_serial_wrapper< sysio::chain::account_metadata_object > &obj)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const history_serial_wrapper< sysio::chain::code_object > &obj)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const history_serial_wrapper< sysio::chain::table_id_object > &obj)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const history_context_wrapper< sysio::chain::table_id_object, sysio::chain::key_value_object > &obj)
 
template<typename ST , typename T >
void serialize_secondary_index_data (datastream< ST > &ds, const T &obj)
 
template<typename ST >
void serialize_secondary_index_data (datastream< ST > &ds, const float64_t &obj)
 
template<typename ST >
void serialize_secondary_index_data (datastream< ST > &ds, const float128_t &obj)
 
template<typename ST >
void serialize_secondary_index_data (datastream< ST > &ds, const sysio::chain::key256_t &obj)
 
template<typename ST , typename T >
datastream< ST > & serialize_secondary_index (datastream< ST > &ds, const sysio::chain::table_id_object &context, const T &obj)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const history_context_wrapper< sysio::chain::table_id_object, sysio::chain::index64_object > &obj)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const history_serial_wrapper< sysio::chain::shared_block_signing_authority_v0 > &obj)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const history_serial_wrapper< sysio::chain::shared_producer_authority > &obj)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const history_serial_wrapper< sysio::chain::shared_producer_authority_schedule > &obj)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const history_serial_wrapper< sysio::chain::chain_config > &obj)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const history_serial_wrapper< sysio::chain::wasm_config > &obj)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const history_serial_wrapper< sysio::chain::global_property_object > &obj)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const history_serial_wrapper< sysio::chain::generated_transaction_object > &obj)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const history_serial_wrapper< sysio::chain::protocol_state_object::activated_protocol_feature > &obj)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const history_serial_wrapper< sysio::chain::protocol_state_object > &obj)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const history_serial_wrapper< sysio::chain::shared_key_weight > &obj)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const history_serial_wrapper< sysio::chain::permission_level > &obj)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const history_serial_wrapper< sysio::chain::permission_level_weight > &obj)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const history_serial_wrapper< sysio::chain::wait_weight > &obj)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const history_serial_wrapper< sysio::chain::shared_authority > &obj)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const history_serial_wrapper< sysio::chain::permission_object > &obj)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const history_serial_wrapper< sysio::chain::permission_link_object > &obj)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const history_serial_wrapper< sysio::chain::resource_limits::resource_limits_object > &obj)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const history_serial_wrapper< sysio::chain::resource_limits::usage_accumulator > &obj)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const history_serial_wrapper< sysio::chain::resource_limits::resource_usage_object > &obj)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const history_serial_wrapper< sysio::chain::resource_limits::resource_limits_state_object > &obj)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const history_serial_wrapper< sysio::chain::resource_limits::ratio > &obj)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const history_serial_wrapper< sysio::chain::resource_limits::elastic_limit_parameters > &obj)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const history_serial_wrapper< sysio::chain::resource_limits::resource_limits_config_object > &obj)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const history_serial_wrapper< sysio::chain::action > &obj)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const history_serial_wrapper< sysio::chain::action_receipt > &obj)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const history_serial_wrapper< sysio::chain::account_delta > &obj)
 
std::optional< uint64_tcap_error_code (const std::optional< uint64_t > &error_code)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const history_context_wrapper< bool, sysio::chain::action_trace > &obj)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const history_context_wrapper< std::pair< uint8_t, bool >, sysio::state_history::augmented_transaction_trace > &obj)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const history_context_wrapper< bool, sysio::state_history::augmented_transaction_trace > &obj)
 
template<typename ST >
datastream< ST > & operator<< (datastream< ST > &ds, const sysio::state_history::get_blocks_result_v0 &obj)
 
void to_variant (const params::permission_level &a, fc::variant &v)
 
void from_variant (const fc::variant &v, params::permission_level &a)
 
template<typename ... Ts>
std::ostream & operator<< (std::ostream &os, const std::variant< Ts... > &v)
 
std::ostream & operator<< (std::ostream &os, const fc::microseconds &t)
 

Variables

bool enable_record_assert_trip = false
 
const char *const git_revision_sha
 
const uint32_t git_revision_unix_timestamp
 
uint64_t y { return (x << y) | (x >> (64-y))
 
bool do_default_config = configure_logging( logging_config::default_config() )
 
constexpr char hex_digits [] = "0123456789abcdef"
 
constexpr size_t minimize_max_size = 1024
 

Detailed Description

This file contains general purpose utilities related to UTF-8 <-> Unicode conversions.

sysio::chain

Implemented with std::string for now.

Typedef Documentation

◆ any

typedef boost::any fc::any

Definition at line 6 of file any.hpp.

◆ api_id_type

Definition at line 46 of file api.hpp.

◆ api_ptr

typedef std::shared_ptr< api_base > fc::api_ptr

Definition at line 62 of file api.hpp.

◆ buffered_istream_ptr

typedef std::shared_ptr<buffered_istream> fc::buffered_istream_ptr

Definition at line 46 of file buffered_iostream.hpp.

◆ buffered_ostream_ptr

typedef std::shared_ptr<buffered_ostream> fc::buffered_ostream_ptr

Definition at line 72 of file buffered_iostream.hpp.

◆ bytes

typedef std::vector< char > fc::bytes = std::vector<char>

Definition at line 10 of file alt_bn128.hpp.

◆ const_blob_ptr

typedef const blob* fc::const_blob_ptr

Definition at line 165 of file variant.cpp.

◆ const_char_ptr

typedef const char* fc::const_char_ptr

Definition at line 7 of file smaz.cpp.

◆ const_string_ptr

typedef const string* fc::const_string_ptr

Definition at line 166 of file variant.cpp.

◆ const_variant_object_ptr

Definition at line 163 of file variant.cpp.

◆ const_variants_ptr

Definition at line 164 of file variant.cpp.

◆ exception_ptr

typedef std::shared_ptr<exception> fc::exception_ptr

Definition at line 139 of file exception.hpp.

◆ hmac_sha224

Definition at line 57 of file hmac.hpp.

◆ hmac_sha256

Definition at line 58 of file hmac.hpp.

◆ hmac_sha512

Definition at line 59 of file hmac.hpp.

◆ Int

template<size_t Size>
using fc::Int
Initial value:
boost::multiprecision::number<
boost::multiprecision::cpp_int_backend<Size, Size, boost::multiprecision::signed_magnitude, boost::multiprecision::unchecked, void> >

Definition at line 57 of file variant.hpp.

◆ iprocess_ptr

typedef std::shared_ptr<iprocess> fc::iprocess_ptr

Definition at line 64 of file iprocess.hpp.

◆ log_messages

typedef std::vector<log_message> fc::log_messages

Definition at line 136 of file log_message.hpp.

◆ m128

typedef boost::multiprecision::uint128_t fc::m128

Definition at line 11 of file uint128.cpp.

◆ mock_deadline_timer

typedef boost::asio::basic_deadline_timer<boost::posix_time::ptime, mock_time_traits> fc::mock_deadline_timer

Definition at line 45 of file mock_time.hpp.

◆ nullptr_t

typedef decltype(nullptr) fc::nullptr_t

Definition at line 28 of file utility.hpp.

◆ oexception

typedef std::optional<exception> fc::oexception

Definition at line 141 of file exception.hpp.

◆ opath

typedef std::optional<fc::path> fc::opath

Definition at line 11 of file url.hpp.

◆ ostring

typedef std::optional< fc::string > fc::ostring

Definition at line 10 of file url.hpp.

◆ otime_point

typedef std::optional<time_point> fc::otime_point

Definition at line 123 of file time.hpp.

◆ ovariant

typedef std::optional<variant> fc::ovariant

Definition at line 369 of file variant.hpp.

◆ ovariant_object

typedef std::optional<fc::variant_object> fc::ovariant_object

Definition at line 12 of file url.hpp.

◆ params

◆ process_ptr

typedef std::shared_ptr<process> fc::process_ptr

Definition at line 35 of file process.hpp.

◆ Scalar

Definition at line 15 of file alt_bn128.cpp.

◆ signature

Definition at line 17 of file pke.hpp.

◆ string

typedef std::string fc::string

Definition at line 10 of file string.hpp.

◆ UInt

template<size_t Size>
using fc::UInt
Initial value:
boost::multiprecision::number<
boost::multiprecision::cpp_int_backend<Size, Size, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void> >

Definition at line 54 of file variant.hpp.

◆ uint160

Definition at line 79 of file ripemd160.hpp.

◆ uint160_t

Definition at line 78 of file ripemd160.hpp.

◆ uint256

Definition at line 103 of file sha256.hpp.

◆ uint512

Definition at line 70 of file sha512.hpp.

◆ variants

typedef std::vector<fc::variant> fc::variants

Definition at line 173 of file variant.hpp.

◆ yield_function_t

Definition at line 205 of file utility.hpp.

Enumeration Type Documentation

◆ alt_bn128_error

Enumerator
operand_component_invalid 
operand_not_in_curve 
pairing_list_size_error 
operand_outside_g2 
input_len_error 
invalid_scalar_size 

Definition at line 12 of file alt_bn128.hpp.

◆ blake2b_error

Enumerator
input_len_error 

Definition at line 14 of file blake2.hpp.

14 : int32_t {
16 };

◆ exception_code

Enumerator
unspecified_exception_code 

for exceptions we threw that don't have an assigned code

unhandled_exception_code 

for unhandled 3rd party exceptions

timeout_exception_code 

timeout exceptions

file_not_found_exception_code 
parse_error_exception_code 
invalid_arg_exception_code 
key_not_found_exception_code 
bad_cast_exception_code 
out_of_range_exception_code 
canceled_exception_code 
assert_exception_code 
eof_exception_code 
std_exception_code 
invalid_operation_exception_code 
unknown_host_exception_code 
null_optional_code 
udt_error_code 
aes_error_code 
overflow_code 
underflow_code 
divide_by_zero_code 

Definition at line 17 of file exception.hpp.

18 {
36 udt_error_code = 17,
37 aes_error_code = 18,
38 overflow_code = 19,
39 underflow_code = 20,
41 };
@ timeout_exception_code
timeout exceptions
Definition exception.hpp:22
@ unknown_host_exception_code
Definition exception.hpp:34
@ assert_exception_code
Definition exception.hpp:30
@ bad_cast_exception_code
Definition exception.hpp:27
@ unhandled_exception_code
for unhandled 3rd party exceptions
Definition exception.hpp:21
@ udt_error_code
Definition exception.hpp:36
@ aes_error_code
Definition exception.hpp:37
@ divide_by_zero_code
Definition exception.hpp:40
@ file_not_found_exception_code
Definition exception.hpp:23
@ unspecified_exception_code
Definition exception.hpp:20
@ null_optional_code
Definition exception.hpp:35
@ parse_error_exception_code
Definition exception.hpp:24
@ invalid_arg_exception_code
Definition exception.hpp:25
@ key_not_found_exception_code
Definition exception.hpp:26
@ std_exception_code
Definition exception.hpp:32
@ canceled_exception_code
Definition exception.hpp:29
@ eof_exception_code
Definition exception.hpp:31
@ invalid_operation_exception_code
Definition exception.hpp:33
@ out_of_range_exception_code
Definition exception.hpp:28
@ overflow_code
Definition exception.hpp:38
@ underflow_code
Definition exception.hpp:39

◆ k1_recover_error

Enumerator
init_error 
input_error 
invalid_signature 
recover_error 

Definition at line 12 of file k1_recover.hpp.

◆ mode_t

enum fc::mode_t
Enumerator
read_only 
write_only 
read_write 

Definition at line 12 of file file_mapping.hpp.

12 {
13 read_only,
16 };
@ write_only
@ read_write
@ read_only

◆ modular_arithmetic_error

Enumerator
modulus_len_zero 

Definition at line 10 of file modular_arithmetic.hpp.

Function Documentation

◆ __attribute__()

fc::__attribute__ ( (always_inline) )

◆ absolute()

fc::path fc::absolute ( const path & p)

Definition at line 364 of file filesystem.cpp.

364{ return boost::filesystem::absolute(p); }
const mie::Vuint & p
Definition bn.cpp:27
Here is the caller graph for this function:

◆ add_platform_root_cas_to_context()

void fc::add_platform_root_cas_to_context ( boost::asio::ssl::context & ctx)

Definition at line 117 of file platform_root_ca.cpp.

117 {
118#if defined( __APPLE__ )
119 add_macos_root_cas(ctx);
120#elif defined( _WIN32 )
121 FC_THROW("HTTPS on Windows not supported");
122#else
123 ctx.set_default_verify_paths();
124#endif
125}
#define FC_THROW( ...)
Here is the caller graph for this function:

◆ aes_cfb_decrypt()

unsigned fc::aes_cfb_decrypt ( unsigned char * ciphertext,
int ciphertext_len,
unsigned char * key,
unsigned char * iv,
unsigned char * plaintext )

Definition at line 257 of file aes.cpp.

259{
260 evp_cipher_ctx ctx( EVP_CIPHER_CTX_new() );
261 int len = 0;
262 unsigned plaintext_len = 0;
263
264 /* Create and initialise the context */
265 if(!ctx)
266 {
267 FC_THROW_EXCEPTION( aes_exception, "error allocating evp cipher context",
268 ("s", ERR_error_string( ERR_get_error(), nullptr) ) );
269 }
270
271 /* Initialise the decryption operation. IMPORTANT - ensure you use a key
272 * * and IV size appropriate for your cipher
273 * * In this example we are using 256 bit AES (i.e. a 256 bit key). The
274 * * IV size for *most* modes is the same as the block size. For AES this
275 * * is 128 bits */
276 if(1 != EVP_DecryptInit_ex(ctx, EVP_aes_256_cfb128(), NULL, key, iv))
277 {
278 FC_THROW_EXCEPTION( aes_exception, "error during aes 256 cbc decrypt init",
279 ("s", ERR_error_string( ERR_get_error(), nullptr) ) );
280 }
281
282 /* Provide the message to be decrypted, and obtain the plaintext output.
283 * * EVP_DecryptUpdate can be called multiple times if necessary
284 * */
285 if(1 != EVP_DecryptUpdate(ctx, plaintext, &len, ciphertext, ciphertext_len))
286 {
287 FC_THROW_EXCEPTION( aes_exception, "error during aes 256 cbc decrypt update",
288 ("s", ERR_error_string( ERR_get_error(), nullptr) ) );
289 }
290
291 plaintext_len = len;
292
293 /* Finalise the decryption. Further plaintext bytes may be written at
294 * * this stage.
295 * */
296 if(1 != EVP_DecryptFinal_ex(ctx, plaintext + len, &len))
297 {
298 FC_THROW_EXCEPTION( aes_exception, "error during aes 256 cbc decrypt final",
299 ("s", ERR_error_string( ERR_get_error(), nullptr) ) );
300 }
301 plaintext_len += len;
302
303 return plaintext_len;
304}
#define FC_THROW_EXCEPTION(EXCEPTION, FORMAT,...)
size_t len

◆ aes_decrypt() [1/2]

std::vector< char > fc::aes_decrypt ( const fc::sha512 & key,
const std::vector< char > & cipher_text )

Definition at line 317 of file aes.cpp.

318{
319 std::vector<char> plain_text( cipher_text.size() );
320 auto plain_len = aes_decrypt( (unsigned char*)cipher_text.data(), (int)cipher_text.size(),
321 (unsigned char*)&key, ((unsigned char*)&key)+32,
322 (unsigned char*)plain_text.data() );
323 plain_text.resize(plain_len);
324 return plain_text;
325}
uint8_t aes_decrypt(uint8_t *in, uint8_t *out, const aes_context *ctx)
Definition aes.c:249
Here is the call graph for this function:

◆ aes_decrypt() [2/2]

unsigned fc::aes_decrypt ( unsigned char * ciphertext,
int ciphertext_len,
unsigned char * key,
unsigned char * iv,
unsigned char * plaintext )

Definition at line 208 of file aes.cpp.

210{
211 evp_cipher_ctx ctx( EVP_CIPHER_CTX_new() );
212 int len = 0;
213 unsigned plaintext_len = 0;
214
215 /* Create and initialise the context */
216 if(!ctx)
217 {
218 FC_THROW_EXCEPTION( aes_exception, "error allocating evp cipher context",
219 ("s", ERR_error_string( ERR_get_error(), nullptr) ) );
220 }
221
222 /* Initialise the decryption operation. IMPORTANT - ensure you use a key
223 * * and IV size appropriate for your cipher
224 * * In this example we are using 256 bit AES (i.e. a 256 bit key). The
225 * * IV size for *most* modes is the same as the block size. For AES this
226 * * is 128 bits */
227 if(1 != EVP_DecryptInit_ex(ctx, EVP_aes_256_cbc(), NULL, key, iv))
228 {
229 FC_THROW_EXCEPTION( aes_exception, "error during aes 256 cbc decrypt init",
230 ("s", ERR_error_string( ERR_get_error(), nullptr) ) );
231 }
232
233 /* Provide the message to be decrypted, and obtain the plaintext output.
234 * * EVP_DecryptUpdate can be called multiple times if necessary
235 * */
236 if(1 != EVP_DecryptUpdate(ctx, plaintext, &len, ciphertext, ciphertext_len))
237 {
238 FC_THROW_EXCEPTION( aes_exception, "error during aes 256 cbc decrypt update",
239 ("s", ERR_error_string( ERR_get_error(), nullptr) ) );
240 }
241
242 plaintext_len = len;
243
244 /* Finalise the decryption. Further plaintext bytes may be written at
245 * * this stage.
246 * */
247 if(1 != EVP_DecryptFinal_ex(ctx, plaintext + len, &len))
248 {
249 FC_THROW_EXCEPTION( aes_exception, "error during aes 256 cbc decrypt final",
250 ("s", ERR_error_string( ERR_get_error(), nullptr) ) );
251 }
252 plaintext_len += len;
253
254 return plaintext_len;
255}
Here is the caller graph for this function:

◆ aes_encrypt() [1/2]

std::vector< char > fc::aes_encrypt ( const fc::sha512 & key,
const std::vector< char > & plain_text )

Definition at line 306 of file aes.cpp.

307{
308 std::vector<char> cipher_text(plain_text.size()+16);
309 auto cipher_len = aes_encrypt( (unsigned char*)plain_text.data(), (int)plain_text.size(),
310 (unsigned char*)&key, ((unsigned char*)&key)+32,
311 (unsigned char*)cipher_text.data() );
312 FC_ASSERT( cipher_len <= cipher_text.size() );
313 cipher_text.resize(cipher_len);
314 return cipher_text;
315
316}
uint8_t aes_encrypt(uint8_t *in, uint8_t *out, const aes_context *ctx)
Definition aes.c:229
#define FC_ASSERT(TEST,...)
Checks a condition and throws an assert_exception if the test is FALSE.
Here is the call graph for this function:

◆ aes_encrypt() [2/2]

unsigned fc::aes_encrypt ( unsigned char * plaintext,
int plaintext_len,
unsigned char * key,
unsigned char * iv,
unsigned char * ciphertext )

example method from wiki.opensslfoundation.com

Definition at line 159 of file aes.cpp.

161{
162 evp_cipher_ctx ctx( EVP_CIPHER_CTX_new() );
163
164 int len = 0;
165 unsigned ciphertext_len = 0;
166
167 /* Create and initialise the context */
168 if(!ctx)
169 {
170 FC_THROW_EXCEPTION( aes_exception, "error allocating evp cipher context",
171 ("s", ERR_error_string( ERR_get_error(), nullptr) ) );
172 }
173
174 /* Initialise the encryption operation. IMPORTANT - ensure you use a key
175 * and IV size appropriate for your cipher
176 * In this example we are using 256 bit AES (i.e. a 256 bit key). The
177 * IV size for *most* modes is the same as the block size. For AES this
178 * is 128 bits */
179 if(1 != EVP_EncryptInit_ex(ctx, EVP_aes_256_cbc(), NULL, key, iv))
180 {
181 FC_THROW_EXCEPTION( aes_exception, "error during aes 256 cbc encryption init",
182 ("s", ERR_error_string( ERR_get_error(), nullptr) ) );
183 }
184
185 /* Provide the message to be encrypted, and obtain the encrypted output.
186 * * EVP_EncryptUpdate can be called multiple times if necessary
187 * */
188 if(1 != EVP_EncryptUpdate(ctx, ciphertext, &len, plaintext, plaintext_len))
189 {
190 FC_THROW_EXCEPTION( aes_exception, "error during aes 256 cbc encryption update",
191 ("s", ERR_error_string( ERR_get_error(), nullptr) ) );
192 }
193 ciphertext_len = len;
194
195 /* Finalise the encryption. Further ciphertext bytes may be written at
196 * * this stage.
197 * */
198 if(1 != EVP_EncryptFinal_ex(ctx, ciphertext + len, &len))
199 {
200 FC_THROW_EXCEPTION( aes_exception, "error during aes 256 cbc encryption final",
201 ("s", ERR_error_string( ERR_get_error(), nullptr) ) );
202 }
203 ciphertext_len += len;
204
205 return ciphertext_len;
206}
Here is the caller graph for this function:

◆ aes_load()

std::vector< char > fc::aes_load ( const fc::path & file,
const fc::sha512 & key )

recovers the plain_text saved via aes_save()

Definition at line 347 of file aes.cpp.

348{ try {
349 FC_ASSERT( fc::exists( file ) );
350
351 std::ifstream in( file.generic_string().c_str(), std::ifstream::binary );
352 fc::sha512 check;
353 std::vector<char> cipher;
354
355 fc::raw::unpack( in, check );
356 fc::raw::unpack( in, cipher );
357
358 fc::sha512::encoder check_enc;
359 fc::raw::pack( check_enc, key );
360 fc::raw::pack( check_enc, cipher );
361
362 FC_ASSERT( check_enc.result() == check );
363
364 return aes_decrypt( key, cipher );
365} FC_RETHROW_EXCEPTIONS( warn, "", ("file",file) ) }
#define FC_RETHROW_EXCEPTIONS(LOG_LEVEL, FORMAT,...)
Catchs all exception's, std::exceptions, and ... and rethrows them after appending the provided log m...
void unpack(Stream &s, std::deque< T > &value)
Definition raw.hpp:540
void pack(Stream &s, const std::deque< T > &value)
Definition raw.hpp:531
bool exists(const path &p)
Here is the call graph for this function:

◆ aes_save()

void fc::aes_save ( const fc::path & file,
const fc::sha512 & key,
std::vector< char > plain_text )

encrypts plain_text and then includes a checksum that enables us to verify the integrety of the file / key prior to decryption.

Definition at line 331 of file aes.cpp.

332{ try {
333 auto cipher = aes_encrypt( key, plain_text );
334 fc::sha512::encoder check_enc;
335 fc::raw::pack( check_enc, key );
336 fc::raw::pack( check_enc, cipher );
337 auto check = check_enc.result();
338
339 std::ofstream out(file.generic_string().c_str());
340 fc::raw::pack( out, check );
341 fc::raw::pack( out, cipher );
342} FC_RETHROW_EXCEPTIONS( warn, "", ("file",file) ) }
Here is the call graph for this function:

◆ alt_bn128_add()

std::variant< alt_bn128_error, bytes > fc::alt_bn128_add ( const bytes & op1,
const bytes & op2 )

Definition at line 142 of file alt_bn128.cpp.

142 {
144
145 auto maybe_x = decode_g1_element(op1);
146 if (std::holds_alternative<alt_bn128_error>(maybe_x)) {
147 return std::get<alt_bn128_error>(maybe_x);
148 }
149
150 auto maybe_y = decode_g1_element(op2);
151 if (std::holds_alternative<alt_bn128_error>(maybe_y)) {
152 return std::get<alt_bn128_error>(maybe_y);
153 }
154
155 const auto& x = std::get<libff::alt_bn128_G1>(maybe_x);
156 const auto& y = std::get<libff::alt_bn128_G1>(maybe_y);
157
158 libff::alt_bn128_G1 g1Sum = x + y;
159 return encode_g1_element(g1Sum);
160 }
bytes encode_g1_element(libff::alt_bn128_G1 p) noexcept
void initLibSnark() noexcept
Definition alt_bn128.cpp:17
uint64_t y
Definition sha3.cpp:34
std::variant< alt_bn128_error, libff::alt_bn128_G1 > decode_g1_element(const bytes &bytes64_be) noexcept
Definition alt_bn128.cpp:42
Here is the call graph for this function:
Here is the caller graph for this function:

◆ alt_bn128_mul()

std::variant< alt_bn128_error, bytes > fc::alt_bn128_mul ( const bytes & g1_point,
const bytes & scalar )

Definition at line 162 of file alt_bn128.cpp.

162 {
163 initLibSnark();
164
165 auto maybe_x = decode_g1_element(g1_point);
166 if (std::holds_alternative<alt_bn128_error>(maybe_x)) {
167 return std::get<alt_bn128_error>(maybe_x);
168 }
169
170 auto& x = std::get<libff::alt_bn128_G1>(maybe_x);
171
172 if(scalar.size() != 32) {
173 return alt_bn128_error::invalid_scalar_size;
174 }
175
176 Scalar n{to_scalar(scalar)};
177
178 libff::alt_bn128_G1 g1Product = n * x;
179 return encode_g1_element(g1Product);
180 }
Scalar to_scalar(const bytes &be) noexcept
Definition alt_bn128.cpp:27
libff::bigint< libff::alt_bn128_q_limbs > Scalar
Definition alt_bn128.cpp:15
Here is the call graph for this function:
Here is the caller graph for this function:

◆ alt_bn128_pair()

std::variant< alt_bn128_error, bool > fc::alt_bn128_pair ( const bytes & g1_g2_pairs,
const yield_function_t & yield )

Definition at line 184 of file alt_bn128.cpp.

184 {
185 if (g1_g2_pairs.size() % kSnarkvStride != 0) {
186 return alt_bn128_error::pairing_list_size_error;
187 }
188
189 size_t k{g1_g2_pairs.size() / kSnarkvStride};
190
191 initLibSnark();
192 using namespace libff;
193
194 static const auto one{alt_bn128_Fq12::one()};
195 auto accumulator{one};
196
197 for (size_t i{0}; i < k; ++i) {
198 auto offset = i * kSnarkvStride;
199
200 bytes sub1(g1_g2_pairs.begin()+offset, g1_g2_pairs.begin()+offset+64);
201 auto maybe_a = decode_g1_element(sub1);
202 if (std::holds_alternative<alt_bn128_error>(maybe_a)) {
203 return std::get<alt_bn128_error>(maybe_a);
204 }
205
206 bytes sub2(g1_g2_pairs.begin()+offset+64, g1_g2_pairs.begin()+offset+64+128);
207 auto maybe_b = decode_g2_element(sub2);
208 if (std::holds_alternative<alt_bn128_error>(maybe_b)) {
209 return std::get<alt_bn128_error>(maybe_b);
210 }
211
212 const auto& a = std::get<libff::alt_bn128_G1>(maybe_a);
213 const auto& b = std::get<libff::alt_bn128_G2>(maybe_b);
214
215 if (a.is_zero() || b.is_zero()) {
216 continue;
217 }
218
220 yield();
221 }
222
223 bool pair_result = false;
224 if (alt_bn128_final_exponentiation(accumulator) == one) {
225 pair_result = true;
226 }
227
228 return pair_result;
229 }
std::string one()
thread_local yield_t yield
Definition yield.hpp:52
std::variant< alt_bn128_error, libff::alt_bn128_G2 > decode_g2_element(const bytes &bytes128_be) noexcept
Definition alt_bn128.cpp:87
alt_bn128_Fq12 alt_bn128_miller_loop(const alt_bn128_G1_precomp &prec_P, const alt_bn128_G2_precomp &prec_Q)
alt_bn128_G2_precomp alt_bn128_precompute_G2(const alt_bn128_G2 &Q)
alt_bn128_G1_precomp alt_bn128_precompute_G1(const alt_bn128_G1 &P)
alt_bn128_GT alt_bn128_final_exponentiation(const alt_bn128_Fq12 &elt)
vector< char > bytes
Definition types.hpp:243
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181
Here is the call graph for this function:
Here is the caller graph for this function:

◆ app_path()

const fc::path & fc::app_path ( )
Returns
the home_path() on Linux, home_path()/Library/Application Support/ on OS X, and APPDATA on windows

Definition at line 503 of file filesystem.cpp.

504 {
505#ifdef __APPLE__
506 static fc::path appdir = [](){ return home_path() / "Library" / "Application Support"; }();
507#elif defined( WIN32 )
508 static fc::path appdir = [](){
509 wchar_t app_data_dir[MAX_PATH];
510
511 if (!SUCCEEDED(SHGetFolderPathW(NULL, CSIDL_APPDATA | CSIDL_FLAG_CREATE, NULL, 0, app_data_dir)))
512 FC_ASSERT(false, "Unable to get the current AppData directory");
513 return fc::path(std::wstring(app_data_dir));
514 }();
515#else
516 static fc::path appdir = home_path() / ".local/share";
517#endif
518 return appdir;
519 }
wraps boost::filesystem::path to provide platform independent path manipulation.
const path & home_path()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ arrayFromStream()

template<typename T , json::parse_type parser_type>
variants fc::arrayFromStream ( T & in,
uint32_t max_depth )

Definition at line 221 of file json.cpp.

222 {
223 variants ar;
224 try
225 {
226 if( in.peek() != '[' )
227 FC_THROW_EXCEPTION( parse_error_exception, "Expected '['" );
228 in.get();
230
231 while( in.peek() != ']' )
232 {
233 if( in.peek() == ',' )
234 {
235 in.get();
236 continue;
237 }
238 if( skip_white_space(in) ) continue;
239 ar.push_back( variant_from_stream<T, parser_type>( in, max_depth - 1) );
240 skip_white_space(in);
241 }
242 if( in.peek() != ']' )
243 FC_THROW_EXCEPTION( parse_error_exception, "Expected ']' after parsing ${variant}",
244 ("variant", ar) );
245
246 in.get();
247 } FC_RETHROW_EXCEPTIONS( warn, "Attempting to parse array ${array}",
248 ("array", ar ) );
249 return ar;
250 }
std::vector< fc::variant > variants
Definition variant.hpp:173
bool skip_white_space(T &in)
Definition json.cpp:65
Here is the call graph for this function:
Here is the caller graph for this function:

◆ as_type()

template<typename T >
const T & fc::as_type ( const T & x)

Definition at line 46 of file serialization.hpp.

46 {
47 return x;
48}
Here is the caller graph for this function:

◆ assert_optional()

bool fc::assert_optional ( bool is_valid)

Definition at line 287 of file exception.cpp.

288 {
289 if( !is_valid )
290 throw null_optional();
291 return true;
292 }

◆ base64_decode()

std::string fc::base64_decode ( const std::string & encoded_string)

Definition at line 152 of file base64.cpp.

152 {
153 return base64_decode_impl(encoded_string, base64_chars);
154}
std::string base64_decode_impl(std::string const &encoded_string, const char *const b64_chars)
Definition base64.cpp:110
Here is the call graph for this function:
Here is the caller graph for this function:

◆ base64_decode_impl()

std::string fc::base64_decode_impl ( std::string const & encoded_string,
const char *const b64_chars )

Definition at line 110 of file base64.cpp.

110 {
111 int in_len = encoded_string.size();
112 int i = 0;
113 int j = 0;
114 int in_ = 0;
115 unsigned char char_array_4[4], char_array_3[3];
116 std::string ret;
117
118 while (in_len-- && encoded_string[in_] != '=') {
119 throw_on_nonbase64(encoded_string[in_], b64_chars);
120 char_array_4[i++] = encoded_string[in_]; in_++;
121 if (i ==4) {
122 for (i = 0; i <4; i++)
123 char_array_4[i] = strchr(b64_chars, char_array_4[i]) - b64_chars;
124
125 char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4);
126 char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2);
127 char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3];
128
129 for (i = 0; (i < 3); i++)
130 ret += char_array_3[i];
131 i = 0;
132 }
133 }
134
135 if (i) {
136 for (j = i; j <4; j++)
137 char_array_4[j] = 0;
138
139 for (j = 0; j <4; j++)
140 char_array_4[j] = strchr(b64_chars, char_array_4[j]) - b64_chars;
141
142 char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4);
143 char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2);
144 char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3];
145
146 for (j = 0; (j < i - 1); j++) ret += char_array_3[j];
147 }
148
149 return ret;
150}
CK_RV ret
uint16_t j
size_t in_len
Here is the caller graph for this function:

◆ base64_encode() [1/3]

std::string fc::base64_encode ( char const * bytes_to_encode,
unsigned int in_len )
inline

Definition at line 6 of file base64.hpp.

6{ return base64_encode( (unsigned char const*)bytes_to_encode, in_len); }
std::string base64_encode(unsigned char const *bytes_to_encode, unsigned int in_len)
Definition base64.cpp:92
Here is the call graph for this function:

◆ base64_encode() [2/3]

std::string fc::base64_encode ( const std::string & enc)

Definition at line 96 of file base64.cpp.

96 {
97 char const* s = enc.c_str();
98 return base64_encode( (unsigned char const*)s, enc.size() );
99}
char * s
Here is the call graph for this function:

◆ base64_encode() [3/3]

std::string fc::base64_encode ( unsigned char const * bytes_to_encode,
unsigned int in_len )

Definition at line 92 of file base64.cpp.

92 {
93 return base64_encode_impl(bytes_to_encode, in_len, base64_chars);
94}
std::string base64_encode_impl(unsigned char const *bytes_to_encode, unsigned int in_len, const char *const b64_chars)
Definition base64.cpp:48
Here is the call graph for this function:
Here is the caller graph for this function:

◆ base64_encode_impl()

std::string fc::base64_encode_impl ( unsigned char const * bytes_to_encode,
unsigned int in_len,
const char *const b64_chars )

Definition at line 48 of file base64.cpp.

48 {
49
50 std::string ret;
51 int i = 0;
52 int j = 0;
53 unsigned char char_array_3[3];
54 unsigned char char_array_4[4];
55
56 while (in_len--) {
57 char_array_3[i++] = *(bytes_to_encode++);
58 if (i == 3) {
59 char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;
60 char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4);
61 char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6);
62 char_array_4[3] = char_array_3[2] & 0x3f;
63
64 for(i = 0; (i <4) ; i++)
65 ret += b64_chars[char_array_4[i]];
66 i = 0;
67 }
68 }
69
70 if (i)
71 {
72 for(j = i; j < 3; j++)
73 char_array_3[j] = '\0';
74
75 char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;
76 char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4);
77 char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6);
78 char_array_4[3] = char_array_3[2] & 0x3f;
79
80 for (j = 0; (j < i + 1); j++)
81 ret += b64_chars[char_array_4[j]];
82
83 while((i++ < 3))
84 ret += '=';
85
86 }
87
88 return ret;
89
90}
Here is the caller graph for this function:

◆ base64url_decode()

std::string fc::base64url_decode ( const std::string & encoded_string)

Definition at line 156 of file base64.cpp.

156 {
157 return base64_decode_impl(encoded_string, base64url_chars);
158}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ base64url_encode() [1/3]

std::string fc::base64url_encode ( char const * bytes_to_encode,
unsigned int in_len )
inline

Definition at line 11 of file base64.hpp.

11{ return base64url_encode( (unsigned char const*)bytes_to_encode, in_len); }
std::string base64url_encode(unsigned char const *bytes_to_encode, unsigned int in_len)
Definition base64.cpp:101
Here is the call graph for this function:

◆ base64url_encode() [2/3]

std::string fc::base64url_encode ( const std::string & enc)

Definition at line 105 of file base64.cpp.

105 {
106 char const* s = enc.c_str();
107 return base64url_encode( (unsigned char const*)s, enc.size() );
108}
Here is the call graph for this function:

◆ base64url_encode() [3/3]

std::string fc::base64url_encode ( unsigned char const * bytes_to_encode,
unsigned int in_len )

Definition at line 101 of file base64.cpp.

101 {
102 return base64_encode_impl(bytes_to_encode, in_len, base64url_chars);
103}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ blake2b()

std::variant< blake2b_error, bytes > fc::blake2b ( uint32_t _rounds,
const bytes & _h,
const bytes & _m,
const bytes & _t0_offset,
const bytes & _t1_offset,
bool _f,
const yield_function_t & yield )

Definition at line 105 of file blake2.cpp.

105 {
106
107 // EIP-152 [4 bytes for rounds][64 bytes for h][128 bytes for m][8 bytes for t_0][8 bytes for t_1][1 byte for f] : 213
108 // [------------------][64 bytes for h][128 bytes for m][8 bytes for t_0][8 bytes for t_1][------------] : 208
109 // * rounds and final indicator flag are not serialized
110 if (_h.size() != 64 || _m.size() != blake2b_wrapper::BLAKE2B_BLOCKBYTES || _t0_offset.size() != 8 || _t1_offset.size() != 8) {
111 return blake2b_error::input_len_error;
112 }
113
114 blake2b_wrapper b2wrapper;
115 blake2b_state state{};
116
117 memcpy(state.h, _h.data(), 64);
118
119 // final indicator flag set words to 1's if true
120 state.f[0] = _f ? std::numeric_limits<uint64_t>::max() : 0;
121
122 memcpy(&state.t[0], _t0_offset.data(), 8);
123 memcpy(&state.t[1], _t1_offset.data(), 8);
124
125 uint8_t block[blake2b_wrapper::BLAKE2B_BLOCKBYTES];
126 memcpy(block, _m.data(), blake2b_wrapper::BLAKE2B_BLOCKBYTES);
127
128 b2wrapper.blake2b_compress(&state, block, _rounds, yield);
129
130 bytes out(sizeof(state.h), 0);
131 memcpy(&out[0], &state.h[0], out.size());
132 return out;
133}
unsigned char uint8_t
Definition stdint.h:124
memcpy((char *) pInfo->slotDescription, s, l)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ BlockToBytes()

void fc::BlockToBytes ( sblock const & b,
unsigned char * p )
inline

Definition at line 425 of file blowfish.cpp.

426{
427 unsigned int y;
428 //Right
429 y = b.m_uir;
430 *--p = Byte(y);
431 y = b.m_uir >> 8;
432 *--p = Byte(y);
433 y = b.m_uir >> 16;
434 *--p = Byte(y);
435 y = b.m_uir >> 24;
436 *--p = Byte(y);
437 //Left
438 y = b.m_uil;
439 *--p = Byte(y);
440 y = b.m_uil >> 8;
441 *--p = Byte(y);
442 y = b.m_uil >> 16;
443 *--p = Byte(y);
444 y = b.m_uil >> 24;
445 *--p = Byte(y);
446}
unsigned char Byte(unsigned int ui)
Definition blowfish.cpp:14
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Byte()

unsigned char fc::Byte ( unsigned int ui)
inline

Definition at line 14 of file blowfish.cpp.

15{
16 return (unsigned char)(ui & 0xff);
17}
Here is the caller graph for this function:

◆ BytesToBlock()

void fc::BytesToBlock ( unsigned char const * p,
sblock & b )
inline

Definition at line 394 of file blowfish.cpp.

395{
396 unsigned int y;
397 //Left
398 b.m_uil = 0;
399 y = *p++;
400 y <<= 24;
401 b.m_uil |= y;
402 y = *p++;
403 y <<= 16;
404 b.m_uil |= y;
405 y = *p++;
406 y <<= 8;
407 b.m_uil |= y;
408 y = *p++;
409 b.m_uil |= y;
410 //Right
411 b.m_uir = 0;
412 y = *p++;
413 y <<= 24;
414 b.m_uir |= y;
415 y = *p++;
416 y <<= 16;
417 b.m_uir |= y;
418 y = *p++;
419 y <<= 8;
420 b.m_uir |= y;
421 y = *p++;
422 b.m_uir |= y;
423}
unsigned int m_uil
Definition blowfish.hpp:136
unsigned int m_uir
Definition blowfish.hpp:136
Here is the caller graph for this function:

◆ call_fused()

template<typename Functor >
auto fc::call_fused ( Functor f,
const tuple<> & t ) -> decltype( f( ) )

Definition at line 64 of file tuple.hpp.

64 {
65 return f();
66 }

◆ canonical()

fc::path fc::canonical ( const path & p)

Definition at line 357 of file filesystem.cpp.

357 {
358 try {
359 return boost::filesystem::canonical(p);
360 } catch ( ... ) {
361 FC_THROW( "Unable to resolve path '${path}'", ( "path", p )("exception", fc::except_str() ) );
362 }
363 }
std::string except_str()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cap_error_code()

std::optional< uint64_t > fc::cap_error_code ( const std::optional< uint64_t > & error_code)
inline

Definition at line 572 of file serialization.hpp.

572 {
573 std::optional<uint64_t> result;
574
575 if (!error_code)
576 return result;
577
579
580 if (*error_code >= upper_limit) {
581 result = upper_limit;
582 return result;
583 }
584
585 result = error_code;
586 return result;
587}
unsigned __int64 uint64_t
Definition stdint.h:136

◆ check_size()

template<uint64_t RequiredSize, uint64_t ProvidedSize>
void fc::check_size ( )

Definition at line 58 of file fwd_impl.hpp.

58{ static_assert( (ProvidedSize >= RequiredSize), "Failed to reserve enough space in fc::fwd<T,S>" ); }
Here is the caller graph for this function:

◆ check_udt_errors()

void fc::check_udt_errors ( )

Definition at line 14 of file udt_socket.cpp.

15 {
16 UDT::ERRORINFO& error_info = UDT::getlasterror();
17 if( error_info.getErrorCode() )
18 {
19 std::string error_message = error_info.getErrorMessage();
20 error_info.clear();
21 FC_CAPTURE_AND_THROW( udt_exception, (error_message) );
22 }
23 }
#define FC_CAPTURE_AND_THROW(EXCEPTION_TYPE,...)
Here is the caller graph for this function:

◆ chmod()

void fc::chmod ( const path & p,
int perm )

Definition at line 302 of file filesystem.cpp.

303 {
304#ifndef WIN32
305 mode_t actual_perm =
306 ((perm & 0400) ? S_IRUSR : 0)
307 | ((perm & 0200) ? S_IWUSR : 0)
308 | ((perm & 0100) ? S_IXUSR : 0)
309
310 | ((perm & 0040) ? S_IRGRP : 0)
311 | ((perm & 0020) ? S_IWGRP : 0)
312 | ((perm & 0010) ? S_IXGRP : 0)
313
314 | ((perm & 0004) ? S_IROTH : 0)
315 | ((perm & 0002) ? S_IWOTH : 0)
316 | ((perm & 0001) ? S_IXOTH : 0)
317 ;
318
319 int result = ::chmod( p.string().c_str(), actual_perm );
320 if( result != 0 )
321 FC_THROW( "chmod operation failed on ${p}", ("p",p) );
322#endif
323 return;
324 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ city_hash128()

uint128 fc::city_hash128 ( const char * s,
size_t len )

Definition at line 536 of file city.cpp.

536 {
537 return len >= 16 ?
538 CityHash128WithSeed(s + 16, len - 16,
539 uint128(Fetch64(s), Fetch64(s + 8) + k0)) :
540 CityHash128WithSeed(s, len, uint128(k0, k1));
541}
an implementation of 128 bit unsigned integer
Definition uint128.hpp:22
uint128 CityHash128WithSeed(const char *s, size_t len, uint128 seed)
Definition city.cpp:473
Here is the call graph for this function:
Here is the caller graph for this function:

◆ city_hash32()

uint32_t fc::city_hash32 ( const char * buf,
size_t len )

Definition at line 217 of file city.cpp.

217 {
218 if (len <= 24) {
219 return len <= 12 ?
220 (len <= 4 ? Hash32Len0to4(s, len) : Hash32Len5to12(s, len)) :
221 Hash32Len13to24(s, len);
222 }
223
224 // len > 24
225 uint32_t h = len, g = c1 * len, f = g;
226 uint32_t a0 = Rotate32(Fetch32(s + len - 4) * c1, 17) * c2;
227 uint32_t a1 = Rotate32(Fetch32(s + len - 8) * c1, 17) * c2;
228 uint32_t a2 = Rotate32(Fetch32(s + len - 16) * c1, 17) * c2;
229 uint32_t a3 = Rotate32(Fetch32(s + len - 12) * c1, 17) * c2;
230 uint32_t a4 = Rotate32(Fetch32(s + len - 20) * c1, 17) * c2;
231 h ^= a0;
232 h = Rotate32(h, 19);
233 h = h * 5 + 0xe6546b64;
234 h ^= a2;
235 h = Rotate32(h, 19);
236 h = h * 5 + 0xe6546b64;
237 g ^= a1;
238 g = Rotate32(g, 19);
239 g = g * 5 + 0xe6546b64;
240 g ^= a3;
241 g = Rotate32(g, 19);
242 g = g * 5 + 0xe6546b64;
243 f += a4;
244 f = Rotate32(f, 19);
245 f = f * 5 + 0xe6546b64;
246 size_t iters = (len - 1) / 20;
247 do {
248 uint32_t a0 = Rotate32(Fetch32(s) * c1, 17) * c2;
249 uint32_t a1 = Fetch32(s + 4);
250 uint32_t a2 = Rotate32(Fetch32(s + 8) * c1, 17) * c2;
251 uint32_t a3 = Rotate32(Fetch32(s + 12) * c1, 17) * c2;
252 uint32_t a4 = Fetch32(s + 16);
253 h ^= a0;
254 h = Rotate32(h, 18);
255 h = h * 5 + 0xe6546b64;
256 f += a1;
257 f = Rotate32(f, 19);
258 f = f * c1;
259 g += a2;
260 g = Rotate32(g, 18);
261 g = g * 5 + 0xe6546b64;
262 h ^= a3 + a1;
263 h = Rotate32(h, 19);
264 h = h * 5 + 0xe6546b64;
265 g ^= a4;
266 g = bswap_32(g) * 5;
267 h += a4 * 5;
268 h = bswap_32(h);
269 f += a0;
270 PERMUTE3(f, h, g);
271 s += 20;
272 } while (--iters != 0);
273 g = Rotate32(g, 11) * c1;
274 g = Rotate32(g, 17) * c1;
275 f = Rotate32(f, 11) * c1;
276 f = Rotate32(f, 17) * c1;
277 h = Rotate32(h + g, 19);
278 h = h * 5 + 0xe6546b64;
279 h = Rotate32(h, 17) * c1;
280 h = Rotate32(h + f, 19);
281 h = h * 5 + 0xe6546b64;
282 h = Rotate32(h, 17) * c1;
283 return h;
284}
#define PERMUTE3(a, b, c)
Definition city.cpp:174
unsigned int uint32_t
Definition stdint.h:126
Here is the caller graph for this function:

◆ city_hash64()

uint64_t fc::city_hash64 ( const char * buf,
size_t len )

Definition at line 394 of file city.cpp.

394 {
395 if (len <= 32) {
396 if (len <= 16) {
397 return HashLen0to16(s, len);
398 } else {
399 return HashLen17to32(s, len);
400 }
401 } else if (len <= 64) {
402 return HashLen33to64(s, len);
403 }
404
405 // For strings over 64 bytes we hash the end first, and then as we
406 // loop we keep 56 bytes of state: v, w, x, y, and z.
407 uint64_t x = Fetch64(s + len - 40);
408 uint64_t y = Fetch64(s + len - 16) + Fetch64(s + len - 56);
409 uint64_t z = HashLen16(Fetch64(s + len - 48) + len, Fetch64(s + len - 24));
410 pair<uint64_t, uint64_t> v = WeakHashLen32WithSeeds(s + len - 64, len, z);
411 pair<uint64_t, uint64_t> w = WeakHashLen32WithSeeds(s + len - 32, y + k1, x);
412 x = x * k1 + Fetch64(s);
413
414 // Decrease len to the nearest multiple of 64, and operate on 64-byte chunks.
415 len = (len - 1) & ~static_cast<size_t>(63);
416 do {
417 x = Rotate(x + y + v.first + Fetch64(s + 8), 37) * k1;
418 y = Rotate(y + v.second + Fetch64(s + 48), 42) * k1;
419 x ^= w.second;
420 y += v.first + Fetch64(s + 40);
421 z = Rotate(z + w.first, 33) * k1;
422 v = WeakHashLen32WithSeeds(s, v.second * k1, x + w.first);
423 w = WeakHashLen32WithSeeds(s + 32, z + w.second, y + Fetch64(s + 16));
424 std::swap(z, x);
425 s += 64;
426 len -= 64;
427 } while (len != 0);
428 return HashLen16(HashLen16(v.first, w.first) + ShiftMix(y) * k1 + z,
429 HashLen16(v.second, w.second) + x);
430}
void swap(picojson::value &x, picojson::value &y)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ city_hash_crc_128()

uint128 fc::city_hash_crc_128 ( const char * s,
size_t len )

Definition at line 671 of file city.cpp.

671 {
672 if (len <= 900) {
673 return city_hash128(s, len);
674 } else {
675 uint64_t result[4];
676 CityHashCrc256(s, len, result);
677 return uint128(result[2], result[3]);
678 }
679}
uint128 city_hash128(const char *s, size_t len)
Definition city.cpp:536
Here is the call graph for this function:

◆ city_hash_crc_256()

array< uint64_t, 4 > fc::city_hash_crc_256 ( const char * s,
size_t len )

Definition at line 651 of file city.cpp.

652{
655 return buf;
656}
void CityHashCrc256(const char *s, size_t len, uint64_t *result)
Definition city.cpp:643
uint8_t buf[2048]
Here is the call graph for this function:

◆ city_hash_crc_64()

uint64_t fc::city_hash_crc_64 ( const char * buf,
size_t len )

◆ city_hash_size_t()

size_t fc::city_hash_size_t ( const char * buf,
size_t len )
inline

Definition at line 62 of file city.hpp.

62{ return city_hash32(buf, len); }
uint32_t city_hash32(const char *buf, size_t len)
Definition city.cpp:217
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CityHash128WithSeed()

uint128 fc::CityHash128WithSeed ( const char * s,
size_t len,
uint128 seed )

Definition at line 473 of file city.cpp.

473 {
474 if (len < 128) {
475 return CityMurmur(s, len, seed);
476 }
477
478 // We expect len >= 128 to be the common case. Keep 56 bytes of state:
479 // v, w, x, y, and z.
480 pair<uint64_t, uint64_t> v, w;
481 uint64_t x = Uint128Low64(seed);
482 uint64_t y = Uint128High64(seed);
483 uint64_t z = len * k1;
484 v.first = Rotate(y ^ k1, 49) * k1 + Fetch64(s);
485 v.second = Rotate(v.first, 42) * k1 + Fetch64(s + 8);
486 w.first = Rotate(y + z, 35) * k1 + x;
487 w.second = Rotate(x + Fetch64(s + 88), 53) * k1;
488
489 // This is the same inner loop as CityHash64(), manually unrolled.
490 do {
491 x = Rotate(x + y + v.first + Fetch64(s + 8), 37) * k1;
492 y = Rotate(y + v.second + Fetch64(s + 48), 42) * k1;
493 x ^= w.second;
494 y += v.first + Fetch64(s + 40);
495 z = Rotate(z + w.first, 33) * k1;
496 v = WeakHashLen32WithSeeds(s, v.second * k1, x + w.first);
497 w = WeakHashLen32WithSeeds(s + 32, z + w.second, y + Fetch64(s + 16));
498 std::swap(z, x);
499 s += 64;
500 x = Rotate(x + y + v.first + Fetch64(s + 8), 37) * k1;
501 y = Rotate(y + v.second + Fetch64(s + 48), 42) * k1;
502 x ^= w.second;
503 y += v.first + Fetch64(s + 40);
504 z = Rotate(z + w.first, 33) * k1;
505 v = WeakHashLen32WithSeeds(s, v.second * k1, x + w.first);
506 w = WeakHashLen32WithSeeds(s + 32, z + w.second, y + Fetch64(s + 16));
507 std::swap(z, x);
508 s += 64;
509 len -= 128;
510 } while (LIKELY(len >= 128));
511 x += Rotate(v.first + z, 49) * k0;
512 y = y * k0 + Rotate(w.second, 37);
513 z = z * k0 + Rotate(w.first, 27);
514 w.first *= 9;
515 v.first *= k0;
516 // If 0 < len < 128, hash up to 4 chunks of 32 bytes each from the end of s.
517 for (size_t tail_done = 0; tail_done < len; ) {
518 tail_done += 32;
519 y = Rotate(x + y, 42) * k0 + v.second;
520 w.first += Fetch64(s + len - tail_done + 16);
521 x = x * k0 + w.first;
522 z += w.second + Fetch64(s + len - tail_done);
523 w.second += v.first;
524 v = WeakHashLen32WithSeeds(s + len - tail_done, v.first + z, v.second);
525 v.first *= k0;
526 }
527 // At this point our 56 bytes of state should contain more than
528 // enough information for a strong 128-bit hash. We use two
529 // different 56-byte-to-8-byte hashes to get a 16-byte final result.
530 x = HashLen16(x, v.first);
531 y = HashLen16(y + z, w.first);
532 return uint128(HashLen16(x + v.second, w.second) + y,
533 HashLen16(x + w.second, y + v.second));
534}
#define LIKELY(x)
Definition city.cpp:136
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CityHash64WithSeed()

uint64_t fc::CityHash64WithSeed ( const char * s,
size_t len,
uint64_t seed )

Definition at line 437 of file city.cpp.

437 {
438 return CityHash64WithSeeds(s, len, k2, seed);
439}
uint64_t CityHash64WithSeeds(const char *s, size_t len, uint64_t seed0, uint64_t seed1)
Definition city.cpp:432
Here is the call graph for this function:

◆ CityHash64WithSeeds()

uint64_t fc::CityHash64WithSeeds ( const char * s,
size_t len,
uint64_t seed0,
uint64_t seed1 )

Definition at line 432 of file city.cpp.

433 {
434 return HashLen16(city_hash64(s, len) - seed0, seed1);
435}
uint64_t city_hash64(const char *buf, size_t len)
Definition city.cpp:394
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CityHashCrc128WithSeed()

uint128 fc::CityHashCrc128WithSeed ( const char * s,
size_t len,
uint128 seed )

Definition at line 658 of file city.cpp.

658 {
659 if (len <= 900) {
660 return CityHash128WithSeed(s, len, seed);
661 } else {
662 uint64_t result[4];
663 CityHashCrc256(s, len, result);
664 uint64_t u = Uint128High64(seed) + result[0];
665 uint64_t v = Uint128Low64(seed) + result[1];
666 return uint128(HashLen16(u, v + result[2]),
667 HashLen16(Rotate(v, 32), u * k0 + result[3]));
668 }
669}
Here is the call graph for this function:

◆ CityHashCrc256()

void fc::CityHashCrc256 ( const char * s,
size_t len,
uint64_t * result )

Definition at line 643 of file city.cpp.

643 {
644 if (LIKELY(len >= 240)) {
645 CityHashCrc256Long(s, len, 0, result);
646 } else {
647 CityHashCrc256Short(s, len, result);
648 }
649}
Here is the caller graph for this function:

◆ clean_append()

void fc::clean_append ( string & app,
const std::string_view & s,
size_t pos = 0,
size_t len = string::npos )

Definition at line 766 of file variant.cpp.

766 {
767 std::string_view sub = s.substr( pos, len );
768 app.reserve( app.size() + sub.size() );
769 const bool escape_control_chars = false;
770 app += escape_string( sub, nullptr, escape_control_chars );
771}
std::string escape_string(const std::string_view &str, const json::yield_function_t &yield, bool escape_control_chars=true)
Definition json.cpp:495
void sub(const Operand &op, uint32 imm)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ configure_logging() [1/2]

void fc::configure_logging ( const fc::path & log_config)

Definition at line 52 of file logger_config.cpp.

52 {
54 }
static variant from_file(const fc::path &p, const parse_type ptype=parse_type::legacy_parser, const uint32_t max_depth=DEFAULT_MAX_RECURSION_DEPTH)
Definition json.cpp:797
void configure_logging(const bfs::path &config_path)
Definition main.cpp:19
Here is the call graph for this function:
Here is the caller graph for this function:

◆ configure_logging() [2/2]

bool fc::configure_logging ( const logging_config & l)

Definition at line 55 of file logger_config.cpp.

55 {
56 return log_config::configure_logging( cfg );
57 }
Here is the call graph for this function:

◆ const_strlen()

size_t fc::const_strlen ( const char * str)
constexpr

Definition at line 142 of file utility.hpp.

142 {
143 int i = 0;
144 while(*(str+i) != '\0')
145 i++;
146 return i;
147 }
Here is the caller graph for this function:

◆ copy()

void fc::copy ( const path & from,
const path & to )

Definition at line 249 of file filesystem.cpp.

249 {
250 boost::system::error_code ec;
251 try {
252 #if BOOST_VERSION > 107300
253 if (exists(t)){
254 throw boost::system::system_error(boost::system::errc::make_error_code(boost::system::errc::errc_t::file_exists));
255 }
256 if ( boost::filesystem::is_directory( f ) ) {
257 boost::filesystem::copy(boost::filesystem::path(f),
258 boost::filesystem::path(t),
259 boost::filesystem::copy_options::directories_only,
260 ec );
261 } else {
262 boost::filesystem::copy(boost::filesystem::path(f),
263 boost::filesystem::path(t),
264 boost::filesystem::copy_options::none,
265 ec );
266 }
267 #else
268 boost::filesystem::copy( boost::filesystem::path(f), boost::filesystem::path(t), ec );
269 #endif
270 } catch ( boost::system::system_error& e ) {
271 FC_THROW( "Copy from ${srcfile} to ${dstfile} failed because ${reason}",
272 ("srcfile",f)("dstfile",t)("reason",e.what() ) );
273 } catch ( ... ) {
274 FC_THROW( "Copy from ${srcfile} to ${dstfile} failed",
275 ("srcfile",f)("dstfile",t)("inner", fc::except_str() ) );
276 }
277 if( ec ) {
278 FC_THROW( "Copy from ${srcfile} to ${dstfile} failed because ${reason}, category: ${cat}",
279 ("srcfile",f)("dstfile",t)("reason", ec.message())("cat", ec.category().name()) );
280 }
281 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ copy_append()

template<typename Container >
void fc::copy_append ( Container & dest,
const Container & src )

Definition at line 162 of file utility.hpp.

162 {
163 if (src.empty()) {
164 return;
165 } else {
166 dest.insert(std::end(dest), std::begin(src), std::end(src));
167 }
168 }

◆ copy_exception()

template<typename T >
fc::exception_ptr fc::copy_exception ( T && e)

Definition at line 198 of file exception.hpp.

199 {
200#if defined(_MSC_VER) && (_MSC_VER < 1700)
201 return std::make_shared<unhandled_exception>( log_message(),
202 std::copy_exception(fc::forward<T>(e)) );
203#else
204 return std::make_shared<unhandled_exception>( log_message(),
205 std::make_exception_ptr(fc::forward<T>(e)) );
206#endif
207 }
aggregates a message along with the context and associated meta-information.
Here is the caller graph for this function:

◆ create_directories()

void fc::create_directories ( const path & p)

Definition at line 218 of file filesystem.cpp.

218 {
219 try {
220 boost::filesystem::create_directories(p);
221 } catch ( ... ) {
222 FC_THROW( "Unable to create directories ${path}", ("path", p )("inner", fc::except_str() ) );
223 }
224 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_hard_link()

void fc::create_hard_link ( const path & from,
const path & to )

Definition at line 342 of file filesystem.cpp.

342 {
343 try {
344 boost::filesystem::create_hard_link( f, t );
345 } catch ( ... ) {
346 FC_THROW( "Unable to create hard link from '${from}' to '${to}'",
347 ( "from", f )("to",t)("exception", fc::except_str() ) );
348 }
349 }
Here is the call graph for this function:

◆ create_zipkin_variant()

fc::variant fc::create_zipkin_variant ( zipkin_span::span_data && span,
const std::string & service_name )

Definition at line 121 of file zipkin.cpp.

121 {
122 // https://zipkin.io/zipkin-api/
123 // std::string traceId; // [a-f0-9]{16,32} unique id for trace, all children spans shared same id
124 // std::string name; // logical operation, should have low cardinality
125 // std::string parentId; // The parent span id, or absent if root span
126 // std::string id // a-f0-9]{16}
127 // int64_t timestamp // epoch microseconds of start of span
128 // int64_t duration // microseconds of span
129
130 uint64_t trace_id;
131 if( span.parent_id != 0 ) {
132 trace_id = span.parent_id;
133 } else {
134 trace_id = span.id;
135 }
136
138 mvo( "id", fc::to_hex( reinterpret_cast<const char*>(&span.id), sizeof( span.id ) ) );
139 mvo( "traceId", fc::to_hex( reinterpret_cast<const char*>(&trace_id), sizeof( trace_id ) ) );
140 if( span.parent_id != 0 ) {
141 mvo( "parentId", fc::to_hex( reinterpret_cast<const char*>(&span.parent_id), sizeof( span.parent_id ) ) );
142 }
143 mvo( "name", std::move( span.name ) );
144 mvo( "timestamp", span.start.time_since_epoch().count() );
145 mvo( "duration", (span.stop - span.start).count() );
146 mvo( "localEndpoint", fc::variant_object( "serviceName", service_name ) );
147
148 mvo( "tags", std::move( span.tags ) );
149 span.id = 0; // stop destructor of span from calling log again
150
151 // /api/v2/spans takes an array of spans
152 fc::variants result;
153 result.emplace_back( std::move( mvo ) );
154
155 return result;
156}
An order-preserving dictionary of variants.
An order-preserving dictionary of variants.
fc::string to_hex(const char *d, uint32_t s)
Definition hex.cpp:17
sysio::vm::span< T, Extent > span
Definition common.hpp:26
Here is the call graph for this function:
Here is the caller graph for this function:

◆ current_path()

const fc::path & fc::current_path ( )
Returns
application executable path

Definition at line 521 of file filesystem.cpp.

522 {
523 static fc::path appCurrentPath = boost::filesystem::current_path();
524 return appCurrentPath;
525 }

◆ days()

microseconds fc::days ( int64_t d)
inlineconstexpr

Definition at line 36 of file time.hpp.

36{ return hours(24*d); }
constexpr microseconds hours(int64_t h)
Definition time.hpp:35
Here is the call graph for this function:
Here is the caller graph for this function:

◆ decode_fp2_element()

std::variant< alt_bn128_error, libff::alt_bn128_Fq2 > fc::decode_fp2_element ( const bytes & bytes64_be)
noexcept

Definition at line 68 of file alt_bn128.cpp.

68 {
69 if(bytes64_be.size() != 64) {
70 return alt_bn128_error::input_len_error;
71 }
72
73 // big-endian encoding
74 bytes sub1(bytes64_be.begin()+32, bytes64_be.begin()+64);
75 bytes sub2(bytes64_be.begin(), bytes64_be.begin()+32);
76
77 Scalar c0{to_scalar(sub1)};
78 Scalar c1{to_scalar(sub2)};
79
80 if (!valid_element_of_fp(c0) || !valid_element_of_fp(c1)) {
81 return alt_bn128_error::operand_component_invalid;
82 }
83
84 return libff::alt_bn128_Fq2{c0, c1};
85 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ decode_g1_element()

std::variant< alt_bn128_error, libff::alt_bn128_G1 > fc::decode_g1_element ( const bytes & bytes64_be)
noexcept

Definition at line 42 of file alt_bn128.cpp.

42 {
43 if(bytes64_be.size() != 64) {
44 return alt_bn128_error::input_len_error;
45 }
46
47 bytes sub1(bytes64_be.begin(), bytes64_be.begin()+32);
48 bytes sub2(bytes64_be.begin()+32, bytes64_be.begin()+64);
49
50 Scalar x{to_scalar(sub1)};
51 Scalar y{to_scalar(sub2)};
52
53 if (!valid_element_of_fp(x) || !valid_element_of_fp(y)) {
54 return alt_bn128_error::operand_component_invalid;
55 }
56
57 if (x.is_zero() && y.is_zero()) {
59 }
60
62 if (!point.is_well_formed()) {
63 return alt_bn128_error::operand_not_in_curve;
64 }
65 return point;
66 }
static alt_bn128_G1 zero()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ decode_g2_element()

std::variant< alt_bn128_error, libff::alt_bn128_G2 > fc::decode_g2_element ( const bytes & bytes128_be)
noexcept

Definition at line 87 of file alt_bn128.cpp.

87 {
88 if(bytes128_be.size() != 128) {
89 return alt_bn128_error::input_len_error;
90 }
91
92 bytes sub1(bytes128_be.begin(), bytes128_be.begin()+64);
93 auto maybe_x = decode_fp2_element(sub1);
94 if (std::holds_alternative<alt_bn128_error>(maybe_x)) {
95 return std::get<alt_bn128_error>(maybe_x);
96 }
97
98 bytes sub2(bytes128_be.begin()+64, bytes128_be.begin()+128);
99 auto maybe_y = decode_fp2_element(sub2);
100 if (std::holds_alternative<alt_bn128_error>(maybe_y)) {
101 return std::get<alt_bn128_error>(maybe_y);
102 }
103
104 const auto& x = std::get<libff::alt_bn128_Fq2>(maybe_x);
105 const auto& y = std::get<libff::alt_bn128_Fq2>(maybe_y);
106
107 if (x.is_zero() && y.is_zero()) {
109 }
110
112 if (!point.is_well_formed()) {
113 return alt_bn128_error::operand_not_in_curve;
114 }
115
116 if (!(libff::alt_bn128_G2::order() * point).is_zero()) {
117 // wrong order, doesn't belong to the subgroup G2
118 return alt_bn128_error::operand_outside_g2;
119 }
120
121 return point;
122 }
static alt_bn128_G2 zero()
static bigint< scalar_field::num_limbs > order()
std::variant< alt_bn128_error, libff::alt_bn128_Fq2 > decode_fp2_element(const bytes &bytes64_be) noexcept
Definition alt_bn128.cpp:68
Here is the call graph for this function:
Here is the caller graph for this function:

◆ decodeUtf8()

void fc::decodeUtf8 ( const std::string & input,
std::wstring * storage )

Decodes utf 8 std::string into unicode string.

Parameters
input- input string to be decoded and stored in 'storage'
storage- buffer for converted text. Cannot be nullptr.

Definition at line 71 of file utf8.cpp.

72 {
73 FC_ASSERT(storage != nullptr);
74
75 utf8::utf8to32(input.begin(), input.end(), std::back_inserter(*storage));
76 }
u32bit_iterator utf8to32(octet_iterator start, octet_iterator end, u32bit_iterator result)
Definition checked.h:258
Here is the call graph for this function:
Here is the caller graph for this function:

◆ deduplicate()

template<typename Container >
void fc::deduplicate ( Container & entries)

Definition at line 171 of file utility.hpp.

171 {
172 if (entries.size() > 1) {
173 std::sort( entries.begin(), entries.end() );
174 auto itr = std::unique( entries.begin(), entries.end() );
175 entries.erase( itr, entries.end() );
176 }
177 }

◆ default_epool_service()

udt_epoll_service & fc::default_epool_service ( )

Definition at line 145 of file udt_socket.cpp.

146 {
147 static udt_epoll_service* default_service = new udt_epoll_service();
148 return *default_service;
149 }

◆ digest()

template<typename T >
fc::sha256 fc::digest ( const T & value)

Definition at line 9 of file digest.hpp.

10 {
12 fc::raw::pack( enc, value );
13 return enc.result();
14 }
#define value
Definition pkcs11.h:157
Here is the call graph for this function:
Here is the caller graph for this function:

◆ directory_size()

uint64_t fc::directory_size ( const path & p)

Definition at line 229 of file filesystem.cpp.

230 {
231 try {
233
235 uint64_t size = 0;
236 for( recursive_directory_iterator itr( p ); itr != end; ++itr )
237 {
238 if( is_regular_file( *itr ) )
239 size += file_size( *itr );
240 }
241
242 return size;
243 } catch ( ... ) {
244 FC_THROW( "Unable to calculate size of directory ${path}", ("path", p )("inner", fc::except_str() ) );
245 }
246 }
bool is_regular_file(const path &p)
uint64_t file_size(const path &p)
bool is_directory(const path &p)
Here is the call graph for this function:

◆ double_to_float64()

void fc::double_to_float64 ( const double & d,
float64_t & f )
inline

Definition at line 115 of file database_utils.hpp.

115 {
116 memcpy(&f, &d, sizeof(f));
117 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ encode_g1_element()

bytes fc::encode_g1_element ( libff::alt_bn128_G1 p)
noexcept

Definition at line 124 of file alt_bn128.cpp.

124 {
125 bytes out(64, '\0');
126 if (p.is_zero()) {
127 return out;
128 }
129
130 p.to_affine_coordinates();
131
132 auto x{p.X.as_bigint()};
133 auto y{p.Y.as_bigint()};
134
135 std::memcpy(&out[0], y.data, 32);
136 std::memcpy(&out[32], x.data, 32);
137
138 std::reverse(out.begin(), out.end());
139 return out;
140 }
std::vector< char > bytes
Definition alt_bn128.hpp:10
Here is the caller graph for this function:

◆ encodeUtf8()

void fc::encodeUtf8 ( const std::wstring & input,
std::string * storage )

Encodes given wide (unicode) string into UTF-8 representation.

Parameters
input- input string to be encoded and stored in 'storage'
storage- buffer for converted text. Cannot be nullptr.

Definition at line 78 of file utf8.cpp.

79 {
80 FC_ASSERT(storage != nullptr);
81
82 utf8::utf32to8(input.begin(), input.end(), std::back_inserter(*storage));
83 }
octet_iterator utf32to8(u32bit_iterator start, u32bit_iterator end, octet_iterator result)
Definition checked.h:249
Here is the call graph for this function:
Here is the caller graph for this function:

◆ endian_reverse_u32()

uint32_t fc::endian_reverse_u32 ( uint32_t x)
inline

Definition at line 19 of file bitutil.hpp.

20{
21 return (((x >> 0x18) & 0xFF) )
22 | (((x >> 0x10) & 0xFF) << 0x08)
23 | (((x >> 0x08) & 0xFF) << 0x10)
24 | (((x ) & 0xFF) << 0x18)
25 ;
26}
Here is the caller graph for this function:

◆ endian_reverse_u64()

uint64_t fc::endian_reverse_u64 ( uint64_t x)
inline

Definition at line 6 of file bitutil.hpp.

7{
8 return (((x >> 0x38) & 0xFF) )
9 | (((x >> 0x30) & 0xFF) << 0x08)
10 | (((x >> 0x28) & 0xFF) << 0x10)
11 | (((x >> 0x20) & 0xFF) << 0x18)
12 | (((x >> 0x18) & 0xFF) << 0x20)
13 | (((x >> 0x10) & 0xFF) << 0x28)
14 | (((x >> 0x08) & 0xFF) << 0x30)
15 | (((x ) & 0xFF) << 0x38)
16 ;
17}

◆ escape_string()

std::string fc::escape_string ( const std::string_view & str,
const json::yield_function_t & yield,
bool escape_control_chars )

Convert '\t', '\r', '
', '\' and '"' to "\t\r\n\\\"" if escape_control_chars == true Convert all other < 32 & 127 ascii to escaped unicode "\u00xx" Removes invalid utf8 characters Escapes Control sequence Introducer 0x9b to \u009b All other characters unmolested.

Definition at line 495 of file json.cpp.

496 {
497 string r;
498 const auto init_size = str.size();
499 r.reserve( init_size + 13 ); // allow for a few escapes
500 size_t i = 0;
501 for( auto itr = str.begin(); itr != str.end(); ++i,++itr )
502 {
503 if( i % json::escape_string_yield_check_count == 0 ) yield( init_size + r.size() );
504 switch( *itr )
505 {
506 case '\x00': r += "\\u0000"; break;
507 case '\x01': r += "\\u0001"; break;
508 case '\x02': r += "\\u0002"; break;
509 case '\x03': r += "\\u0003"; break;
510 case '\x04': r += "\\u0004"; break;
511 case '\x05': r += "\\u0005"; break;
512 case '\x06': r += "\\u0006"; break;
513 case '\x07': r += "\\u0007"; break; // \a is not valid JSON
514 case '\x08': r += "\\u0008"; break; // \b
515 // case '\x09': r += "\\u0009"; break; // \t
516 // case '\x0a': r += "\\u000a"; break; // \n
517 case '\x0b': r += "\\u000b"; break;
518 case '\x0c': r += "\\u000c"; break; // \f
519 // case '\x0d': r += "\\u000d"; break; // \r
520 case '\x0e': r += "\\u000e"; break;
521 case '\x0f': r += "\\u000f"; break;
522 case '\x10': r += "\\u0010"; break;
523 case '\x11': r += "\\u0011"; break;
524 case '\x12': r += "\\u0012"; break;
525 case '\x13': r += "\\u0013"; break;
526 case '\x14': r += "\\u0014"; break;
527 case '\x15': r += "\\u0015"; break;
528 case '\x16': r += "\\u0016"; break;
529 case '\x17': r += "\\u0017"; break;
530 case '\x18': r += "\\u0018"; break;
531 case '\x19': r += "\\u0019"; break;
532 case '\x1a': r += "\\u001a"; break;
533 case '\x1b': r += "\\u001b"; break;
534 case '\x1c': r += "\\u001c"; break;
535 case '\x1d': r += "\\u001d"; break;
536 case '\x1e': r += "\\u001e"; break;
537 case '\x1f': r += "\\u001f"; break;
538
539 case '\x7f': r += "\\u007f"; break;
540
541 // if escape_control_chars=true these fall-through to default
542 case '\t': // \x09
543 if( escape_control_chars ) {
544 r += "\\t";
545 break;
546 }
547 case '\n': // \x0a
548 if( escape_control_chars ) {
549 r += "\\n";
550 break;
551 }
552 case '\r': // \x0d
553 if( escape_control_chars ) {
554 r += "\\r";
555 break;
556 }
557 case '\\':
558 if( escape_control_chars ) {
559 r += "\\\\";
560 break;
561 }
562 case '\"':
563 if( escape_control_chars ) {
564 r += "\\\"";
565 break;
566 }
567 default:
568 r += *itr;
569 }
570 }
571
572 return is_valid_utf8( r ) ? r : prune_invalid_utf8( r );
573 }
const mie::Vuint & r
Definition bn.cpp:28
bool is_valid_utf8(const std::string_view &str)
Definition utf8.cpp:40
std::string prune_invalid_utf8(const std::string_view &str)
Definition utf8.cpp:47
size_t size() const
Definition zm.h:519
Here is the call graph for this function:
Here is the caller graph for this function:

◆ except_str()

fc::string fc::except_str ( )

Definition at line 269 of file exception.cpp.

270 {
271 return boost::current_exception_diagnostic_information();
272 }
Here is the caller graph for this function:

◆ exists()

bool fc::exists ( const path & p)

Definition at line 217 of file filesystem.cpp.

217{ return boost::filesystem::exists(p); }
Here is the caller graph for this function:

◆ FC_DECLARE_EXCEPTION() [1/18]

fc::FC_DECLARE_EXCEPTION ( aes_exception ,
aes_error_code ,
"AES error"  )

◆ FC_DECLARE_EXCEPTION() [2/18]

fc::FC_DECLARE_EXCEPTION ( assert_exception ,
assert_exception_code ,
"Assert Exception"  )

◆ FC_DECLARE_EXCEPTION() [3/18]

fc::FC_DECLARE_EXCEPTION ( bad_cast_exception ,
bad_cast_exception_code ,
"Bad Cast"  )

◆ FC_DECLARE_EXCEPTION() [4/18]

fc::FC_DECLARE_EXCEPTION ( canceled_exception ,
canceled_exception_code ,
"Canceled"  )

◆ FC_DECLARE_EXCEPTION() [5/18]

fc::FC_DECLARE_EXCEPTION ( divide_by_zero_exception ,
divide_by_zero_code ,
"Integer Divide By Zero"  )

◆ FC_DECLARE_EXCEPTION() [6/18]

fc::FC_DECLARE_EXCEPTION ( eof_exception ,
eof_exception_code ,
"End Of File"  )

◆ FC_DECLARE_EXCEPTION() [7/18]

fc::FC_DECLARE_EXCEPTION ( file_not_found_exception ,
file_not_found_exception_code ,
"File Not Found"  )

◆ FC_DECLARE_EXCEPTION() [8/18]

fc::FC_DECLARE_EXCEPTION ( invalid_arg_exception ,
invalid_arg_exception_code ,
"Invalid Argument"  )

◆ FC_DECLARE_EXCEPTION() [9/18]

fc::FC_DECLARE_EXCEPTION ( invalid_operation_exception ,
invalid_operation_exception_code ,
"Invalid Operation"  )

◆ FC_DECLARE_EXCEPTION() [10/18]

fc::FC_DECLARE_EXCEPTION ( key_not_found_exception ,
key_not_found_exception_code ,
"Key Not Found"  )

◆ FC_DECLARE_EXCEPTION() [11/18]

fc::FC_DECLARE_EXCEPTION ( null_optional ,
null_optional_code ,
"null optional"  )

◆ FC_DECLARE_EXCEPTION() [12/18]

fc::FC_DECLARE_EXCEPTION ( out_of_range_exception ,
out_of_range_exception_code ,
"Out of Range"  )

◆ FC_DECLARE_EXCEPTION() [13/18]

fc::FC_DECLARE_EXCEPTION ( overflow_exception ,
overflow_code ,
"Integer Overflow"  )

◆ FC_DECLARE_EXCEPTION() [14/18]

fc::FC_DECLARE_EXCEPTION ( parse_error_exception ,
parse_error_exception_code ,
"Parse Error"  )

◆ FC_DECLARE_EXCEPTION() [15/18]

fc::FC_DECLARE_EXCEPTION ( timeout_exception ,
timeout_exception_code ,
"Timeout"  )

◆ FC_DECLARE_EXCEPTION() [16/18]

fc::FC_DECLARE_EXCEPTION ( udt_exception ,
udt_error_code ,
"UDT error"  )

◆ FC_DECLARE_EXCEPTION() [17/18]

fc::FC_DECLARE_EXCEPTION ( underflow_exception ,
underflow_code ,
"Integer Underflow"  )

◆ FC_DECLARE_EXCEPTION() [18/18]

fc::FC_DECLARE_EXCEPTION ( unknown_host_exception ,
unknown_host_exception_code ,
"Unknown Host"  )

◆ file_size()

uint64_t fc::file_size ( const path & p)

Definition at line 227 of file filesystem.cpp.

227{ return boost::filesystem::file_size(p); }
Here is the caller graph for this function:

◆ find_executable_in_path()

fc::path fc::find_executable_in_path ( const fc::string name)

Definition at line 15 of file process.cpp.

15 {
16 try {
17 return fc::string(bp::find_executable_in_path( std::string(name), "" ));
18 } catch (...) {
19 const char* p = std::getenv("PATH");
20 FC_THROW( "Unable to find executable ${exe} in path.",
21 ("exe", name)
22 ("inner", fc::except_str() )
23 ("PATH", fc::string(p!=nullptr?p:"") ) );
24 }
25 return fc::path();
26}
std::string name
std::string string
Definition string.hpp:10
Here is the call graph for this function:

◆ find_invalid()

template<typename octet_iterator >
std::pair< octet_iterator, uint32_t > fc::find_invalid ( octet_iterator start,
octet_iterator end,
const std::pair< uint32_t, uint32_t > & invalid_range )

Definition at line 22 of file utf8.cpp.

24 {
25 FC_ASSERT( invalid_range.first <= invalid_range.second );
26 octet_iterator result = start;
28 while( result != end ) {
29 octet_iterator itr = result;
31 if( err_code != utf8::internal::UTF8_OK )
32 return {result, UINT32_MAX};
33 if( value >= invalid_range.first && value <= invalid_range.second )
34 return {itr, value};
35 }
36 return {result, UINT32_MAX};
37 }
utf_error validate_next(octet_iterator &it, octet_iterator end, uint32_t &code_point)
Definition core.h:223
#define UINT32_MAX
Definition stdint.h:188
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fixed_size()

string fc::fixed_size ( size_t s,
const string & str )

Definition at line 85 of file console_appender.cpp.

85 {
86 if( str.size() == s ) return str;
87 if( str.size() > s ) return str.substr( 0, s );
88 string tmp = str;
89 tmp.append( s - str.size(), ' ' );
90 return tmp;
91 }
Here is the caller graph for this function:

◆ float128_to_uint128()

void fc::float128_to_uint128 ( const float128_t & f,
sysio::chain::uint128_t & u )
inline

Definition at line 120 of file database_utils.hpp.

120 {
121 memcpy(&u, &f, sizeof(u));
122 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ float64_to_double()

void fc::float64_to_double ( const float64_t & f,
double & d )
inline

Definition at line 110 of file database_utils.hpp.

110 {
111 memcpy(&d, &f, sizeof(d));
112 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ format_string()

string fc::format_string ( const fc::string & frmt,
const variant_object & args,
bool minimize = false )

Definition at line 773 of file variant.cpp.

774{
775 std::string result;
776 const string& format = ( minimize && frmt.size() > minimize_max_size ) ?
777 frmt.substr( 0, minimize_max_size ) + "..." : frmt;
778
779 const auto arg_num = (args.size() == 0) ? 1 : args.size();
780 const auto max_format_size = std::max(minimize_max_size, format.size());
781 // limit each arg size when minimize is set
782 const auto minimize_sub_max_size = minimize ? ( max_format_size - format.size() ) / arg_num : minimize_max_size;
783 // reserve space for each argument replaced by ...
784 result.reserve( max_format_size + 3 * args.size());
785 size_t prev = 0;
786 size_t next = format.find( '$' );
787 while( prev != string::npos && prev < format.size() ) {
788 if( next != string::npos ) {
789 clean_append( result, format, prev, next - prev );
790 } else {
791 clean_append( result, format, prev );
792 }
793
794 // if we got to the end, return it.
795 if( next == string::npos ) {
796 return result;
797 } else if( minimize && result.size() > minimize_max_size ) {
798 result += "...";
799 return result;
800 }
801
802 // if we are not at the end, then update the start
803 prev = next + 1;
804
805 if( format[prev] == '{' ) {
806 // if the next char is a open, then find close
807 next = format.find( '}', prev );
808 // if we found close...
809 if( next != string::npos ) {
810 // the key is between prev and next
811 string key = format.substr( prev + 1, (next - prev - 1) );
812
813 auto val = args.find( key );
814 bool replaced = true;
815 if( val != args.end() ) {
816 if( val->value().is_object() || val->value().is_array() ) {
817 if( minimize && (result.size() >= minimize_max_size)) {
818 replaced = false;
819 } else {
820 const auto max_length = minimize ? minimize_sub_max_size : std::numeric_limits<uint64_t>::max();
821 try {
822 // clean_append not needed as to_string is valid utf8
823 result += json::to_string( val->value(), fc::time_point::maximum(),
824 json::output_formatting::stringify_large_ints_and_doubles, max_length );
825 } catch (...) {
826 replaced = false;
827 }
828 }
829 } else if( val->value().is_blob() ) {
830 if( minimize && val->value().get_blob().data.size() > minimize_sub_max_size ) {
831 replaced = false;
832 } else {
833 clean_append( result, val->value().as_string() );
834 }
835 } else if( val->value().is_string() ) {
836 if( minimize && val->value().get_string().size() > minimize_sub_max_size ) {
837 auto sz = std::min( minimize_sub_max_size, minimize_max_size - result.size() );
838 clean_append( result, val->value().get_string(), 0, sz );
839 result += "...";
840 } else {
841 clean_append( result, val->value().get_string() );
842 }
843 } else {
844 clean_append( result, val->value().as_string() );
845 }
846 } else {
847 replaced = false;
848 }
849 if( !replaced ) {
850 result += "${";
851 clean_append( result, key );
852 result += "}";
853 }
854 prev = next + 1;
855 // find the next $
856 next = format.find( '$', prev );
857 } else {
858 // we didn't find it.. continue to while...
859 }
860 } else {
861 clean_append( result, format, prev, 1 );
862 ++prev;
863 next = format.find( '$', prev );
864 }
865 }
866 return result;
867}
static constexpr time_point maximum()
Definition time.hpp:46
size_t size() const
iterator end() const
iterator find(const string &key) const
void clean_append(string &app, const std::string_view &s, size_t pos=0, size_t len=string::npos)
Definition variant.cpp:766
constexpr size_t minimize_max_size
Definition variant.cpp:763
uint32_t next(octet_iterator &it, octet_iterator end)
Definition checked.h:137
cmd_format format
Here is the call graph for this function:
Here is the caller graph for this function:

◆ from_base32()

std::vector< char > fc::from_base32 ( const fc::string & b32)

Definition at line 6 of file base32.cpp.

7 {
8 auto len = cyoBase32DecodeGetLength( b32.size() );
9 std::vector<char> v(len);
10 len = cyoBase32Decode( v.data(), b32.c_str(), b32.size() );
11 v.resize( len );
12 return v;
13 }

◆ from_base36()

std::vector< char > fc::from_base36 ( const fc::string & b36)

Definition at line 45 of file base36.cpp.

46 {
47 if ( b36.empty() ) {
48 std::vector<char> empty;
49 return empty;
50 }
51
53
54 fc::bigint pos = 0;
55 fc::bigint _36(36);
56 for( auto itr = b36.rbegin(); itr != b36.rend(); ++itr )
57 {
58 if( *itr >= '0' && *itr <= '9' )
59 value = value + _36.exp(pos) * fc::bigint(*itr - '0');
60 else if( *itr >= 'a' && *itr <= 'z' )
61 value = value + (_36.exp(pos) * fc::bigint(10+*itr - 'a'));
62 else if( *itr >= 'A' && *itr <= 'Z' )
63 value = value + (_36.exp(pos) * fc::bigint(10+*itr - 'A'));
64 else
65 {
66 wlog("unknown '${char}'", ("char",fc::string(&*itr,1)) );
67 }
68 ++pos;
69 }
70
71 std::vector<char> bytes = value;
72 int leading_zeros = 0, len = bytes.size();
73 const char *in = b36.c_str();
74 while (*in++ == '0') { leading_zeros++; }
75 char* first = bytes.data();
76 while (len > 0 && *first == 0) { first++; len--; }
77 std::vector<char> result;
78 result.resize(leading_zeros + len, 0);
79 memcpy( result.data() + leading_zeros, first, len );
80 return result;
81 }
#define wlog(FORMAT,...)
Definition logger.hpp:124
Here is the call graph for this function:

◆ from_base58() [1/2]

std::vector< char > fc::from_base58 ( const std::string & base58_str)

Definition at line 628 of file base58.cpp.

628 {
629 std::vector<unsigned char> out;
630 if( !DecodeBase58( base58_str.c_str(), out ) ) {
631 FC_THROW_EXCEPTION( parse_error_exception, "Unable to decode base58 string ${base58_str}", ("base58_str",base58_str) );
632 }
633 return std::vector<char>((const char*)out.data(), ((const char*)out.data())+out.size() );
634}
bool DecodeBase58(const char *psz, std::vector< unsigned char > &vchRet)
Definition base58.cpp:560
Here is the call graph for this function:
Here is the caller graph for this function:

◆ from_base58() [2/2]

size_t fc::from_base58 ( const std::string & base58_str,
char * out_data,
size_t out_data_len )
Returns
the number of bytes decoded

Definition at line 638 of file base58.cpp.

638 {
639 //slog( "%s", base58_str.c_str() );
640 std::vector<unsigned char> out;
641 if( !DecodeBase58( base58_str.c_str(), out ) ) {
642 FC_THROW_EXCEPTION( parse_error_exception, "Unable to decode base58 string ${base58_str}", ("base58_str",base58_str) );
643 }
644 FC_ASSERT( out.size() <= out_data_len );
645 memcpy( out_data, out.data(), out.size() );
646 return out.size();
647}
Here is the call graph for this function:

◆ from_hex() [1/2]

uint8_t fc::from_hex ( char c)

Definition at line 6 of file hex.cpp.

6 {
7 if( c >= '0' && c <= '9' )
8 return c - '0';
9 if( c >= 'a' && c <= 'f' )
10 return c - 'a' + 10;
11 if( c >= 'A' && c <= 'F' )
12 return c - 'A' + 10;
13 FC_THROW_EXCEPTION( exception, "Invalid hex character '${c}'", ("c", fc::string(&c,1) ) );
14 return 0;
15 }
Used to generate a useful error report when an exception is thrown.
Definition exception.hpp:58
Here is the caller graph for this function:

◆ from_hex() [2/2]

size_t fc::from_hex ( const fc::string & hex_str,
char * out_data,
size_t out_data_len )
Returns
the number of bytes decoded

Definition at line 27 of file hex.cpp.

27 {
28 fc::string::const_iterator i = hex_str.begin();
29 uint8_t* out_pos = (uint8_t*)out_data;
30 uint8_t* out_end = out_pos + out_data_len;
31 while( i != hex_str.end() && out_end != out_pos ) {
32 *out_pos = from_hex( *i ) << 4;
33 ++i;
34 if( i != hex_str.end() ) {
35 *out_pos |= from_hex( *i );
36 ++i;
37 }
38 ++out_pos;
39 }
40 return out_pos - (uint8_t*)out_data;
41 }
uint8_t from_hex(char c)
Definition hex.cpp:6
Here is the call graph for this function:

◆ from_index()

template<typename variant , int32_t i = 0>
void fc::from_index ( variant & v,
int index )

Definition at line 15 of file static_variant.hpp.

16{
17 if constexpr(i >= std::variant_size_v<variant>)
18 {
19 FC_THROW_EXCEPTION(fc::assert_exception, "Provided index out of range for variant.");
20 }
21 else if (index == 0)
22 {
23 auto value = variant(std::in_place_index<i>);
24 v = std::move(value);
25 }
26 else
27 {
28 from_index<variant, i + 1>(v, index - 1);
29 }
30}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ from_variant() [1/103]

void fc::from_variant ( const fc::variant & input_variant,
fc::microseconds & output_microseconds )

Definition at line 164 of file time.cpp.

165 {
166 output_microseconds = microseconds(input_variant.as_int64());
167 }
int64_t as_int64() const
Definition variant.cpp:377
Here is the call graph for this function:

◆ from_variant() [2/103]

void fc::from_variant ( const fc::variant & variant_to_convert,
fc::path & path_output )

Definition at line 43 of file filesystem.cpp.

44 {
45 std::wstring wide_string;
46 fc::decodeUtf8(variant_to_convert.as_string(), &wide_string);
47 path_output = path(wide_string);
48 }
string as_string() const
Definition variant.cpp:469
void decodeUtf8(const std::string &input, std::wstring *storage)
Definition utf8.cpp:71
Here is the call graph for this function:

◆ from_variant() [3/103]

template<typename T , typename... U>
void fc::from_variant ( const fc::variant & v,
bip::multiset< T, U... > & s )

Definition at line 75 of file container.hpp.

75 {
76 detail::from_variant_to_set( v, s );
77 }
Here is the call graph for this function:

◆ from_variant() [4/103]

template<typename T , typename... U>
void fc::from_variant ( const fc::variant & v,
bip::set< T, U... > & s )

Definition at line 65 of file container.hpp.

65 {
66 detail::from_variant_to_set( v, s );
67 }
Here is the call graph for this function:

◆ from_variant() [5/103]

template<typename T , typename... U>
void fc::from_variant ( const fc::variant & v,
boost::container::deque< T, U... > & d )

Definition at line 529 of file variant.hpp.

530 {
531 const variants& vars = v.get_array();
532 if( vars.size() > MAX_NUM_ARRAY_ELEMENTS ) throw std::range_error( "too large" );
533 d.clear();
534 d.resize( vars.size() );
535 for( uint32_t i = 0; i < vars.size(); ++i ) {
536 from_variant( vars[i], d[i] );
537 }
538 }
variants & get_array()
Definition variant.cpp:496
void from_variant(const fc::variant &v, sysio::chain::chain_id_type &cid)
#define MAX_NUM_ARRAY_ELEMENTS
Definition utility.hpp:18
CK_ULONG d
Here is the call graph for this function:

◆ from_variant() [6/103]

template<typename... U>
void fc::from_variant ( const fc::variant & v,
boost::container::vector< char, U... > & vec )

Definition at line 135 of file flat.hpp.

136 {
137 const auto& str = v.get_string();
138 FC_ASSERT( str.size() <= 2*MAX_SIZE_OF_BYTE_ARRAYS ); // Doubled because hex strings needs two characters per byte
139 vec.resize( str.size() / 2 );
140 if( vec.size() ) {
141 size_t r = fc::from_hex( str, vec.data(), vec.size() );
142 FC_ASSERT( r == vec.size() );
143 }
144 }
const string & get_string() const
Definition variant.cpp:606
#define MAX_SIZE_OF_BYTE_ARRAYS
Definition utility.hpp:19
Here is the call graph for this function:

◆ from_variant() [7/103]

template<typename T , typename... U>
void fc::from_variant ( const fc::variant & v,
boost::container::vector< T, U... > & vec )

Definition at line 115 of file flat.hpp.

115 {
116 const variants& vars = v.get_array();
117 FC_ASSERT( vars.size() <= MAX_NUM_ARRAY_ELEMENTS );
118 vec.clear();
119 vec.resize( vars.size() );
120 for( uint32_t i = 0; i < vars.size(); ++i ) {
121 from_variant( vars[i], vec[i] );
122 }
123 }
Here is the call graph for this function:

◆ from_variant() [8/103]

template<typename T , typename... Args>
void fc::from_variant ( const fc::variant & v,
boost::multi_index_container< T, Args... > & s )

Definition at line 683 of file variant.hpp.

684 {
685 const variants& vars = v.get_array();
686 c.clear();
687 for( const auto& item : vars )
688 c.insert( item.as<T>() );
689 }
#define T(meth, val, expected)
Here is the call graph for this function:

◆ from_variant() [9/103]

template<typename T >
void fc::from_variant ( const fc::variant & v,
boost::multiprecision::number< T > & n )

Definition at line 693 of file variant.hpp.

693 {
694 n = boost::multiprecision::number<T>(v.get_string());
695 }
Here is the call graph for this function:

◆ from_variant() [10/103]

template<typename T , typename... U>
void fc::from_variant ( const fc::variant & v,
flat_multiset< T, U... > & s )

Definition at line 162 of file flat.hpp.

162 {
163 detail::from_variant_to_flat_set( v, s );
164 }
Here is the call graph for this function:

◆ from_variant() [11/103]

template<typename T , typename... U>
void fc::from_variant ( const fc::variant & v,
flat_set< T, U... > & s )

Definition at line 152 of file flat.hpp.

152 {
153 detail::from_variant_to_flat_set( v, s );
154 }
Here is the call graph for this function:

◆ from_variant() [12/103]

void fc::from_variant ( const fc::variant & v,
params::permission_level & a )
inline

Overloaded from_variant to allow parsing an account with a permission wildcard (empty) from a string instead of an object

Parameters
v
a

Definition at line 113 of file account_query_db.hpp.

113 {
114 if (v.is_string()) {
115 from_variant(v, a.actor);
116 a.permission = {};
117 } else if (v.is_object()) {
118 const auto& vo = v.get_object();
119 if(vo.contains("actor"))
120 from_variant(vo["actor"], a.actor);
121 else
122 SYS_THROW(sysio::chain::invalid_http_request, "Missing Actor field");
123
124 if(vo.contains("permission") && vo.size() == 2)
125 from_variant(vo["permission"], a.permission);
126 else if (vo.size() == 1)
127 a.permission = {};
128 else
129 SYS_THROW(sysio::chain::invalid_http_request, "Unrecognized fields in account");
130 }
131 }
#define SYS_THROW(exc_type, FORMAT,...)
variant_object & get_object()
Definition variant.cpp:554
bool is_object() const
Definition variant.cpp:363
bool is_string() const
Definition variant.cpp:314
Here is the call graph for this function:

◆ from_variant() [13/103]

template<typename T >
void fc::from_variant ( const fc::variant & v,
safe< T > & s )

Definition at line 672 of file variant.hpp.

672{ s.value = v.as_uint64(); }
uint64_t as_uint64() const
Definition variant.cpp:398
Here is the call graph for this function:

◆ from_variant() [14/103]

template<typename A , typename B >
void fc::from_variant ( const fc::variant & v,
std::pair< A, B > & p )

Definition at line 606 of file variant.hpp.

607 {
608 const variants& vars = v.get_array();
609 if( vars.size() > 0 )
610 vars[0].as<A>( p.first );
611 if( vars.size() > 1 )
612 vars[1].as<B>( p.second );
613 }
Here is the call graph for this function:

◆ from_variant() [15/103]

template<typename T >
void fc::from_variant ( const fc::variant & v,
std::unique_ptr< T > & s )

Definition at line 657 of file variant.hpp.

658 {
659 if( var.is_null() ) vo.reset();
660 else if( vo ) from_variant( var, *vo );
661 else {
662 vo.reset( new T() );
663 from_variant( var, *vo );
664 }
665 }
Here is the call graph for this function:

◆ from_variant() [16/103]

template<typename... T>
void fc::from_variant ( const fc::variant & v,
std::variant< T... > & s )

Definition at line 79 of file static_variant.hpp.

80{
81 auto ar = v.get_array();
82 if( ar.size() < 2 )
83 {
84 s = std::variant<T...>();
85 return;
86 }
87 from_index(s, ar[0].as_uint64());
88 std::visit( to_static_variant(ar[1]), s );
89}
Here is the call graph for this function:

◆ from_variant() [17/103]

template<uint16_t IntervalMs, uint64_t EpochMs>
void fc::from_variant ( const fc::variant & v,
sysio::chain::block_timestamp< IntervalMs, EpochMs > & t )

Definition at line 90 of file block_timestamp.hpp.

90 {
91 t = v.as<fc::time_point>();
92 }
T as() const
Definition variant.hpp:327
Here is the call graph for this function:

◆ from_variant() [18/103]

void fc::from_variant ( const fc::variant & v,
sysio::chain::chain_id_type & cid )

Definition at line 18 of file chain_id_type.cpp.

18 {
19 from_variant( v, static_cast<fc::sha256&>(cid) );
20 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ from_variant() [19/103]

template<typename T >
void fc::from_variant ( const fc::variant & v,
sysio::chain::may_not_exist< T > & e )

Definition at line 164 of file abi_def.hpp.

164 {
165 from_variant( v, e.value );
166}
Here is the call graph for this function:

◆ from_variant() [20/103]

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

Definition at line 39 of file name.cpp.

39{ check.set( v.get_string() ); }
Here is the call graph for this function:

◆ from_variant() [21/103]

void fc::from_variant ( const fc::variant & v,
UInt< 16 > & n )

Definition at line 754 of file variant.cpp.

754{ n = static_cast<uint16_t>(v.as_uint64()); }
unsigned short uint16_t
Definition stdint.h:125
Here is the call graph for this function:

◆ from_variant() [22/103]

void fc::from_variant ( const fc::variant & v,
UInt< 32 > & n )

Definition at line 758 of file variant.cpp.

758{ n = static_cast<uint32_t>(v.as_uint64()); }
Here is the call graph for this function:

◆ from_variant() [23/103]

void fc::from_variant ( const fc::variant & v,
UInt< 64 > & n )

Definition at line 761 of file variant.cpp.

761{ n = v.as_uint64(); }
Here is the call graph for this function:

◆ from_variant() [24/103]

void fc::from_variant ( const fc::variant & v,
UInt< 8 > & n )

Definition at line 750 of file variant.cpp.

750{ n = static_cast<uint8_t>(v.as_uint64()); }
Here is the call graph for this function:

◆ from_variant() [25/103]

void fc::from_variant ( const fc::variant & v,
url & u )

Definition at line 85 of file url.cpp.

86 {
87 u = url( v.as_string() );
88 }
string url
Definition main.cpp:166
Here is the call graph for this function:

◆ from_variant() [26/103]

void fc::from_variant ( const fc::variant & var,
__int128 & vo )

Definition at line 683 of file variant.cpp.

684{
685 if( var.is_int64() ) {
686 vo = var.as_int64();
687 } else if( var.is_string() ) {
688 vo = static_cast<__int128>( boost::multiprecision::int128_t(var.as_string()) );
689 } else {
690 FC_THROW_EXCEPTION( bad_cast_exception, "Cannot convert variant of type '${type}' into a int128_t", ("type", var.get_type()) );
691 }
692}
bool is_int64() const
Definition variant.cpp:330
type_id get_type() const
Definition variant.cpp:304
Here is the call graph for this function:

◆ from_variant() [27/103]

void fc::from_variant ( const fc::variant & var,
bool & vo )

Definition at line 704 of file variant.cpp.

705{
706 vo = var.as_bool();
707}
bool as_bool() const
Definition variant.cpp:441
Here is the call graph for this function:

◆ from_variant() [28/103]

void fc::from_variant ( const fc::variant & var,
double & vo )

Definition at line 709 of file variant.cpp.

710{
711 vo = var.as_double();
712}
double as_double() const
Definition variant.cpp:420
Here is the call graph for this function:

◆ from_variant() [29/103]

void fc::from_variant ( const fc::variant & var,
fc::variant & vo )

Definition at line 631 of file variant.cpp.

631{ vo = var; }

◆ from_variant() [30/103]

void fc::from_variant ( const fc::variant & var,
fc::variants & vo )

Definition at line 621 of file variant.cpp.

622{
623 vo = var.get_array();
624}
Here is the call graph for this function:

◆ from_variant() [31/103]

void fc::from_variant ( const fc::variant & var,
float & vo )

Definition at line 714 of file variant.cpp.

715{
716 vo = static_cast<float>(var.as_double());
717}
Here is the call graph for this function:

◆ from_variant() [32/103]

void fc::from_variant ( const fc::variant & var,
int16_t & vo )

Definition at line 647 of file variant.cpp.

647{ vo = static_cast<int16_t>(var.as_int64()); }
signed short int16_t
Definition stdint.h:122
Here is the call graph for this function:

◆ from_variant() [33/103]

void fc::from_variant ( const fc::variant & var,
int32_t & vo )

Definition at line 659 of file variant.cpp.

660{
661 vo = static_cast<int32_t>(var.as_int64());
662}
Here is the call graph for this function:

◆ from_variant() [34/103]

void fc::from_variant ( const fc::variant & var,
int64_t & vo )

Definition at line 694 of file variant.cpp.

695{
696 vo = var.as_int64();
697}
Here is the call graph for this function:

◆ from_variant() [35/103]

void fc::from_variant ( const fc::variant & var,
int8_t & vo )

Definition at line 639 of file variant.cpp.

639{ vo = static_cast<int8_t>(var.as_int64()); }
signed char int8_t
Definition stdint.h:121
Here is the call graph for this function:

◆ from_variant() [36/103]

void fc::from_variant ( const fc::variant & var,
mutable_variant_object & vo )

Definition at line 419 of file variant_object.cpp.

420 {
421 vo = var.get_object();
422 }
Here is the call graph for this function:

◆ from_variant() [37/103]

template<typename T , std::size_t S>
void fc::from_variant ( const fc::variant & var,
std::array< T, S > & vo )

Definition at line 577 of file variant.hpp.

578 {
579 const variants& vars = var.get_array();
580 for( std::size_t i = 0; i < S; ++i )
581 tmp[i] = vars.at(i).as<T>();
582 }
#define S(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)
Here is the call graph for this function:

◆ from_variant() [38/103]

template<typename T >
void fc::from_variant ( const fc::variant & var,
std::deque< T > & vo )

Definition at line 507 of file variant.hpp.

508 {
509 const variants& vars = var.get_array();
510 if( vars.size() > MAX_NUM_ARRAY_ELEMENTS ) throw std::range_error( "too large" );
511 tmp.clear();
512 for( auto itr = vars.begin(); itr != vars.end(); ++itr )
513 tmp.push_back( itr->as<T>() );
514 }
Here is the call graph for this function:

◆ from_variant() [39/103]

template<typename K , typename T >
void fc::from_variant ( const fc::variant & var,
std::map< K, T > & vo )

Definition at line 454 of file variant.hpp.

455 {
456 const variants& vars = var.get_array();
457 if( vars.size() > MAX_NUM_ARRAY_ELEMENTS ) throw std::range_error( "too large" );
458 vo.clear();
459 for( auto itr = vars.begin(); itr != vars.end(); ++itr )
460 vo.insert( itr->as< std::pair<K,T> >() );
461 }
Here is the call graph for this function:

◆ from_variant() [40/103]

template<typename K , typename T >
void fc::from_variant ( const fc::variant & var,
std::multimap< K, T > & vo )

Definition at line 474 of file variant.hpp.

475 {
476 const variants& vars = var.get_array();
477 if( vars.size() > MAX_NUM_ARRAY_ELEMENTS ) throw std::range_error( "too large" );
478 vo.clear();
479 for( auto itr = vars.begin(); itr != vars.end(); ++itr )
480 vo.insert( itr->as< std::pair<K,T> >() );
481 }
Here is the call graph for this function:

◆ from_variant() [41/103]

template<typename T >
void fc::from_variant ( const fc::variant & var,
std::set< T > & vo )

Definition at line 495 of file variant.hpp.

496 {
497 const variants& vars = var.get_array();
498 if( vars.size() > MAX_NUM_ARRAY_ELEMENTS ) throw std::range_error( "too large" );
499 vo.clear();
500 //vo.reserve( vars.size() );
501 for( auto itr = vars.begin(); itr != vars.end(); ++itr )
502 vo.insert( itr->as<T>() );
503 }
Here is the call graph for this function:

◆ from_variant() [42/103]

template<typename T >
void fc::from_variant ( const fc::variant & var,
std::shared_ptr< T > & vo )

Definition at line 640 of file variant.hpp.

641 {
642 if( var.is_null() ) vo = nullptr;
643 else if( vo ) from_variant( var, *vo );
644 else {
645 vo = std::make_shared<T>();
646 from_variant( var, *vo );
647 }
648 }
bool is_null() const
Definition variant.cpp:309
Here is the call graph for this function:

◆ from_variant() [43/103]

template<typename K , typename T >
void fc::from_variant ( const fc::variant & var,
std::unordered_map< K, T > & vo )

Definition at line 434 of file variant.hpp.

435 {
436 const variants& vars = var.get_array();
437 if( vars.size() > MAX_NUM_ARRAY_ELEMENTS ) throw std::range_error( "too large" );
438 vo.clear();
439 for( auto itr = vars.begin(); itr != vars.end(); ++itr )
440 vo.insert( itr->as< std::pair<K,T> >() );
441
442 }
Here is the call graph for this function:

◆ from_variant() [44/103]

template<typename T >
void fc::from_variant ( const fc::variant & var,
std::unordered_set< T > & vo )

Definition at line 412 of file variant.hpp.

413 {
414 const variants& vars = var.get_array();
415 if( vars.size() > MAX_NUM_ARRAY_ELEMENTS ) throw std::range_error( "too large" );
416 vo.clear();
417 vo.reserve( vars.size() );
418 for( auto itr = vars.begin(); itr != vars.end(); ++itr )
419 vo.insert( itr->as<T>() );
420 }
Here is the call graph for this function:

◆ from_variant() [45/103]

void fc::from_variant ( const fc::variant & var,
std::vector< char > & vo )

Definition at line 736 of file variant.cpp.

737{
738 const auto& str = var.get_string();
739 FC_ASSERT( str.size() <= 2*MAX_SIZE_OF_BYTE_ARRAYS ); // Doubled because hex strings needs two characters per byte
740 FC_ASSERT( str.size() % 2 == 0, "the length of hex string should be even number" );
741 vo.resize( str.size() / 2 );
742 if( vo.size() ) {
743 size_t r = from_hex( str, vo.data(), vo.size() );
744 FC_ASSERT( r == vo.size() );
745 }
746}
Here is the call graph for this function:

◆ from_variant() [46/103]

template<typename T >
void fc::from_variant ( const fc::variant & var,
std::vector< T > & tmp )

Definition at line 554 of file variant.hpp.

555 {
556 const variants& vars = var.get_array();
557 if( vars.size() > MAX_NUM_ARRAY_ELEMENTS ) throw std::range_error( "too large" );
558 tmp.clear();
559 tmp.reserve( vars.size() );
560 for( auto itr = vars.begin(); itr != vars.end(); ++itr )
561 tmp.push_back( itr->as<T>() );
562 }
Here is the call graph for this function:

◆ from_variant() [47/103]

void fc::from_variant ( const fc::variant & var,
string & vo )

Definition at line 724 of file variant.cpp.

725{
726 vo = var.as_string();
727}
Here is the call graph for this function:

◆ from_variant() [48/103]

void fc::from_variant ( const fc::variant & var,
sysio::chain::asset & vo )
inline

Definition at line 108 of file asset.hpp.

108 {
110}
static asset from_string(const string &from)
Definition asset.cpp:31
Here is the call graph for this function:

◆ from_variant() [49/103]

void fc::from_variant ( const fc::variant & var,
sysio::chain::extended_asset & vo )
inline

Definition at line 114 of file asset.hpp.

114 {
115 if( var.is_array() ) {
116 const auto& va = var.get_array();
117 from_variant(va.at(0), vo.quantity);
118 from_variant(va.at(1), vo.contract);
119 } else {
120 const auto& vars = var.get_object();
121 from_variant(vars["quantity"], vo.quantity);
122 from_variant(vars["contract"], vo.contract);
123 }
124}
bool is_array() const
Definition variant.cpp:368
Here is the call graph for this function:

◆ from_variant() [50/103]

void fc::from_variant ( const fc::variant & var,
sysio::chain::symbol & vo )
inline

Definition at line 173 of file symbol.hpp.

173 {
175 }
static symbol from_string(const string &from)
Definition symbol.hpp:68
Here is the call graph for this function:

◆ from_variant() [51/103]

void fc::from_variant ( const fc::variant & var,
sysio::chain::symbol_code & vo )
inline

Definition at line 182 of file symbol.hpp.

182 {
183 vo = sysio::chain::symbol(0, var.get_string().c_str()).to_symbol_code();
184 }
symbol_code to_symbol_code() const
Definition symbol.hpp:117
Here is the call graph for this function:

◆ from_variant() [52/103]

void fc::from_variant ( const fc::variant & var,
fc::time_point & t )

Definition at line 83 of file time.cpp.

83 {
84 t = fc::time_point::from_iso_string( v.as_string() );
85 }
static time_point from_iso_string(const fc::string &s)
Definition time.cpp:67
Here is the call graph for this function:

◆ from_variant() [53/103]

void fc::from_variant ( const fc::variant & var,
fc::time_point_sec & t )

Definition at line 89 of file time.cpp.

89 {
90 t = fc::time_point_sec::from_iso_string( v.as_string() );
91 }
static time_point_sec from_iso_string(const fc::string &s)
Definition time.cpp:39
Here is the call graph for this function:

◆ from_variant() [54/103]

void fc::from_variant ( const fc::variant & var,
uint16_t & vo )

Definition at line 643 of file variant.cpp.

643{ vo = static_cast<uint16_t>(var.as_uint64()); }
Here is the call graph for this function:

◆ from_variant() [55/103]

void fc::from_variant ( const fc::variant & var,
uint32_t & vo )

Definition at line 650 of file variant.cpp.

651{
652 vo = static_cast<uint32_t>(var.as_uint64());
653}
Here is the call graph for this function:

◆ from_variant() [56/103]

void fc::from_variant ( const fc::variant & var,
uint64_t & vo )

Definition at line 699 of file variant.cpp.

700{
701 vo = var.as_uint64();
702}
Here is the call graph for this function:

◆ from_variant() [57/103]

void fc::from_variant ( const fc::variant & var,
uint8_t & vo )

Definition at line 635 of file variant.cpp.

635{ vo = static_cast<uint8_t>(var.as_uint64()); }
Here is the call graph for this function:

◆ from_variant() [58/103]

void fc::from_variant ( const fc::variant & var,
unsigned __int128 & vo )

Definition at line 668 of file variant.cpp.

669{
670 if( var.is_uint64() ) {
671 vo = var.as_uint64();
672 } else if( var.is_string() ) {
673 vo = static_cast<unsigned __int128>( boost::multiprecision::uint128_t(var.as_string()) );
674 } else {
675 FC_THROW_EXCEPTION( bad_cast_exception, "Cannot convert variant of type '${type}' into a uint128_t", ("type", var.get_type()) );
676 }
677}
bool is_uint64() const
Definition variant.cpp:326
Here is the call graph for this function:

◆ from_variant() [59/103]

void fc::from_variant ( const fc::variant & var,
variant_object & vo )

Definition at line 182 of file variant_object.cpp.

183 {
184 vo = var.get_object();
185 }
Here is the call graph for this function:

◆ from_variant() [60/103]

void fc::from_variant ( const variant & e,
exception & ll )

Definition at line 134 of file exception.cpp.

135 {
136 auto obj = v.get_object();
137 if( obj.contains( "stack" ) )
138 ll.my->_elog = obj["stack"].as<log_messages>();
139 if( obj.contains( "code" ) )
140 ll.my->_code = obj["code"].as_int64();
141 if( obj.contains( "name" ) )
142 ll.my->_name = obj["name"].as_string();
143 if( obj.contains( "message" ) )
144 ll.my->_what = obj["message"].as_string();
145 }
std::unique_ptr< detail::exception_impl > my
std::vector< log_message > log_messages

◆ from_variant() [61/103]

void fc::from_variant ( const variant & e,
log_level & ll )

Definition at line 133 of file log_message.cpp.

134 {
135 try
136 {
137 if( v.as_string() == "all" ) e = log_level::all;
138 else if( v.as_string() == "debug" ) e = log_level::debug;
139 else if( v.as_string() == "info" ) e = log_level::info;
140 else if( v.as_string() == "warn" ) e = log_level::warn;
141 else if( v.as_string() == "error" ) e = log_level::error;
142 else if( v.as_string() == "off" ) e = log_level::off;
143 else FC_THROW_EXCEPTION( bad_cast_exception, "Failed to cast from Variant to log_level" );
144 } FC_RETHROW_EXCEPTIONS( error,
145 "Expected 'all|debug|info|warn|error|off', but got '${variant}'",
146 ("variant",v) );
147 }
Here is the call graph for this function:

◆ from_variant() [62/103]

void fc::from_variant ( const variant & l,
log_context & c )

Definition at line 95 of file log_message.cpp.

96 {
97 c = log_context(l);
98 }
provides information about where and when a log message was generated.
int l

◆ from_variant() [63/103]

void fc::from_variant ( const variant & l,
log_message & c )

Definition at line 100 of file log_message.cpp.

101 {
102 c = log_message(l);
103 }

◆ from_variant() [64/103]

template<typename T , size_t N>
void fc::from_variant ( const variant & v,
array< T, N > & bi )

Definition at line 111 of file array.hpp.

112 {
113 std::vector<char> ve = v.as< std::vector<char> >();
114 if( ve.size() )
115 {
116 memcpy(&bi, ve.data(), fc::min<size_t>(ve.size(),sizeof(bi)) );
117 }
118 else
119 memset( &bi, char(0), sizeof(bi) );
120 }
const T & min(const T &a, const T &b)
Definition utility.hpp:140
memset(pInfo->slotDescription, ' ', 64)
Here is the call graph for this function:

◆ from_variant() [65/103]

void fc::from_variant ( const variant & v,
bigint & bi )

decodes the big int as base64 string, or a number

Definition at line 218 of file bigint.cpp.

219 {
220 if( v.is_numeric() ) bi = bigint( static_cast<unsigned long>(v.as_uint64()) );
221 else
222 {
223 std::string b64 = v.as_string();
224 std::string bin = base64_decode(b64);
225 bi = bigint(bin.c_str(), bin.size() );
226 }
227 }
bool is_numeric() const
Definition variant.cpp:348
bool base64_decode(const char *in, uint8_t *out, size_t *len)
Definition util.c:503
Here is the call graph for this function:

◆ from_variant() [66/103]

template<typename K , typename V , typename... U>
void fc::from_variant ( const variant & v,
bip::map< K, V, U... > & m )

Definition at line 85 of file container.hpp.

85 {
86 detail::from_variant_to_map( v, m );
87 }
Here is the call graph for this function:

◆ from_variant() [67/103]

template<typename K , typename V , typename... U>
void fc::from_variant ( const variant & v,
bip::multimap< K, V, U... > & m )

Definition at line 95 of file container.hpp.

95 {
96 detail::from_variant_to_map( v, m );
97 }
Here is the call graph for this function:

◆ from_variant() [68/103]

void fc::from_variant ( const variant & v,
blob & b )
inline

Definition at line 195 of file database_utils.hpp.

195 {
196 string _s = base64_decode(v.as_string());
197 b.data = std::vector<char>(_s.begin(), _s.end());
198 }
std::vector< char > data
Definition variant.hpp:44
Here is the call graph for this function:

◆ from_variant() [69/103]

template<typename OidType >
void fc::from_variant ( const variant & v,
chainbase::oid< OidType > & oid )

Definition at line 105 of file database_utils.hpp.

105 {
106 from_variant(v, oid._id);
107 }
Here is the call graph for this function:

◆ from_variant() [70/103]

template<typename Storage >
void fc::from_variant ( const variant & v,
fixed_string< Storage > & s )

Definition at line 168 of file fixed_string.hpp.

168 {
169 s = v.as_string();
170 }
Here is the call graph for this function:

◆ from_variant() [71/103]

template<typename K , typename V , typename... U>
void fc::from_variant ( const variant & v,
flat_map< K, V, U... > & m )

Definition at line 172 of file flat.hpp.

172 {
173 detail::from_variant_to_flat_map( v, m );
174 }
Here is the call graph for this function:

◆ from_variant() [72/103]

template<typename K , typename V , typename... U>
void fc::from_variant ( const variant & v,
flat_multimap< K, V, U... > & m )

Definition at line 182 of file flat.hpp.

182 {
183 detail::from_variant_to_flat_map( v, m );
184 }
Here is the call graph for this function:

◆ from_variant() [73/103]

void fc::from_variant ( const variant & v,
float128_t & f )
inline

Definition at line 154 of file database_utils.hpp.

154 {
155 // Temporarily hold the binary in uint128_t before casting it to float128_t
156 char temp[sizeof(sysio::chain::uint128_t)];
157 memset(temp, 0, sizeof(temp));
158 auto s = v.as_string();
159 FC_ASSERT( s.size() == 2 + 2 * sizeof(temp) && s.find("0x") == 0, "Failure in converting hex data into a float128_t");
160 auto sz = from_hex( s.substr(2), temp, sizeof(temp) );
161 // Assumes platform is little endian and hex representation of 128-bit integer is in little endian order.
162 FC_ASSERT( sz == sizeof(temp), "Failure in converting hex data into a float128_t" );
163 memcpy(&f, temp, sizeof(f));
164 }
unsigned __int128 uint128_t
Definition types.hpp:242
Here is the call graph for this function:

◆ from_variant() [74/103]

void fc::from_variant ( const variant & v,
float64_t & f )
inline

Definition at line 137 of file database_utils.hpp.

137 {
138 double double_f;
139 from_variant(v, double_f);
140 double_to_float64(double_f, f);
141 }
void double_to_float64(const double &d, float64_t &f)
Here is the call graph for this function:

◆ from_variant() [75/103]

void fc::from_variant ( const variant & v,
private_key & bi )

decodes the big int as base64 string, or a number

Definition at line 359 of file pke.cpp.

360 {
361 bi = private_key( v.as<std::vector<char> >() );
362 }
Here is the call graph for this function:

◆ from_variant() [76/103]

void fc::from_variant ( const variant & v,
public_key & bi )

decodes the big int as base64 string, or a number

Definition at line 346 of file pke.cpp.

347 {
348 bi = public_key( v.as<std::vector<char> >() );
349 }
Here is the call graph for this function:

◆ from_variant() [77/103]

void fc::from_variant ( const variant & v,
ripemd160 & bi )

Definition at line 107 of file ripemd160.cpp.

108 {
109 std::vector<char> ve = v.as< std::vector<char> >();
110 if( ve.size() )
111 {
112 memcpy(&bi, ve.data(), fc::min<size_t>(ve.size(),sizeof(bi)) );
113 }
114 else
115 memset( &bi, char(0), sizeof(bi) );
116 }
Here is the call graph for this function:

◆ from_variant() [78/103]

void fc::from_variant ( const variant & v,
sha1 & bi )

Definition at line 93 of file sha1.cpp.

94 {
95 std::vector<char> ve = v.as< std::vector<char> >();
96 if( ve.size() )
97 {
98 memcpy(&bi, ve.data(), fc::min<size_t>(ve.size(),sizeof(bi)) );
99 }
100 else
101 memset( &bi, char(0), sizeof(bi) );
102 }
Here is the call graph for this function:

◆ from_variant() [79/103]

void fc::from_variant ( const variant & v,
sha224 & bi )

Definition at line 88 of file sha224.cpp.

89 {
90 std::vector<char> ve = v.as< std::vector<char> >();
91 if( ve.size() )
92 {
93 memcpy(&bi, ve.data(), fc::min<size_t>(ve.size(),sizeof(bi)) );
94 }
95 else
96 memset( &bi, char(0), sizeof(bi) );
97 }
Here is the call graph for this function:

◆ from_variant() [80/103]

void fc::from_variant ( const variant & v,
sha256 & bi )

Definition at line 210 of file sha256.cpp.

211 {
212 std::vector<char> ve = v.as< std::vector<char> >();
213 if( ve.size() )
214 {
215 memcpy(&bi, ve.data(), fc::min<size_t>(ve.size(),sizeof(bi)) );
216 }
217 else
218 memset( &bi, char(0), sizeof(bi) );
219 }
Here is the call graph for this function:

◆ from_variant() [81/103]

void fc::from_variant ( const variant & v,
sha3 & bi )

Definition at line 280 of file sha3.cpp.

281{
282 const auto &ve = v.as<std::vector<char>>();
283 if (ve.size())
284 memcpy(&bi, ve.data(), fc::min<size_t>(ve.size(), sizeof(bi)));
285 else
286 memset(&bi, char(0), sizeof(bi));
287}
Here is the call graph for this function:

◆ from_variant() [82/103]

void fc::from_variant ( const variant & v,
sha512 & bi )

Definition at line 95 of file sha512.cpp.

96 {
97 std::vector<char> ve = v.as< std::vector<char> >();
98 if( ve.size() )
99 {
100 memcpy(&bi, ve.data(), fc::min<size_t>(ve.size(),sizeof(bi)) );
101 }
102 else
103 memset( &bi, char(0), sizeof(bi) );
104 }
Here is the call graph for this function:

◆ from_variant() [83/103]

void fc::from_variant ( const variant & v,
sysio::chain::shared_blob & b )
inline

Definition at line 184 of file database_utils.hpp.

184 {
185 string _s = base64_decode(v.as_string());
186 b = sysio::chain::shared_blob(_s.begin(), _s.end(), b.get_allocator());
187 }
const allocator_type & get_allocator() const
Here is the call graph for this function:

◆ from_variant() [84/103]

void fc::from_variant ( const variant & v,
sysio::chain::shared_string & s )
inline

Definition at line 172 of file database_utils.hpp.

172 {
173 string _s;
174 from_variant(v, _s);
175 s = sysio::chain::shared_string(_s.begin(), _s.end(), s.get_allocator());
176 }
chainbase::shared_string shared_string
Definition types.hpp:83
Here is the call graph for this function:

◆ from_variant() [85/103]

template<typename T >
void fc::from_variant ( const variant & v,
sysio::chain::shared_vector< T > & sv )

Definition at line 206 of file database_utils.hpp.

206 {
207 std::vector<T> _v;
208 from_variant(v, _v);
209 sv = sysio::chain::shared_vector<T>(_v.begin(), _v.end(), sv.get_allocator());
210 }
boost::interprocess::vector< T, allocator< T > > shared_vector
Definition types.hpp:85
Here is the call graph for this function:

◆ from_variant() [86/103]

template<typename T >
void fc::from_variant ( const variant & v,
T & o )

Definition at line 104 of file variant.hpp.

105 {
106 if_enum<typename fc::reflector<T>::is_enum>::from_variant( v, o );
107 }
Here is the call graph for this function:

◆ from_variant() [87/103]

void fc::from_variant ( const variant & var,
crypto::private_key & vo )

Definition at line 149 of file private_key.cpp.

Here is the call graph for this function:

◆ from_variant() [88/103]

void fc::from_variant ( const variant & var,
crypto::public_key & vo )

Definition at line 114 of file public_key.cpp.

Here is the call graph for this function:

◆ from_variant() [89/103]

void fc::from_variant ( const variant & var,
crypto::r1::private_key & vo )

Definition at line 625 of file elliptic_r1.cpp.

626 {
627 fc::sha256 sec;
628 from_variant( var, sec );
629 vo = crypto::r1::private_key::regenerate(sec);
630 }
Here is the call graph for this function:

◆ from_variant() [90/103]

void fc::from_variant ( const variant & var,
crypto::r1::public_key & vo )

Definition at line 636 of file elliptic_r1.cpp.

637 {
639 from_variant( var, dat );
640 vo = crypto::r1::public_key(dat);
641 }
contains only the public point of an elliptic curve key.
Here is the call graph for this function:

◆ from_variant() [91/103]

void fc::from_variant ( const variant & var,
crypto::signature & vo )

Definition at line 93 of file signature.cpp.

Here is the call graph for this function:

◆ from_variant() [92/103]

void fc::from_variant ( const variant & var,
ecc::private_key & vo )

Definition at line 221 of file elliptic_common.cpp.

222{
223 fc::sha256 sec;
224 from_variant( var, sec );
225 vo = ecc::private_key::regenerate(sec);
226}
Here is the call graph for this function:

◆ from_variant() [93/103]

void fc::from_variant ( const variant & var,
ecc::public_key & vo )

Definition at line 233 of file elliptic_common.cpp.

234{
236 from_variant( var, dat );
237 vo = ecc::public_key(dat);
238}
contains only the public point of an elliptic curve key.
Definition elliptic.hpp:36
Here is the call graph for this function:

◆ from_variant() [94/103]

void fc::from_variant ( const variant & var,
em::private_key & vo )

Definition at line 222 of file elliptic_em_common.cpp.

223{
224 fc::sha256 sec;
225 from_variant( var, sec );
226 vo = em::private_key::regenerate(sec);
227}
Here is the call graph for this function:

◆ from_variant() [95/103]

void fc::from_variant ( const variant & var,
em::public_key & vo )

Definition at line 234 of file elliptic_em_common.cpp.

235{
237 from_variant( var, dat );
238 vo = em::public_key(dat);
239}
contains only the public point of an elliptic curve key.
Here is the call graph for this function:

◆ from_variant() [96/103]

template<typename IntType , typename EnumType >
void fc::from_variant ( const variant & var,
enum_type< IntType, EnumType > & vo )

Definition at line 56 of file enum_type.hpp.

57 {
58 vo.value = var.as<EnumType>();
59 }
EnumType value
Definition enum_type.hpp:46
Here is the call graph for this function:

◆ from_variant() [97/103]

void fc::from_variant ( const variant & var,
ip::address & vo )

Definition at line 153 of file ip.cpp.

154 {
155 vo = ip::address(var.as_string());
156 }
Here is the call graph for this function:

◆ from_variant() [98/103]

void fc::from_variant ( const variant & var,
ip::endpoint & vo )

Definition at line 144 of file ip.cpp.

145 {
146 vo = ip::endpoint::from_string(var.as_string());
147 }
Here is the call graph for this function:

◆ from_variant() [99/103]

void fc::from_variant ( const variant & var,
real128 & vo )

Definition at line 125 of file real128.cpp.

126 {
127 vo = real128(var.as_string());
128 }
Here is the call graph for this function:

◆ from_variant() [100/103]

void fc::from_variant ( const variant & var,
signed_int & vo )

Definition at line 7 of file varint.cpp.

7{ vo.value = static_cast<int32_t>(var.as_int64()); }
int32_t value
Definition varint.hpp:49
Here is the call graph for this function:

◆ from_variant() [101/103]

template<typename T >
void fc::from_variant ( const variant & var,
std::optional< T > & vo )

Definition at line 392 of file variant.hpp.

393 {
394 if( var.is_null() ) vo = std::optional<T>();
395 else
396 {
397 vo = T();
398 from_variant( var, *vo );
399 }
400 }
Here is the call graph for this function:

◆ from_variant() [102/103]

void fc::from_variant ( const variant & var,
uint128 & vo )

Definition at line 378 of file uint128.cpp.

378{ vo = uint128(var.as_string()); }
Here is the call graph for this function:

◆ from_variant() [103/103]

void fc::from_variant ( const variant & var,
unsigned_int & vo )

Definition at line 9 of file varint.cpp.

9{ vo.value = static_cast<uint32_t>(var.as_uint64()); }
uint32_t value
Definition varint.hpp:17
Here is the call graph for this function:

◆ generate_key_pair()

void fc::generate_key_pair ( public_key & pub,
private_key & priv )

Definition at line 329 of file pke.cpp.

330 {
331 static bool init = true;
332 if( init ) { ERR_load_crypto_strings(); init = false; }
333
334 pub.my = std::make_shared<detail::pke_impl>();
335 priv.my = pub.my;
336 pub.my->rsa = RSA_generate_key( 2048, 65537, NULL, NULL );
337 }
void init()
Definition lib_test.cpp:3
bool pub

◆ get_approximate_relative_time_string() [1/2]

string fc::get_approximate_relative_time_string ( const time_point & event_time,
const time_point & relative_to_time = fc::time_point::now(),
const std::string & ago = " ago" )

Definition at line 154 of file time.cpp.

156 {
157 return get_approximate_relative_time_string(time_point_sec(event_time), time_point_sec(relative_to_time), ago);
158 }
string get_approximate_relative_time_string(const time_point_sec &event_time, const time_point_sec &relative_to_time=fc::time_point::now(), const std::string &ago=" ago")
Definition time.cpp:94
Here is the call graph for this function:

◆ get_approximate_relative_time_string() [2/2]

string fc::get_approximate_relative_time_string ( const time_point_sec & event_time,
const time_point_sec & relative_to_time = fc::time_point::now(),
const std::string & ago = " ago" )

return a human-readable approximate time, relative to now() e.g., "4 hours ago", "2 months ago", etc.

Definition at line 94 of file time.cpp.

96 {
97
98
99 string ago = default_ago;
100 int32_t seconds_ago = relative_to_time.sec_since_epoch() - event_time.sec_since_epoch();
101 if (seconds_ago < 0)
102 {
103 ago = " in the future";
104 seconds_ago = -seconds_ago;
105 }
106 std::stringstream result;
107 if (seconds_ago < 90)
108 {
109 result << seconds_ago << " second" << (seconds_ago > 1 ? "s" : "") << ago;
110 return result.str();
111 }
112 uint32_t minutes_ago = (seconds_ago + 30) / 60;
113 if (minutes_ago < 90)
114 {
115 result << minutes_ago << " minute" << (minutes_ago > 1 ? "s" : "") << ago;
116 return result.str();
117 }
118 uint32_t hours_ago = (minutes_ago + 30) / 60;
119 if (hours_ago < 90)
120 {
121 result << hours_ago << " hour" << (hours_ago > 1 ? "s" : "") << ago;
122 return result.str();
123 }
124 uint32_t days_ago = (hours_ago + 12) / 24;
125 if (days_ago < 90)
126 {
127 result << days_ago << " day" << (days_ago > 1 ? "s" : "") << ago;
128 return result.str();
129 }
130 uint32_t weeks_ago = (days_ago + 3) / 7;
131 if (weeks_ago < 70)
132 {
133 result << weeks_ago << " week" << (weeks_ago > 1 ? "s" : "") << ago;
134 return result.str();
135 }
136 uint32_t months_ago = (days_ago + 15) / 30;
137 if (months_ago < 12)
138 {
139 result << months_ago << " month" << (months_ago > 1 ? "s" : "") << ago;
140 return result.str();
141 }
142 uint32_t years_ago = days_ago / 365;
143 result << years_ago << " year" << (months_ago > 1 ? "s" : "");
144 if (months_ago < 12 * 5)
145 {
146 uint32_t leftover_days = days_ago - (years_ago * 365);
147 uint32_t leftover_months = (leftover_days + 15) / 30;
148 if (leftover_months)
149 result << leftover_months << " month" << (months_ago > 1 ? "s" : "");
150 }
151 result << ago;
152 return result.str();
153 }
constexpr uint32_t sec_since_epoch() const
Definition time.hpp:88
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_index()

template<typename VariantType , typename T , std::size_t index = 0>
std::size_t fc::get_index ( )
constexpr

Definition at line 33 of file static_variant.hpp.

34{
35 if constexpr (index == std::variant_size_v<VariantType>)
36 {
37 return index;
38 }
39 else if constexpr (std::is_same_v<std::variant_alternative_t<index, VariantType>, T>)
40 {
41 return index;
42 }
43 else
44 {
45 return get_index<VariantType, T, index + 1>();
46 }
47}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_null_url()

std::shared_ptr< detail::url_impl > fc::get_null_url ( )

Definition at line 115 of file url.cpp.

116 {
117 static auto u = std::make_shared<detail::url_impl>();
118 return u;
119 }
Here is the caller graph for this function:

◆ get_thread_name()

const string & fc::get_thread_name ( )

Definition at line 144 of file logger_config.cpp.

144 {
145 if( thread_name.empty() ) {
146#ifdef FC_USE_PTHREAD_NAME_NP
147 char thr_name[64];
148 int rc = pthread_getname_np( pthread_self(), thr_name, 64 );
149 if( rc == 0 ) {
150 thread_name = thr_name;
151 }
152#else
153 static int thread_count = 0;
154 thread_name = string( "thread-" ) + fc::to_string( thread_count++ );
155#endif
156 }
157 return thread_name;
158 }
fc::string to_string(double)
Definition string.cpp:131
yh_rc rc
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Hash128to64()

uint64_t fc::Hash128to64 ( const uint128 & x)
inline

Definition at line 55 of file city.cpp.

55 {
56 // Murmur-inspired hashing.
57 const uint64_t kMul = 0x9ddfea08eb382d69ULL;
58 uint64_t a = (Uint128Low64(x) ^ Uint128High64(x)) * kMul;
59 a ^= (a >> 47);
60 uint64_t b = (Uint128High64(x) ^ a) * kMul;
61 b ^= (b >> 47);
62 b *= kMul;
63 return b;
64}
uint64_t Uint128High64(const uint128 &x)
Definition city.cpp:51
uint64_t Uint128Low64(const uint128 &x)
Definition city.cpp:50
Here is the call graph for this function:

◆ hash64()

uint64_t fc::hash64 ( const char * buf,
size_t len )

Definition at line 221 of file sha256.cpp.

222 {
223 sha256 sha_value = sha256::hash(buf,len);
224 return sha_value._hash[0];
225 }
uint64_t _hash[4]
Definition sha256.hpp:100
Here is the call graph for this function:

◆ hash_value()

std::size_t fc::hash_value ( const fc::sha256 & v)
inline

Definition at line 13 of file unapplied_transaction_queue.hpp.

13 {
14 return v._hash[3];
15 }

◆ history_context_serialize_container()

template<typename ST , typename P , typename T >
datastream< ST > & fc::history_context_serialize_container ( datastream< ST > & ds,
const chainbase::database & db,
const P & context,
const std::vector< T > & v )

Definition at line 70 of file serialization.hpp.

71 {
72 fc::raw::pack(ds, unsigned_int(v.size()));
73 for (const auto& x : v) {
75 }
76 return ds;
77}
history_context_wrapper< std::decay_t< P >, std::decay_t< T > > make_history_context_wrapper(const chainbase::database &db, const P &context, const T &obj)
Here is the call graph for this function:

◆ history_pack_big_bytes() [1/2]

template<typename ST >
void fc::history_pack_big_bytes ( datastream< ST > & ds,
const std::optional< sysio::chain::bytes > & v )

Definition at line 106 of file serialization.hpp.

106 {
107 fc::raw::pack(ds, v.has_value());
108 if (v)
110}
void history_pack_big_bytes(datastream< ST > &ds, const sysio::chain::bytes &v)
Here is the call graph for this function:

◆ history_pack_big_bytes() [2/2]

template<typename ST >
void fc::history_pack_big_bytes ( datastream< ST > & ds,
const sysio::chain::bytes & v )

Definition at line 99 of file serialization.hpp.

99 {
100 history_pack_varuint64(ds, v.size());
101 if (v.size())
102 ds.write(&v.front(), v.size());
103}
void history_pack_varuint64(datastream< ST > &ds, uint64_t val)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ history_pack_varuint64()

template<typename ST >
void fc::history_pack_varuint64 ( datastream< ST > & ds,
uint64_t val )
inline

Definition at line 89 of file serialization.hpp.

89 {
90 do {
91 uint8_t b = uint8_t(val) & 0x7f;
92 val >>= 7;
93 b |= ((val > 0) << 7);
94 ds.write((char*)&b, 1);
95 } while (val);
96}
Here is the caller graph for this function:

◆ history_serialize_container() [1/2]

template<typename ST , typename T >
datastream< ST > & fc::history_serialize_container ( datastream< ST > & ds,
const chainbase::database & db,
const std::vector< std::shared_ptr< T > > & v )

Definition at line 59 of file serialization.hpp.

60 {
61 fc::raw::pack(ds, unsigned_int(v.size()));
62 for (auto& x : v) {
63 SYS_ASSERT(!!x, sysio::chain::plugin_exception, "null inside container");
64 ds << make_history_serial_wrapper(db, *x);
65 }
66 return ds;
67}
#define SYS_ASSERT(expr, exc_type, FORMAT,...)
Definition exceptions.hpp:7
history_serial_wrapper< std::decay_t< T > > make_history_serial_wrapper(const chainbase::database &db, const T &obj)
Here is the call graph for this function:

◆ history_serialize_container() [2/2]

template<typename ST , typename T >
datastream< ST > & fc::history_serialize_container ( datastream< ST > & ds,
const chainbase::database & db,
const T & v )

Definition at line 51 of file serialization.hpp.

51 {
52 fc::raw::pack(ds, unsigned_int(v.size()));
53 for (auto& x : v)
54 ds << make_history_serial_wrapper(db, x);
55 return ds;
56}
Here is the call graph for this function:

◆ home_path()

const fc::path & fc::home_path ( )
Returns
the home directory on Linux and OS X and the Profile directory on Windows

Definition at line 471 of file filesystem.cpp.

472 {
473 static fc::path p = []()
474 {
475#ifdef WIN32
476 HANDLE access_token;
477 if (!OpenProcessToken(GetCurrentProcess(), TOKEN_READ, &access_token))
478 FC_ASSERT(false, "Unable to open an access token for the current process");
479 wchar_t user_profile_dir[MAX_PATH];
480 DWORD user_profile_dir_len = sizeof(user_profile_dir);
481 BOOL success = GetUserProfileDirectoryW(access_token, user_profile_dir, &user_profile_dir_len);
482 CloseHandle(access_token);
483 if (!success)
484 FC_ASSERT(false, "Unable to get the user profile directory");
485 return fc::path(std::wstring(user_profile_dir));
486#else
487 char* home = getenv( "HOME" );
488 if( nullptr == home )
489 {
490 struct passwd* pwd = getpwuid(getuid());
491 if( pwd )
492 {
493 return fc::path( std::string( pwd->pw_dir ) );
494 }
495 FC_ASSERT( home != nullptr, "The HOME environment variable is not set" );
496 }
497 return fc::path( std::string(home) );
498#endif
499 }();
500 return p;
501 }
Here is the caller graph for this function:

◆ hours()

microseconds fc::hours ( int64_t h)
inlineconstexpr

Definition at line 35 of file time.hpp.

35{ return minutes(60*h); }
constexpr microseconds minutes(int64_t m)
Definition time.hpp:34
Here is the call graph for this function:
Here is the caller graph for this function:

◆ initLibSnark()

void fc::initLibSnark ( )
noexcept

Definition at line 17 of file alt_bn128.cpp.

17 {
18 static bool s_initialized = []() noexcept {
22 return true;
23 }();
24 (void)s_initialized;
25 }
static void init_public_params()
bool inhibit_profiling_info
Definition profiling.cpp:95
bool inhibit_profiling_counters
Definition profiling.cpp:96
Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_directory()

bool fc::is_directory ( const path & p)

Definition at line 225 of file filesystem.cpp.

225{ return boost::filesystem::is_directory(p); }
Here is the caller graph for this function:

◆ is_regular_file()

bool fc::is_regular_file ( const path & p)

Definition at line 226 of file filesystem.cpp.

226{ return boost::filesystem::is_regular_file(p); }
Here is the caller graph for this function:

◆ is_utf8()

bool fc::is_utf8 ( const std::string & str)

Definition at line 13 of file utf8.cpp.

14 {
15 return utf8::is_valid( str.begin(), str.end() );
16 }
bool is_valid(octet_iterator start, octet_iterator end)
Definition core.h:300
Here is the call graph for this function:

◆ is_valid_utf8()

bool fc::is_valid_utf8 ( const std::string_view & str)

0x80-0x9F C1 control characters are considered invalid as well as invalid utf8 code points.

Returns
true if prune_invalid_utf8 should be called.

Definition at line 40 of file utf8.cpp.

40 {
41 const auto invalid_range = std::make_pair<uint32_t, uint32_t>(0x80, 0x9F);
42 auto [itr, v] = find_invalid( str.begin(), str.end(), invalid_range );
43 return itr == str.end();
44 }
std::pair< octet_iterator, uint32_t > find_invalid(octet_iterator start, octet_iterator end, const std::pair< uint32_t, uint32_t > &invalid_range)
Definition utf8.cpp:22
Here is the call graph for this function:
Here is the caller graph for this function:

◆ k1_recover()

std::variant< k1_recover_error, bytes > fc::k1_recover ( const bytes & signature,
const bytes & digest )

Definition at line 13 of file k1_recover.cpp.

13 {
15 FC_ASSERT(context != nullptr);
16
17 if (signature.size() != 65 || digest.size() != 32) {
18 return k1_recover_error::input_error;
19 }
20
21 int recid = signature[0];
22 if (recid<27 || recid>=35) return k1_recover_error::invalid_signature;
23 recid = (recid - 27) & 3;
24
26 if (!secp256k1_ecdsa_recoverable_signature_parse_compact(context, &sig, (const unsigned char*)&signature[1], recid)) {
27 return k1_recover_error::invalid_signature;
28 }
29
30 secp256k1_pubkey pub_key;
31 if (!secp256k1_ecdsa_recover(context, &pub_key, &sig, (const unsigned char*)&digest[0])) {
32 return k1_recover_error::recover_error;
33 }
34
35 size_t kOutLen{65};
36 bytes out(kOutLen, '\0');
37 secp256k1_ec_pubkey_serialize(context, (unsigned char*)&out[0], &kOutLen, &pub_key, SECP256K1_EC_UNCOMPRESSED);
38 return out;
39 }
fc::array< char, 72 > signature
Definition elliptic.hpp:25
const secp256k1_context * k1_recover_context()
Definition k1_recover.cpp:8
SECP256K1_API int secp256k1_ec_pubkey_serialize(const secp256k1_context *ctx, unsigned char *output, size_t *outputlen, const secp256k1_pubkey *pubkey, unsigned int flags) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4)
Definition secp256k1.c:246
#define SECP256K1_EC_UNCOMPRESSED
Definition secp256k1.h:202
SECP256K1_API int secp256k1_ecdsa_recoverable_signature_parse_compact(const secp256k1_context *ctx, secp256k1_ecdsa_recoverable_signature *sig, const unsigned char *input64, int recid) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3)
Definition main_impl.h:38
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdsa_recover(const secp256k1_context *ctx, secp256k1_pubkey *pubkey, const secp256k1_ecdsa_recoverable_signature *sig, const unsigned char *msghash32) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4)
Definition main_impl.h:137
Here is the call graph for this function:
Here is the caller graph for this function:

◆ k1_recover_context()

const secp256k1_context * fc::k1_recover_context ( )

Definition at line 8 of file k1_recover.cpp.

8 {
10 return ctx;
11 }
SECP256K1_API secp256k1_context * secp256k1_context_create(unsigned int flags) SECP256K1_WARN_UNUSED_RESULT
Definition secp256k1.c:107
#define SECP256K1_CONTEXT_VERIFY
Definition secp256k1.h:195
Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_fused() [1/5]

template<typename R >
std::function< R, fc::tuple<> > fc::make_fused ( const std::function< R > & f)

Definition at line 7 of file make_fused.hpp.

7 {
8 return [=]( fc::tuple<> ){ return f(); };
9 }

◆ make_fused() [2/5]

template<typename R , typename A >
std::function< R(fc::tuple< A >) > fc::make_fused ( const std::function< R(A)> & f)

Definition at line 11 of file make_fused.hpp.

11 {
12 return [f]( fc::tuple<A> t){ return f(t.a); };
13 }

◆ make_fused() [3/5]

template<typename R , typename A , typename B >
std::function< R(fc::tuple< A, B >) > fc::make_fused ( const std::function< R(A, B)> & f)

Definition at line 15 of file make_fused.hpp.

15 {
16 return [f]( fc::tuple<A,B> t){ return f(t.a,t.b); };
17 }

◆ make_fused() [4/5]

template<typename R , typename A , typename B , typename C >
std::function< R(fc::tuple< A, B, C >) > fc::make_fused ( const std::function< R(A, B, C)> & f)

Definition at line 19 of file make_fused.hpp.

19 {
20 return [f]( fc::tuple<A,B,C> t){ return f(t.a,t.b,t.c); };
21 }

◆ make_fused() [5/5]

template<typename R , typename A , typename B , typename C , typename D >
std::function< R(fc::tuple< A, B, C, D >) > fc::make_fused ( const std::function< R(A, B, C, D)> & f)

Definition at line 23 of file make_fused.hpp.

23 {
24 return [f]( fc::tuple<A,B,C> t){ return f(t.a,t.b,t.c,t.d); };
25 }

◆ make_relative()

fc::path fc::make_relative ( const path & from,
const path & to )

Definition at line 369 of file filesystem.cpp.

369 {
370 boost::filesystem::path a_From = boost::filesystem::absolute(from);
371 boost::filesystem::path a_To = boost::filesystem::absolute(to);
372 boost::filesystem::path ret;
373 boost::filesystem::path::const_iterator itrFrom(a_From.begin()), itrTo(a_To.begin());
374 // Find common base
375 for( boost::filesystem::path::const_iterator toEnd( a_To.end() ), fromEnd( a_From.end() ) ; itrFrom != fromEnd && itrTo != toEnd && *itrFrom == *itrTo; ++itrFrom, ++itrTo );
376 // Navigate backwards in directory to reach previously found base
377 for( boost::filesystem::path::const_iterator fromEnd( a_From.end() ); itrFrom != fromEnd; ++itrFrom ) {
378 if( (*itrFrom) != "." )
379 ret /= "..";
380 }
381 // Now navigate down the directory branch
382 for (; itrTo != a_To.end(); ++itrTo)
383 ret /= *itrTo;
384 return ret;
385 }

◆ make_scoped_exit()

template<typename Callback >
scoped_exit< Callback > fc::make_scoped_exit ( Callback && c)

Definition at line 35 of file scoped_exit.hpp.

35 {
36 return scoped_exit<Callback>( std::forward<Callback>(c) );
37 }
Here is the caller graph for this function:

◆ make_tuple()

tuple fc::make_tuple ( )
inline

Definition at line 68 of file tuple.hpp.

68{ return tuple<>(); }

◆ milliseconds()

microseconds fc::milliseconds ( int64_t s)
inlineconstexpr

Definition at line 33 of file time.hpp.

33{ return microseconds( s * 1000 ); }
Here is the caller graph for this function:

◆ min()

template<typename T >
const T & fc::min ( const T & a,
const T & b )

Definition at line 140 of file utility.hpp.

140{ return a < b ? a: b; }
Here is the caller graph for this function:

◆ minutes()

microseconds fc::minutes ( int64_t m)
inlineconstexpr

Definition at line 34 of file time.hpp.

34{ return seconds(60*m); }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ modexp()

std::variant< modular_arithmetic_error, bytes > fc::modexp ( const bytes & _base,
const bytes & _exponent,
const bytes & _modulus )

Definition at line 7 of file modular_arithmetic.cpp.

8 {
9 if (_modulus.size() == 0) {
10 return modular_arithmetic_error::modulus_len_zero;
11 }
12
13 auto output = bytes(_modulus.size(), '\0');
14
15 mpz_t base, exponent, modulus;
16 mpz_inits(base, exponent, modulus, nullptr);
17
18 if (_base.size()) {
19 mpz_import(base, _base.size(), 1, 1, 0, 0, _base.data());
20 }
21
22 if (_exponent.size()) {
23 mpz_import(exponent, _exponent.size(), 1, 1, 0, 0, _exponent.data());
24 }
25
26 mpz_import(modulus, _modulus.size(), 1, 1, 0, 0, _modulus.data());
27
28 if (mpz_sgn(modulus) == 0) {
29 mpz_clears(base, exponent, modulus, nullptr);
30 return output;
31 }
32
33 mpz_t result;
34 mpz_init(result);
35
36 mpz_powm(result, base, exponent, modulus);
37 // export as little-endian
38 mpz_export(output.data(), nullptr, -1, 1, 0, 0, result);
39 // and convert to big-endian
40 std::reverse(output.begin(), output.end());
41
42 mpz_clears(base, exponent, modulus, result, nullptr);
43
44 return output;
45 }
Here is the caller graph for this function:

◆ move_append()

template<typename Container >
void fc::move_append ( Container & dest,
Container && src )

Definition at line 151 of file utility.hpp.

151 {
152 if (src.empty()) {
153 return;
154 } else if (dest.empty()) {
155 dest = std::move(src);
156 } else {
157 dest.insert(std::end(dest), std::make_move_iterator(std::begin(src)), std::make_move_iterator(std::end(src)));
158 }
159 }
Here is the caller graph for this function:

◆ number_from_stream()

template<typename T , json::parse_type parser_type>
variant fc::number_from_stream ( T & in)

Definition at line 253 of file json.cpp.

254 {
255 std::stringstream ss;
256
257 bool dot = false;
258 bool neg = false;
259 if( in.peek() == '-')
260 {
261 neg = true;
262 ss.put( in.get() );
263 }
264 bool done = false;
265
266 try
267 {
268 while( !done )
269 {
270 char c = in.peek();
271 switch( c )
272 {
273 case '.':
274 if (dot)
275 FC_THROW_EXCEPTION(parse_error_exception, "Can't parse a number with two decimal places");
276 dot = true;
277 case '0':
278 case '1':
279 case '2':
280 case '3':
281 case '4':
282 case '5':
283 case '6':
284 case '7':
285 case '8':
286 case '9':
287 ss.put( in.get() );
288 break;
289 case '\0':
290 FC_THROW_EXCEPTION( eof_exception, "unexpected end of file" );
291 default:
292 if( isalnum( c ) )
293 {
294 return ss.str() + stringFromToken( in );
295 }
296 done = true;
297 break;
298 }
299 }
300 }
301 catch (fc::eof_exception&)
302 {
303 }
304 catch (const std::ios_base::failure&)
305 {
306 }
307 std::string str = ss.str();
308 if (str == "-." || str == "." || str == "-") // check the obviously wrong things we could have encountered
309 FC_THROW_EXCEPTION(parse_error_exception, "Can't parse token \"${token}\" as a JSON numeric constant", ("token", str));
310 if( dot )
311 return parser_type == json::parse_type::legacy_parser_with_string_doubles ? variant(str) : variant(to_double(str));
312 if( neg )
313 return to_int64(str);
314 return to_uint64(str);
315 }
return str
Definition CLI11.hpp:1359
static const Segment ss(Segment::ss)
double to_double(const fc::string &)
Definition string.cpp:118
uint64_t to_uint64(const fc::string &)
Definition string.cpp:105
int64_t to_int64(const fc::string &)
Definition string.cpp:92
void neg(const Operand &op)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ objectFromStream()

template<typename T , json::parse_type parser_type>
variant_object fc::objectFromStream ( T & in,
uint32_t max_depth )

Definition at line 171 of file json.cpp.

172 {
174 try
175 {
176 char c = in.peek();
177 if( c != '{' )
178 FC_THROW_EXCEPTION( parse_error_exception,
179 "Expected '{', but read '${char}'",
180 ("char",string(&c, &c + 1)) );
181 in.get();
182 while( in.peek() != '}' )
183 {
184 if( in.peek() == ',' )
185 {
186 in.get();
187 continue;
188 }
189 if( skip_white_space(in) ) continue;
190 string key = stringFromStream( in );
191 skip_white_space(in);
192 if( in.peek() != ':' )
193 {
194 FC_THROW_EXCEPTION( parse_error_exception, "Expected ':' after key \"${key}\"",
195 ("key", key) );
196 }
197 in.get();
198 auto val = variant_from_stream<T, parser_type>( in, max_depth - 1 );
199
200 obj(std::move(key),std::move(val));
201 //skip_white_space(in);
202 }
203 if( in.peek() == '}' )
204 {
205 in.get();
206 return obj;
207 }
208 FC_THROW_EXCEPTION( parse_error_exception, "Expected '}' after ${variant}", ("variant", obj ) );
209 }
210 catch( const fc::eof_exception& e )
211 {
212 FC_THROW_EXCEPTION( parse_error_exception, "Unexpected EOF: ${e}", ("e", e.to_detail_string() ) );
213 }
214 catch( const std::ios_base::failure& e )
215 {
216 FC_THROW_EXCEPTION( parse_error_exception, "Unexpected EOF: ${e}", ("e", e.what() ) );
217 } FC_RETHROW_EXCEPTIONS( warn, "Error parsing object" );
218 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator!()

bool fc::operator! ( const fc::variant & a)

Definition at line 890 of file variant.cpp.

891 {
892 return !a.as_bool();
893 }

◆ operator!=() [1/12]

template<typename T , size_t N>
bool fc::operator!= ( const array< T, N > & a,
const array< T, N > & b )

Definition at line 102 of file array.hpp.

103 { return 0 != memcmp( a.data, b.data, N*sizeof(T) ); }
T data[N]
Definition array.hpp:37
const int N
Definition quantize.cpp:54

◆ operator!=() [2/12]

bool fc::operator!= ( const directory_iterator & r,
const directory_iterator & l )

Definition at line 191 of file filesystem.cpp.

191 {
192 return *r._p != *l._p;
193 }

◆ operator!=() [3/12]

bool fc::operator!= ( const fc::path & l,
const fc::path & r )

Definition at line 83 of file filesystem.cpp.

83{ return *l._p != *r._p; }

◆ operator!=() [4/12]

bool fc::operator!= ( const fc::variant & a,
const fc::variant & b )

Definition at line 885 of file variant.cpp.

886 {
887 return !( a == b );
888 }

◆ operator!=() [5/12]

bool fc::operator!= ( const logger & l,
std::nullptr_t  )

Definition at line 56 of file logger.cpp.

56{ return !!l.my; }

◆ operator!=() [6/12]

Definition at line 212 of file filesystem.cpp.

212 {
213 return *r._p != *l._p;
214 }

◆ operator!=() [7/12]

bool fc::operator!= ( const ripemd160 & h1,
const ripemd160 & h2 )

Definition at line 96 of file ripemd160.cpp.

96 {
97 return memcmp( h1._hash, h2._hash, sizeof(h1._hash) ) != 0;
98}
uint32_t _hash[5]
Definition ripemd160.hpp:71

◆ operator!=() [8/12]

bool fc::operator!= ( const sha1 & h1,
const sha1 & h2 )

Definition at line 82 of file sha1.cpp.

82 {
83 return memcmp( h1._hash, h2._hash, sizeof(h1._hash) ) != 0;
84}
uint32_t _hash[5]
Definition sha1.hpp:66

◆ operator!=() [9/12]

bool fc::operator!= ( const sha224 & h1,
const sha224 & h2 )

Definition at line 77 of file sha224.cpp.

77 {
78 return memcmp( h1._hash, h2._hash, sizeof(sha224) ) != 0;
79 }
uint32_t _hash[7]
Definition sha224.hpp:71

◆ operator!=() [10/12]

bool fc::operator!= ( const sha256 & h1,
const sha256 & h2 )

Definition at line 98 of file sha256.cpp.

98 {
99 return !(h1 == h2);
100 }

◆ operator!=() [11/12]

bool fc::operator!= ( const sha3 & h1,
const sha3 & h2 )

Definition at line 262 of file sha3.cpp.

263{
264 return !(h1 == h2);
265}

◆ operator!=() [12/12]

bool fc::operator!= ( const sha512 & h1,
const sha512 & h2 )

Definition at line 84 of file sha512.cpp.

84 {
85 return memcmp( h1._hash, h2._hash, sizeof(h1._hash) ) != 0;
86 }
uint64_t _hash[8]
Definition sha512.hpp:67

◆ operator&()

bloom_filter fc::operator& ( const bloom_filter & a,
const bloom_filter & b )
inline

Definition at line 582 of file bloom_filter.hpp.

583{
584 bloom_filter result = a;
585 result &= b;
586 return result;
587}

◆ operator*()

variant fc::operator* ( const fc::variant & a,
const fc::variant & b )

Definition at line 976 of file variant.cpp.

977 {
978 if( a.is_double() || b.is_double() ) return a.as_double() * b.as_double();
979 if( a.is_int64() || b.is_int64() ) return a.as_int64() * b.as_int64();
980 if( a.is_uint64() || b.is_uint64() ) return a.as_uint64() * b.as_uint64();
981 if( a.is_array() && b.is_array() )
982 {
983 const variants& aa = a.get_array();
984 const variants& ba = b.get_array();
985 variants result;
986 result.reserve( std::max(aa.size(),ba.size()) );
987 auto num = std::max(aa.size(),ba.size());
988 for( unsigned i = 0; i < num; ++i )
989 {
990 if( aa.size() > i && ba.size() > i )
991 result[i] = aa[i] * ba[i];
992 else if( aa.size() > i )
993 result[i] = aa[i];
994 else
995 result[i] = ba[i];
996 }
997 return result;
998 }
999 FC_ASSERT( false, "invalid operation ${a} * ${b}", ("a",a)("b",b) );
1000 }
bool is_double() const
Definition variant.cpp:322
Here is the call graph for this function:

◆ operator+() [1/2]

variant fc::operator+ ( const fc::variant & a,
const fc::variant & b )

Definition at line 923 of file variant.cpp.

924 {
925 if( a.is_array() && b.is_array() )
926 {
927 const variants& aa = a.get_array();
928 const variants& ba = b.get_array();
929 variants result;
930 result.reserve( std::max(aa.size(),ba.size()) );
931 auto num = std::max(aa.size(),ba.size());
932 for( unsigned i = 0; i < num; ++i )
933 {
934 if( aa.size() > i && ba.size() > i )
935 result[i] = aa[i] + ba[i];
936 else if( aa.size() > i )
937 result[i] = aa[i];
938 else
939 result[i] = ba[i];
940 }
941 return result;
942 }
943 if( a.is_string() || b.is_string() ) return a.as_string() + b.as_string();
944 if( a.is_double() || b.is_double() ) return a.as_double() + b.as_double();
945 if( a.is_int64() || b.is_int64() ) return a.as_int64() + b.as_int64();
946 if( a.is_uint64() || b.is_uint64() ) return a.as_uint64() + b.as_uint64();
947 FC_ASSERT( false, "invalid operation ${a} + ${b}", ("a",a)("b",b) );
948 }
Here is the call graph for this function:

◆ operator+() [2/2]

template<typename T , unsigned int S, typename U , typename A >
auto fc::operator+ ( const fwd< T, S, A > & x,
U && u ) -> typename detail::add<T,U>::type

Definition at line 42 of file fwd_impl.hpp.

42{ return *x+fc::forward<U>(u); }

◆ operator-() [1/2]

variant fc::operator- ( const fc::variant & a,
const fc::variant & b )

Definition at line 950 of file variant.cpp.

951 {
952 if( a.is_array() && b.is_array() )
953 {
954 const variants& aa = a.get_array();
955 const variants& ba = b.get_array();
956 variants result;
957 result.reserve( std::max(aa.size(),ba.size()) );
958 auto num = std::max(aa.size(),ba.size());
959 for( unsigned i = 0; i < num; --i )
960 {
961 if( aa.size() > i && ba.size() > i )
962 result[i] = aa[i] - ba[i];
963 else if( aa.size() > i )
964 result[i] = aa[i];
965 else
966 result[i] = ba[i];
967 }
968 return result;
969 }
970 if( a.is_string() || b.is_string() ) return a.as_string() - b.as_string();
971 if( a.is_double() || b.is_double() ) return a.as_double() - b.as_double();
972 if( a.is_int64() || b.is_int64() ) return a.as_int64() - b.as_int64();
973 if( a.is_uint64() || b.is_uint64() ) return a.as_uint64() - b.as_uint64();
974 FC_ASSERT( false, "invalid operation ${a} + ${b}", ("a",a)("b",b) );
975 }
Here is the call graph for this function:

◆ operator-() [2/2]

template<typename T , unsigned int S, typename U , typename A >
auto fc::operator- ( const fwd< T, S, A > & x,
U && u ) -> typename detail::sub<T,U>::type

Definition at line 45 of file fwd_impl.hpp.

45{ return *x-fc::forward<U>(u); }

◆ operator/() [1/2]

path fc::operator/ ( const fc::path & p,
const fc::path & o )

Definition at line 89 of file filesystem.cpp.

89 {
90 path tmp;
91 tmp = *p._p / *o._p;
92 return tmp;
93 }

◆ operator/() [2/2]

variant fc::operator/ ( const fc::variant & a,
const fc::variant & b )

Definition at line 1001 of file variant.cpp.

1002 {
1003 if( a.is_double() || b.is_double() ) return a.as_double() / b.as_double();
1004 if( a.is_int64() || b.is_int64() ) return a.as_int64() / b.as_int64();
1005 if( a.is_uint64() || b.is_uint64() ) return a.as_uint64() / b.as_uint64();
1006 if( a.is_array() && b.is_array() )
1007 {
1008 const variants& aa = a.get_array();
1009 const variants& ba = b.get_array();
1010 variants result;
1011 result.reserve( std::max(aa.size(),ba.size()) );
1012 auto num = std::max(aa.size(),ba.size());
1013 for( unsigned i = 0; i < num; ++i )
1014 {
1015 if( aa.size() > i && ba.size() > i )
1016 result[i] = aa[i] / ba[i];
1017 else if( aa.size() > i )
1018 result[i] = aa[i];
1019 else
1020 result[i] = ba[i];
1021 }
1022 return result;
1023 }
1024 FC_ASSERT( false, "invalid operation ${a} / ${b}", ("a",a)("b",b) );
1025 }
Here is the call graph for this function:

◆ operator<() [1/9]

template<typename T , size_t N>
bool fc::operator< ( const array< T, N > & a,
const array< T, N > & b )

Definition at line 94 of file array.hpp.

95 { return memcmp( a.data, b.data, N*sizeof(T) ) < 0 ; }

◆ operator<() [2/9]

bool fc::operator< ( const fc::path & l,
const fc::path & r )

Definition at line 81 of file filesystem.cpp.

81{ return *l._p < *r._p; }

◆ operator<() [3/9]

bool fc::operator< ( const fc::variant & a,
const fc::variant & b )

Definition at line 895 of file variant.cpp.

896 {
897 if( a.is_string() || b.is_string() ) return a.as_string() < b.as_string();
898 if( a.is_double() || b.is_double() ) return a.as_double() < b.as_double();
899 if( a.is_int64() || b.is_int64() ) return a.as_int64() < b.as_int64();
900 if( a.is_uint64() || b.is_uint64() ) return a.as_uint64() < b.as_uint64();
901 FC_ASSERT( false, "Invalid operation" );
902 }
Here is the call graph for this function:

◆ operator<() [4/9]

bool fc::operator< ( const ripemd160 & h1,
const ripemd160 & h2 )

Definition at line 93 of file ripemd160.cpp.

93 {
94 return memcmp( h1._hash, h2._hash, sizeof(h1._hash) ) < 0;
95}

◆ operator<() [5/9]

bool fc::operator< ( const sha1 & h1,
const sha1 & h2 )

Definition at line 79 of file sha1.cpp.

79 {
80 return memcmp( h1._hash, h2._hash, sizeof(h1._hash) ) < 0;
81}

◆ operator<() [6/9]

bool fc::operator< ( const sha224 & h1,
const sha224 & h2 )

Definition at line 74 of file sha224.cpp.

74 {
75 return memcmp( h1._hash, h2._hash, sizeof(sha224) ) < 0;
76 }

◆ operator<() [7/9]

bool fc::operator< ( const sha256 & h1,
const sha256 & h2 )

Definition at line 95 of file sha256.cpp.

95 {
96 return memcmp( h1._hash, h2._hash, sizeof(h1._hash) ) < 0;
97 }

◆ operator<() [8/9]

bool fc::operator< ( const sha3 & h1,
const sha3 & h2 )

Definition at line 258 of file sha3.cpp.

259{
260 return memcmp(h1._hash, h2._hash, sizeof(h1._hash)) < 0;
261}
uint64_t _hash[4]
Definition sha3.hpp:80

◆ operator<() [9/9]

bool fc::operator< ( const sha512 & h1,
const sha512 & h2 )

Definition at line 81 of file sha512.cpp.

81 {
82 return memcmp( h1._hash, h2._hash, sizeof(h1._hash) ) < 0;
83 }

◆ operator<<() [1/60]

ripemd160 fc::operator<< ( const ripemd160 & h1,
uint32_t i )

Definition at line 73 of file ripemd160.cpp.

73 {
74 ripemd160 result;
75 fc::detail::shift_l( h1.data(), result.data(), result.data_size(), i );
76 return result;
77}
char * data() const
Definition ripemd160.cpp:28

◆ operator<<() [2/60]

sha1 fc::operator<< ( const sha1 & h1,
uint32_t i )

Definition at line 59 of file sha1.cpp.

59 {
60 sha1 result;
61 fc::detail::shift_l( h1.data(), result.data(), result.data_size(), i );
62 return result;
63}
char * data()
Definition sha1.cpp:25

◆ operator<<() [3/60]

sha224 fc::operator<< ( const sha224 & h1,
uint32_t i )

Definition at line 57 of file sha224.cpp.

57 {
58 sha224 result;
59 fc::detail::shift_l( h1.data(), result.data(), result.data_size(), i );
60 return result;
61 }
char * data()
Definition sha224.cpp:24

◆ operator<<() [4/60]

sha256 fc::operator<< ( const sha256 & h1,
uint32_t i )

Definition at line 71 of file sha256.cpp.

71 {
72 sha256 result;
73 fc::detail::shift_l( h1.data(), result.data(), result.data_size(), i );
74 return result;
75 }
const char * data() const
Definition sha256.cpp:31

◆ operator<<() [5/60]

sha3 fc::operator<< ( const sha3 & h1,
uint32_t i )

Definition at line 229 of file sha3.cpp.

230{
231 sha3 result;
232 fc::detail::shift_l(h1.data(), result.data(), result.data_size(), i);
233 return result;
234}
const char * data() const
Definition sha3.cpp:199

◆ operator<<() [6/60]

sha512 fc::operator<< ( const sha512 & h1,
uint32_t i )

Definition at line 58 of file sha512.cpp.

58 {
59 sha512 result;
60 fc::detail::shift_l( h1.data(), result.data(), result.data_size(), i );
61 return result;
62 }
char * data()
Definition sha512.cpp:24

◆ operator<<() [7/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const __int128 & d )
inline

Definition at line 1 of file datastream.hpp.

180 {
181 ds.write( (const char*)&d, sizeof(d) );
182 return ds;
183}
Here is the call graph for this function:

◆ operator<<() [8/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_context_wrapper< bool, sysio::chain::action_trace > & obj )

Definition at line 572 of file serialization.hpp.

590 {
591 bool debug_mode = obj.context;
593 fc::raw::pack(ds, as_type<fc::unsigned_int>(obj.obj.action_ordinal));
594 fc::raw::pack(ds, as_type<fc::unsigned_int>(obj.obj.creator_action_ordinal));
595 fc::raw::pack(ds, bool(obj.obj.receipt));
596 if (obj.obj.receipt) {
597 fc::raw::pack(ds, make_history_serial_wrapper(obj.db, as_type<sysio::chain::action_receipt>(*obj.obj.receipt)));
598 }
599 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.receiver.to_uint64_t()));
600 fc::raw::pack(ds, make_history_serial_wrapper(obj.db, as_type<sysio::chain::action>(obj.obj.act)));
601 fc::raw::pack(ds, as_type<bool>(obj.obj.context_free));
602 fc::raw::pack(ds, as_type<int64_t>(debug_mode ? obj.obj.elapsed.count() : 0));
603 if (debug_mode)
604 fc::raw::pack(ds, as_type<std::string>(obj.obj.console));
605 else
606 fc::raw::pack(ds, std::string{});
607 history_serialize_container(ds, obj.db, as_type<flat_set<sysio::chain::account_delta>>(obj.obj.account_ram_deltas));
608
609 std::optional<std::string> e;
610 if (obj.obj.except) {
611 if (debug_mode)
612 e = obj.obj.except->to_string();
613 else
614 e = "Y";
615 }
616 fc::raw::pack(ds, as_type<std::optional<std::string>>(e));
617 fc::raw::pack(ds,
618 as_type<std::optional<uint64_t>>(debug_mode ? obj.obj.error_code : cap_error_code(obj.obj.error_code)));
619 fc::raw::pack(ds, as_type<sysio::chain::bytes>(obj.obj.return_value));
620
621 return ds;
622}
static const Segment ds(Segment::ds)
std::optional< uint64_t > cap_error_code(const std::optional< uint64_t > &error_code)
datastream< ST > & history_serialize_container(datastream< ST > &ds, const chainbase::database &db, const T &v)
const chainbase::database & db

◆ operator<<() [9/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_context_wrapper< bool, sysio::state_history::augmented_transaction_trace > & obj )

Definition at line 572 of file serialization.hpp.

700 {
701 std::pair<uint8_t, bool> context = std::make_pair(sysio::chain::transaction_receipt_header::hard_fail, obj.context);
703 return ds;
704}
@ hard_fail
objectively failed and error handler objectively failed thus no state change
Definition block.hpp:16

◆ operator<<() [10/60]

template<typename ST , typename P , typename T >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_context_wrapper< P, std::vector< T > > & obj )

Definition at line 106 of file serialization.hpp.

118 {
119 return history_context_serialize_container(ds, obj.db, obj.context, obj.obj);
120}
datastream< ST > & history_context_serialize_container(datastream< ST > &ds, const chainbase::database &db, const P &context, const std::vector< T > &v)

◆ operator<<() [11/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_context_wrapper< std::pair< uint8_t, bool >, sysio::state_history::augmented_transaction_trace > & obj )

Definition at line 572 of file serialization.hpp.

627 {
628 auto& trace = *obj.obj.trace;
629 bool debug_mode = obj.context.second;
631 fc::raw::pack(ds, as_type<sysio::chain::transaction_id_type>(trace.id));
632 if (trace.receipt) {
633 if (trace.failed_dtrx_trace && trace.receipt->status.value == sysio::chain::transaction_receipt_header::soft_fail)
635 else
636 fc::raw::pack(ds, as_type<uint8_t>(trace.receipt->status.value));
637 fc::raw::pack(ds, as_type<uint32_t>(trace.receipt->cpu_usage_us));
638 fc::raw::pack(ds, as_type<fc::unsigned_int>(trace.receipt->net_usage_words));
639 } else {
640 fc::raw::pack(ds, uint8_t(obj.context.first));
641 fc::raw::pack(ds, uint32_t(0));
643 }
644 fc::raw::pack(ds, as_type<int64_t>(debug_mode ? trace.elapsed.count() : 0));
645 fc::raw::pack(ds, as_type<uint64_t>(trace.net_usage));
646 fc::raw::pack(ds, as_type<bool>(trace.scheduled));
647 history_context_serialize_container(ds, obj.db, debug_mode,
648 as_type<std::vector<sysio::chain::action_trace>>(trace.action_traces));
649
650 fc::raw::pack(ds, bool(trace.account_ram_delta));
651 if (trace.account_ram_delta) {
653 ds, make_history_serial_wrapper(obj.db, as_type<sysio::chain::account_delta>(*trace.account_ram_delta)));
654 }
655
656 std::optional<std::string> e;
657 if (trace.except) {
658 if (debug_mode)
659 e = trace.except->to_string();
660 else
661 e = "Y";
662 }
663 fc::raw::pack(ds, as_type<std::optional<std::string>>(e));
664 fc::raw::pack(ds, as_type<std::optional<uint64_t>>(debug_mode ? trace.error_code : cap_error_code(trace.error_code)));
665
666 fc::raw::pack(ds, bool(trace.failed_dtrx_trace));
667 if (trace.failed_dtrx_trace) {
669 if (trace.receipt && trace.receipt->status.value == sysio::chain::transaction_receipt_header::soft_fail)
671 std::pair<uint8_t, bool> context = std::make_pair(stat, debug_mode);
672 fc::raw::pack( //
674 obj.db, context,
675 sysio::state_history::augmented_transaction_trace{trace.failed_dtrx_trace, obj.obj.partial}));
676 }
677
678 bool include_partial = obj.obj.partial && !trace.failed_dtrx_trace;
679 fc::raw::pack(ds, include_partial);
680 if (include_partial) {
681 auto& partial = *obj.obj.partial;
683 fc::raw::pack(ds, as_type<sysio::chain::time_point_sec>(partial.expiration));
684 fc::raw::pack(ds, as_type<uint16_t>(partial.ref_block_num));
685 fc::raw::pack(ds, as_type<uint32_t>(partial.ref_block_prefix));
686 fc::raw::pack(ds, as_type<fc::unsigned_int>(partial.max_net_usage_words));
687 fc::raw::pack(ds, as_type<uint8_t>(partial.max_cpu_usage_ms));
688 fc::raw::pack(ds, as_type<fc::unsigned_int>(partial.delay_sec));
689 fc::raw::pack(ds, as_type<sysio::chain::extensions_type>(partial.transaction_extensions));
690 fc::raw::pack(ds, as_type<std::vector<sysio::chain::signature_type>>(partial.signatures));
691 fc::raw::pack(ds, as_type<std::vector<sysio::chain::bytes>>(partial.context_free_data));
692 }
693
694 return ds;
695}
@ executed
succeed, no error handler executed
Definition block.hpp:14
@ soft_fail
objectively failed (not executed), error handler executed
Definition block.hpp:15

◆ operator<<() [12/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_context_wrapper< sysio::chain::table_id_object, sysio::chain::index64_object > & obj )

Definition at line 220 of file serialization.hpp.

235 {
236 return serialize_secondary_index(ds, obj.context, obj.obj);
237}
datastream< ST > & serialize_secondary_index(datastream< ST > &ds, const sysio::chain::table_id_object &context, const T &obj)
Here is the call graph for this function:

◆ operator<<() [13/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_context_wrapper< sysio::chain::table_id_object, sysio::chain::key_value_object > & obj )

Definition at line 106 of file serialization.hpp.

178 {
180 fc::raw::pack(ds, as_type<uint64_t>(obj.context.code.to_uint64_t()));
181 fc::raw::pack(ds, as_type<uint64_t>(obj.context.scope.to_uint64_t()));
182 fc::raw::pack(ds, as_type<uint64_t>(obj.context.table.to_uint64_t()));
183 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.primary_key));
184 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.payer.to_uint64_t()));
185 fc::raw::pack(ds, as_type<sysio::chain::shared_string>(obj.obj.value));
186 return ds;
187}

◆ operator<<() [14/60]

template<typename ST , typename First , typename Second >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_serial_wrapper< std::pair< First, Second > > & obj )

Definition at line 106 of file serialization.hpp.

123 {
124 fc::raw::pack(ds, obj.obj.first);
125 fc::raw::pack(ds, obj.obj.second);
126 return ds;
127}

◆ operator<<() [15/60]

template<typename ST , typename T >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_serial_wrapper< std::vector< T > > & obj )

Definition at line 106 of file serialization.hpp.

113 {
114 return history_serialize_container(ds, obj.db, obj.obj);
115}
const chainbase::database & db

◆ operator<<() [16/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_serial_wrapper< sysio::chain::account_delta > & obj )

Definition at line 220 of file serialization.hpp.

566 {
567 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.account.to_uint64_t()));
568 fc::raw::pack(ds, as_type<int64_t>(obj.obj.delta));
569 return ds;
570}

◆ operator<<() [17/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_serial_wrapper< sysio::chain::account_metadata_object > & obj )

Definition at line 106 of file serialization.hpp.

140 {
142 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.name.to_uint64_t()));
143 fc::raw::pack(ds, as_type<bool>(obj.obj.is_privileged()));
144 fc::raw::pack(ds, as_type<fc::time_point>(obj.obj.last_code_update));
145 bool has_code = obj.obj.code_hash != sysio::chain::digest_type();
146 fc::raw::pack(ds, has_code);
147 if (has_code) {
148 fc::raw::pack(ds, as_type<uint8_t>(obj.obj.vm_type));
149 fc::raw::pack(ds, as_type<uint8_t>(obj.obj.vm_version));
150 fc::raw::pack(ds, as_type<sysio::chain::digest_type>(obj.obj.code_hash));
151 }
152 return ds;
153}
checksum_type digest_type
Definition types.hpp:237

◆ operator<<() [18/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_serial_wrapper< sysio::chain::account_object > & obj )

Definition at line 106 of file serialization.hpp.

130 {
132 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.name.to_uint64_t()));
133 fc::raw::pack(ds, as_type<sysio::chain::block_timestamp_type>(obj.obj.creation_date));
134 fc::raw::pack(ds, as_type<sysio::chain::shared_string>(obj.obj.abi));
135 return ds;
136}

◆ operator<<() [19/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_serial_wrapper< sysio::chain::action > & obj )

Definition at line 220 of file serialization.hpp.

544 {
545 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.account.to_uint64_t()));
546 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.name.to_uint64_t()));
547 history_serialize_container(ds, obj.db, as_type<std::vector<sysio::chain::permission_level>>(obj.obj.authorization));
548 fc::raw::pack(ds, as_type<sysio::chain::bytes>(obj.obj.data));
549 return ds;
550}

◆ operator<<() [20/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_serial_wrapper< sysio::chain::action_receipt > & obj )

Definition at line 220 of file serialization.hpp.

553 {
555 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.receiver.to_uint64_t()));
556 fc::raw::pack(ds, as_type<sysio::chain::digest_type>(obj.obj.act_digest));
557 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.global_sequence));
558 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.recv_sequence));
559 history_serialize_container(ds, obj.db, as_type<flat_map<sysio::chain::name, uint64_t>>(obj.obj.auth_sequence));
560 fc::raw::pack(ds, as_type<fc::unsigned_int>(obj.obj.code_sequence));
561 fc::raw::pack(ds, as_type<fc::unsigned_int>(obj.obj.abi_sequence));
562 return ds;
563}

◆ operator<<() [21/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_serial_wrapper< sysio::chain::chain_config > & obj )

Definition at line 220 of file serialization.hpp.

293 {
295 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.max_block_net_usage));
296 fc::raw::pack(ds, as_type<uint32_t>(obj.obj.target_block_net_usage_pct));
297 fc::raw::pack(ds, as_type<uint32_t>(obj.obj.max_transaction_net_usage));
298 fc::raw::pack(ds, as_type<uint32_t>(obj.obj.base_per_transaction_net_usage));
299 fc::raw::pack(ds, as_type<uint32_t>(obj.obj.net_usage_leeway));
300 fc::raw::pack(ds, as_type<uint32_t>(obj.obj.context_free_discount_net_usage_num));
301 fc::raw::pack(ds, as_type<uint32_t>(obj.obj.context_free_discount_net_usage_den));
302 fc::raw::pack(ds, as_type<uint32_t>(obj.obj.max_block_cpu_usage));
303 fc::raw::pack(ds, as_type<uint32_t>(obj.obj.target_block_cpu_usage_pct));
304 fc::raw::pack(ds, as_type<uint32_t>(obj.obj.max_transaction_cpu_usage));
305 fc::raw::pack(ds, as_type<uint32_t>(obj.obj.min_transaction_cpu_usage));
306 fc::raw::pack(ds, as_type<uint32_t>(obj.obj.max_transaction_lifetime));
307 fc::raw::pack(ds, as_type<uint32_t>(obj.obj.deferred_trx_expiration_window));
308 fc::raw::pack(ds, as_type<uint32_t>(obj.obj.max_transaction_delay));
309 fc::raw::pack(ds, as_type<uint32_t>(obj.obj.max_inline_action_size));
310 fc::raw::pack(ds, as_type<uint16_t>(obj.obj.max_inline_action_depth));
311 fc::raw::pack(ds, as_type<uint16_t>(obj.obj.max_authority_depth));
312 fc::raw::pack(ds, as_type<uint32_t>(obj.obj.max_action_return_value_size));
313 return ds;
314}

◆ operator<<() [22/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_serial_wrapper< sysio::chain::code_object > & obj )

Definition at line 106 of file serialization.hpp.

156 {
158 fc::raw::pack(ds, as_type<uint8_t>(obj.obj.vm_type));
159 fc::raw::pack(ds, as_type<uint8_t>(obj.obj.vm_version));
160 fc::raw::pack(ds, as_type<sysio::chain::digest_type>(obj.obj.code_hash));
161 fc::raw::pack(ds, as_type<sysio::chain::shared_string>(obj.obj.code));
162 return ds;
163}

◆ operator<<() [23/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_serial_wrapper< sysio::chain::generated_transaction_object > & obj )

Definition at line 220 of file serialization.hpp.

349 {
351 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.sender.to_uint64_t()));
352 fc::raw::pack(ds, as_type<__uint128_t>(obj.obj.sender_id));
353 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.payer.to_uint64_t()));
354 fc::raw::pack(ds, as_type<sysio::chain::transaction_id_type>(obj.obj.trx_id));
355 fc::raw::pack(ds, as_type<sysio::chain::shared_string>(obj.obj.packed_trx));
356 return ds;
357}

◆ operator<<() [24/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_serial_wrapper< sysio::chain::global_property_object > & obj )

Definition at line 220 of file serialization.hpp.

335 {
337 fc::raw::pack(ds, as_type<std::optional<sysio::chain::block_num_type>>(obj.obj.proposed_schedule_block_num));
339 obj.db, as_type<sysio::chain::shared_producer_authority_schedule>(obj.obj.proposed_schedule)));
340 fc::raw::pack(ds, make_history_serial_wrapper(obj.db, as_type<sysio::chain::chain_config>(obj.obj.configuration)));
341 fc::raw::pack(ds, as_type<sysio::chain::chain_id_type>(obj.obj.chain_id));
342 fc::raw::pack(ds,
343 make_history_serial_wrapper(obj.db, as_type<sysio::chain::wasm_config>(obj.obj.wasm_configuration)));
344 return ds;
345}

◆ operator<<() [25/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_serial_wrapper< sysio::chain::permission_level > & obj )

Definition at line 220 of file serialization.hpp.

384 {
385 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.actor.to_uint64_t()));
386 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.permission.to_uint64_t()));
387 return ds;
388}

◆ operator<<() [26/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_serial_wrapper< sysio::chain::permission_level_weight > & obj )

Definition at line 220 of file serialization.hpp.

392 {
393 fc::raw::pack(ds, make_history_serial_wrapper(obj.db, as_type<sysio::chain::permission_level>(obj.obj.permission)));
394 fc::raw::pack(ds, as_type<uint16_t>(obj.obj.weight));
395 return ds;
396}

◆ operator<<() [27/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_serial_wrapper< sysio::chain::permission_link_object > & obj )

Definition at line 220 of file serialization.hpp.

441 {
443 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.account.to_uint64_t()));
444 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.code.to_uint64_t()));
445 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.message_type.to_uint64_t()));
446 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.required_permission.to_uint64_t()));
447 return ds;
448}

◆ operator<<() [28/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_serial_wrapper< sysio::chain::permission_object > & obj )

Definition at line 220 of file serialization.hpp.

415 {
417 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.owner.to_uint64_t()));
418 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.name.to_uint64_t()));
419 if (obj.obj.parent._id) {
420 auto& index = obj.db.get_index<sysio::chain::permission_index>();
421 const auto* parent = index.find(obj.obj.parent);
422 if (!parent) {
423 auto undo = index.last_undo_session();
424 auto it = std::find_if(undo.removed_values.begin(), undo.removed_values.end(),
425 [&](auto& x) { return x.id._id == obj.obj.parent; });
426 SYS_ASSERT(it != undo.removed_values.end(), sysio::chain::plugin_exception,
427 "can not find parent of permission_object");
428 parent = &*it;
429 }
430 fc::raw::pack(ds, as_type<uint64_t>(parent->name.to_uint64_t()));
431 } else {
432 fc::raw::pack(ds, as_type<uint64_t>(0));
433 }
434 fc::raw::pack(ds, as_type<fc::time_point>(obj.obj.last_updated));
435 fc::raw::pack(ds, make_history_serial_wrapper(obj.db, as_type<sysio::chain::shared_authority>(obj.obj.auth)));
436 return ds;
437}
const generic_index< MultiIndexType > & get_index() const
chainbase::shared_multi_index_container< permission_object, indexed_by< ordered_unique< tag< by_id >, member< permission_object, permission_object::id_type, &permission_object::id > >, ordered_unique< tag< by_parent >, composite_key< permission_object, member< permission_object, permission_object::id_type, &permission_object::parent >, member< permission_object, permission_object::id_type, &permission_object::id > > >, ordered_unique< tag< by_owner >, composite_key< permission_object, member< permission_object, account_name, &permission_object::owner >, member< permission_object, permission_name, &permission_object::name > > >, ordered_unique< tag< by_name >, composite_key< permission_object, member< permission_object, permission_name, &permission_object::name >, member< permission_object, permission_object::id_type, &permission_object::id > > > > > permission_index

◆ operator<<() [29/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_serial_wrapper< sysio::chain::protocol_state_object > & obj )

Definition at line 220 of file serialization.hpp.

370 {
372 history_serialize_container(ds, obj.db, obj.obj.activated_protocol_features);
373 return ds;
374}

◆ operator<<() [30/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_serial_wrapper< sysio::chain::protocol_state_object::activated_protocol_feature > & obj )

Definition at line 220 of file serialization.hpp.

362 {
364 fc::raw::pack(ds, as_type<sysio::chain::digest_type>(obj.obj.feature_digest));
365 fc::raw::pack(ds, as_type<uint32_t>(obj.obj.activation_block_num));
366 return ds;
367}

◆ operator<<() [31/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_serial_wrapper< sysio::chain::resource_limits::elastic_limit_parameters > & obj )

Definition at line 220 of file serialization.hpp.

514 {
516 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.target));
517 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.max));
518 fc::raw::pack(ds, as_type<uint32_t>(obj.obj.periods));
519 fc::raw::pack(ds, as_type<uint32_t>(obj.obj.max_multiplier));
521 ds, make_history_serial_wrapper(obj.db, as_type<sysio::chain::resource_limits::ratio>(obj.obj.contract_rate)));
523 ds, make_history_serial_wrapper(obj.db, as_type<sysio::chain::resource_limits::ratio>(obj.obj.expand_rate)));
524 return ds;
525}

◆ operator<<() [32/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_serial_wrapper< sysio::chain::resource_limits::ratio > & obj )

Definition at line 220 of file serialization.hpp.

505 {
507 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.numerator));
508 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.denominator));
509 return ds;
510}

◆ operator<<() [33/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_serial_wrapper< sysio::chain::resource_limits::resource_limits_config_object > & obj )

Definition at line 220 of file serialization.hpp.

530 {
534 obj.db, as_type<sysio::chain::resource_limits::elastic_limit_parameters>(obj.obj.cpu_limit_parameters)));
537 obj.db, as_type<sysio::chain::resource_limits::elastic_limit_parameters>(obj.obj.net_limit_parameters)));
538 fc::raw::pack(ds, as_type<uint32_t>(obj.obj.account_cpu_usage_average_window));
539 fc::raw::pack(ds, as_type<uint32_t>(obj.obj.account_net_usage_average_window));
540 return ds;
541};

◆ operator<<() [34/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_serial_wrapper< sysio::chain::resource_limits::resource_limits_object > & obj )

Definition at line 220 of file serialization.hpp.

452 {
453 SYS_ASSERT(!obj.obj.pending, sysio::chain::plugin_exception,
454 "accepted_block sent while resource_limits_object in pending state");
456 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.owner.to_uint64_t()));
457 fc::raw::pack(ds, as_type<int64_t>(obj.obj.net_weight));
458 fc::raw::pack(ds, as_type<int64_t>(obj.obj.cpu_weight));
459 fc::raw::pack(ds, as_type<int64_t>(obj.obj.ram_bytes));
460 return ds;
461}

◆ operator<<() [35/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_serial_wrapper< sysio::chain::resource_limits::resource_limits_state_object > & obj )

Definition at line 220 of file serialization.hpp.

489 {
491 fc::raw::pack(ds, make_history_serial_wrapper(obj.db, as_type<sysio::chain::resource_limits::usage_accumulator>(
492 obj.obj.average_block_net_usage)));
493 fc::raw::pack(ds, make_history_serial_wrapper(obj.db, as_type<sysio::chain::resource_limits::usage_accumulator>(
494 obj.obj.average_block_cpu_usage)));
495 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.total_net_weight));
496 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.total_cpu_weight));
497 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.total_ram_bytes));
498 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.virtual_net_limit));
499 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.virtual_cpu_limit));
500 return ds;
501}

◆ operator<<() [36/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_serial_wrapper< sysio::chain::resource_limits::resource_usage_object > & obj )

Definition at line 220 of file serialization.hpp.

475 {
477 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.owner.to_uint64_t()));
479 obj.db, as_type<sysio::chain::resource_limits::usage_accumulator>(obj.obj.net_usage)));
481 obj.db, as_type<sysio::chain::resource_limits::usage_accumulator>(obj.obj.cpu_usage)));
482 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.ram_usage));
483 return ds;
484}

◆ operator<<() [37/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_serial_wrapper< sysio::chain::resource_limits::usage_accumulator > & obj )

Definition at line 220 of file serialization.hpp.

465 {
467 fc::raw::pack(ds, as_type<uint32_t>(obj.obj.last_ordinal));
468 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.value_ex));
469 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.consumed));
470 return ds;
471}

◆ operator<<() [38/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_serial_wrapper< sysio::chain::shared_authority > & obj )

Definition at line 220 of file serialization.hpp.

406 {
407 fc::raw::pack(ds, as_type<uint32_t>(obj.obj.threshold));
408 history_serialize_container(ds, obj.db, obj.obj.keys);
409 history_serialize_container(ds, obj.db, obj.obj.accounts);
410 history_serialize_container(ds, obj.db, obj.obj.waits);
411 return ds;
412}

◆ operator<<() [39/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_serial_wrapper< sysio::chain::shared_block_signing_authority_v0 > & obj )

Definition at line 220 of file serialization.hpp.

269 {
270 fc::raw::pack(ds, as_type<uint32_t>(obj.obj.threshold));
273}

◆ operator<<() [40/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_serial_wrapper< sysio::chain::shared_key_weight > & obj )

Definition at line 220 of file serialization.hpp.

377 {
378 fc::raw::pack(ds, as_type<sysio::chain::public_key_type>(obj.obj.key));
379 fc::raw::pack(ds, as_type<uint16_t>(obj.obj.weight));
380 return ds;
381}

◆ operator<<() [41/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_serial_wrapper< sysio::chain::shared_producer_authority > & obj )

Definition at line 220 of file serialization.hpp.

277 {
278 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.producer_name.to_uint64_t()));
279 fc::raw::pack(ds, as_type<sysio::chain::shared_block_signing_authority>(obj.obj.authority));
280 return ds;
281}

◆ operator<<() [42/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_serial_wrapper< sysio::chain::shared_producer_authority_schedule > & obj )

Definition at line 220 of file serialization.hpp.

285 {
286 fc::raw::pack(ds, as_type<uint32_t>(obj.obj.version));
289 return ds;
290}

◆ operator<<() [43/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_serial_wrapper< sysio::chain::table_id_object > & obj )

Definition at line 106 of file serialization.hpp.

166 {
168 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.code.to_uint64_t()));
169 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.scope.to_uint64_t()));
170 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.table.to_uint64_t()));
171 fc::raw::pack(ds, as_type<uint64_t>(obj.obj.payer.to_uint64_t()));
172 return ds;
173}

◆ operator<<() [44/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_serial_wrapper< sysio::chain::wait_weight > & obj )

Definition at line 220 of file serialization.hpp.

399 {
400 fc::raw::pack(ds, as_type<uint32_t>(obj.obj.wait_sec));
401 fc::raw::pack(ds, as_type<uint16_t>(obj.obj.weight));
402 return ds;
403}

◆ operator<<() [45/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const history_serial_wrapper< sysio::chain::wasm_config > & obj )

Definition at line 220 of file serialization.hpp.

317 {
319 fc::raw::pack(ds, as_type<uint32_t>(obj.obj.max_mutable_global_bytes));
320 fc::raw::pack(ds, as_type<uint32_t>(obj.obj.max_table_elements));
321 fc::raw::pack(ds, as_type<uint32_t>(obj.obj.max_section_elements));
322 fc::raw::pack(ds, as_type<uint32_t>(obj.obj.max_linear_memory_init));
323 fc::raw::pack(ds, as_type<uint32_t>(obj.obj.max_func_local_bytes));
324 fc::raw::pack(ds, as_type<uint32_t>(obj.obj.max_nested_structures));
325 fc::raw::pack(ds, as_type<uint32_t>(obj.obj.max_symbol_bytes));
326 fc::raw::pack(ds, as_type<uint32_t>(obj.obj.max_module_bytes));
327 fc::raw::pack(ds, as_type<uint32_t>(obj.obj.max_code_bytes));
328 fc::raw::pack(ds, as_type<uint32_t>(obj.obj.max_pages));
329 fc::raw::pack(ds, as_type<uint32_t>(obj.obj.max_call_depth));
330 return ds;
331}

◆ operator<<() [46/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const int16_t & d )
inline

Definition at line 246 of file datastream.hpp.

252 {
253 ds.write( (const char*)&d, sizeof(d) );
254 return ds;
255}

◆ operator<<() [47/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const int32_t & d )
inline

Definition at line 222 of file datastream.hpp.

228 {
229 ds.write( (const char*)&d, sizeof(d) );
230 return ds;
231}

◆ operator<<() [48/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const int64_t & d )
inline

Definition at line 198 of file datastream.hpp.

204 {
205 ds.write( (const char*)&d, sizeof(d) );
206 return ds;
207}

◆ operator<<() [49/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const int8_t & d )
inline

Definition at line 270 of file datastream.hpp.

275 {
276 ds.write( (const char*)&d, sizeof(d) );
277 return ds;
278}

◆ operator<<() [50/60]

template<typename ST , typename T >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const sysio::state_history::big_vector_wrapper< T > & obj )

Definition at line 70 of file serialization.hpp.

80 {
81 FC_ASSERT(obj.obj.size() <= 1024 * 1024 * 1024);
82 fc::raw::pack(ds, unsigned_int((uint32_t)obj.obj.size()));
83 for (auto& x : obj.obj)
84 fc::raw::pack(ds, x);
85 return ds;
86}

◆ operator<<() [51/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const sysio::state_history::get_blocks_result_v0 & obj )

Definition at line 572 of file serialization.hpp.

707 {
708 fc::raw::pack(ds, obj.head);
710 fc::raw::pack(ds, obj.this_block);
711 fc::raw::pack(ds, obj.prev_block);
715 return ds;
716}
std::optional< block_position > prev_block
Definition types.hpp:108
std::optional< block_position > this_block
Definition types.hpp:107

◆ operator<<() [52/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const uint16_t & d )
inline

Definition at line 258 of file datastream.hpp.

264 {
265 ds.write( (const char*)&d, sizeof(d) );
266 return ds;
267}

◆ operator<<() [53/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const uint32_t & d )
inline

Definition at line 234 of file datastream.hpp.

240 {
241 ds.write( (const char*)&d, sizeof(d) );
242 return ds;
243}

◆ operator<<() [54/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const uint64_t & d )
inline

Definition at line 210 of file datastream.hpp.

216 {
217 ds.write( (const char*)&d, sizeof(d) );
218 return ds;
219}

◆ operator<<() [55/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const uint8_t & d )
inline

Definition at line 281 of file datastream.hpp.

286 {
287 ds.write( (const char*)&d, sizeof(d) );
288 return ds;
289}

◆ operator<<() [56/60]

template<typename ST >
datastream< ST > & fc::operator<< ( datastream< ST > & ds,
const unsigned __int128 & d )
inline

Definition at line 186 of file datastream.hpp.

192 {
193 ds.write( (const char*)&d, sizeof(d) );
194 return ds;
195}

◆ operator<<() [57/60]

template<typename ST , typename T >
datastream< ST > & fc::operator<< ( datastream< ST > & s,
const sysio::chain::may_not_exist< T > & v )

Definition at line 133 of file abi_def.hpp.

146 {
147 raw::pack(s, v.value);
148 return s;
149}

◆ operator<<() [58/60]

std::ostream & fc::operator<< ( std::ostream & os,
const fc::microseconds & t )

Definition at line 254 of file test_common.hpp.

254 {
255 os << t.count();
256 return os;
257 }
constexpr int64_t count() const
Definition time.hpp:26
os_t os
Here is the call graph for this function:

◆ operator<<() [59/60]

template<typename ... Ts>
std::ostream & fc::operator<< ( std::ostream & os,
const std::variant< Ts... > & v )

Definition at line 249 of file test_common.hpp.

249 {
251 return os;
252 }
static string to_string(const variant &v, const yield_function_t &yield, const output_formatting format=output_formatting::stringify_large_ints_and_doubles)
Definition json.cpp:674
Here is the call graph for this function:

◆ operator<<() [60/60]

template<typename T , unsigned int S, typename U , typename A >
auto fc::operator<< ( U & u,
const fwd< T, S, A > & f ) -> typename detail::insert_op<U,T>::type

Definition at line 48 of file fwd_impl.hpp.

48{ return u << *f; }

◆ operator<=()

bool fc::operator<= ( const variant & a,
const variant & b )

Definition at line 913 of file variant.cpp.

914 {
915 if( a.is_string() || b.is_string() ) return a.as_string() <= b.as_string();
916 if( a.is_double() || b.is_double() ) return a.as_double() <= b.as_double();
917 if( a.is_int64() || b.is_int64() ) return a.as_int64() <= b.as_int64();
918 if( a.is_uint64() || b.is_uint64() ) return a.as_uint64() <= b.as_uint64();
919 FC_ASSERT( false, "Invalid operation" );
920 }
Here is the call graph for this function:

◆ operator==() [1/13]

template<typename T , size_t N>
bool fc::operator== ( const array< T, N > & a,
const array< T, N > & b )

Definition at line 91 of file array.hpp.

92 { return 0 == memcmp( a.data, b.data, N*sizeof(T) ); }

◆ operator==() [2/13]

bool fc::operator== ( const directory_iterator & r,
const directory_iterator & l )

Definition at line 188 of file filesystem.cpp.

188 {
189 return *r._p == *l._p;
190 }

◆ operator==() [3/13]

bool fc::operator== ( const fc::path & l,
const fc::path & r )

Definition at line 82 of file filesystem.cpp.

82{ return *l._p == *r._p; }

◆ operator==() [4/13]

bool fc::operator== ( const fc::variant & a,
const fc::variant & b )

Definition at line 875 of file variant.cpp.

876 {
877 if( a.is_string() || b.is_string() ) return a.as_string() == b.as_string();
878 if( a.is_double() || b.is_double() ) return a.as_double() == b.as_double();
879 if( a.is_int64() || b.is_int64() ) return a.as_int64() == b.as_int64();
880 if( a.is_uint64() || b.is_uint64() ) return a.as_uint64() == b.as_uint64();
881 if( a.is_array() || b.is_array() ) return a.get_array() == b.get_array();
882 return false;
883 }
Here is the call graph for this function:

◆ operator==() [5/13]

bool fc::operator== ( const logger & l,
std::nullptr_t  )

Definition at line 55 of file logger.cpp.

55{ return !l.my; }

◆ operator==() [6/13]

bool fc::operator== ( const private_key & a,
const private_key & b )

◆ operator==() [7/13]

bool fc::operator== ( const recursive_directory_iterator & r,
const recursive_directory_iterator & l )

Definition at line 209 of file filesystem.cpp.

209 {
210 return *r._p == *l._p;
211 }

◆ operator==() [8/13]

bool fc::operator== ( const ripemd160 & h1,
const ripemd160 & h2 )

Definition at line 99 of file ripemd160.cpp.

99 {
100 return memcmp( h1._hash, h2._hash, sizeof(h1._hash) ) == 0;
101}

◆ operator==() [9/13]

bool fc::operator== ( const sha1 & h1,
const sha1 & h2 )

Definition at line 85 of file sha1.cpp.

85 {
86 return memcmp( h1._hash, h2._hash, sizeof(h1._hash) ) == 0;
87}

◆ operator==() [10/13]

bool fc::operator== ( const sha224 & h1,
const sha224 & h2 )

Definition at line 80 of file sha224.cpp.

80 {
81 return memcmp( h1._hash, h2._hash, sizeof(sha224) ) == 0;
82 }

◆ operator==() [11/13]

bool fc::operator== ( const sha256 & h1,
const sha256 & h2 )

Definition at line 101 of file sha256.cpp.

101 {
102 // idea to not use memcmp, from:
103 // https://lemire.me/blog/2018/08/22/avoid-lexicographical-comparisons-when-testing-for-string-equality/
104 return
105 h1._hash[0] == h2._hash[0] &&
106 h1._hash[1] == h2._hash[1] &&
107 h1._hash[2] == h2._hash[2] &&
108 h1._hash[3] == h2._hash[3];
109 }

◆ operator==() [12/13]

bool fc::operator== ( const sha3 & h1,
const sha3 & h2 )

Definition at line 266 of file sha3.cpp.

267{
268 // idea to not use memcmp, from:
269 // https://lemire.me/blog/2018/08/22/avoid-lexicographical-comparisons-when-testing-for-string-equality/
270 return h1._hash[0] == h2._hash[0] &&
271 h1._hash[1] == h2._hash[1] &&
272 h1._hash[2] == h2._hash[2] &&
273 h1._hash[3] == h2._hash[3];
274}

◆ operator==() [13/13]

bool fc::operator== ( const sha512 & h1,
const sha512 & h2 )

Definition at line 87 of file sha512.cpp.

87 {
88 return memcmp( h1._hash, h2._hash, sizeof(h1._hash) ) == 0;
89 }

◆ operator>() [1/8]

template<typename T , size_t N>
bool fc::operator> ( const array< T, N > & a,
const array< T, N > & b )

Definition at line 98 of file array.hpp.

99 { return memcmp( a.data, b.data, N*sizeof(T) ) > 0 ; }

◆ operator>() [2/8]

bool fc::operator> ( const fc::variant & a,
const fc::variant & b )

Definition at line 904 of file variant.cpp.

905 {
906 if( a.is_string() || b.is_string() ) return a.as_string() > b.as_string();
907 if( a.is_double() || b.is_double() ) return a.as_double() > b.as_double();
908 if( a.is_int64() || b.is_int64() ) return a.as_int64() > b.as_int64();
909 if( a.is_uint64() || b.is_uint64() ) return a.as_uint64() > b.as_uint64();
910 FC_ASSERT( false, "Invalid operation" );
911 }
Here is the call graph for this function:

◆ operator>() [3/8]

bool fc::operator> ( const ripemd160 & h1,
const ripemd160 & h2 )

Definition at line 90 of file ripemd160.cpp.

90 {
91 return memcmp( h1._hash, h2._hash, sizeof(h1._hash) ) > 0;
92}

◆ operator>() [4/8]

bool fc::operator> ( const sha1 & h1,
const sha1 & h2 )

Definition at line 76 of file sha1.cpp.

76 {
77 return memcmp( h1._hash, h2._hash, sizeof(h1._hash) ) > 0;
78}

◆ operator>() [5/8]

bool fc::operator> ( const sha224 & h1,
const sha224 & h2 )

Definition at line 71 of file sha224.cpp.

71 {
72 return memcmp( h1._hash, h2._hash, sizeof(sha224) ) > 0;
73 }

◆ operator>() [6/8]

bool fc::operator> ( const sha256 & h1,
const sha256 & h2 )

Definition at line 92 of file sha256.cpp.

92 {
93 return memcmp( h1._hash, h2._hash, sizeof(h1._hash) ) > 0;
94 }

◆ operator>() [7/8]

bool fc::operator> ( const sha3 & h1,
const sha3 & h2 )

Definition at line 254 of file sha3.cpp.

255{
256 return memcmp(h1._hash, h2._hash, sizeof(h1._hash)) > 0;
257}

◆ operator>() [8/8]

bool fc::operator> ( const sha512 & h1,
const sha512 & h2 )

Definition at line 78 of file sha512.cpp.

78 {
79 return memcmp( h1._hash, h2._hash, sizeof(h1._hash) ) > 0;
80 }

◆ operator>=() [1/6]

bool fc::operator>= ( const ripemd160 & h1,
const ripemd160 & h2 )

Definition at line 87 of file ripemd160.cpp.

87 {
88 return memcmp( h1._hash, h2._hash, sizeof(h1._hash) ) >= 0;
89}

◆ operator>=() [2/6]

bool fc::operator>= ( const sha1 & h1,
const sha1 & h2 )

Definition at line 73 of file sha1.cpp.

73 {
74 return memcmp( h1._hash, h2._hash, sizeof(h1._hash) ) >= 0;
75}

◆ operator>=() [3/6]

bool fc::operator>= ( const sha224 & h1,
const sha224 & h2 )

Definition at line 68 of file sha224.cpp.

68 {
69 return memcmp( h1._hash, h2._hash, sizeof(sha224) ) >= 0;
70 }

◆ operator>=() [4/6]

bool fc::operator>= ( const sha256 & h1,
const sha256 & h2 )

Definition at line 89 of file sha256.cpp.

89 {
90 return memcmp( h1._hash, h2._hash, sizeof(h1._hash) ) >= 0;
91 }

◆ operator>=() [5/6]

bool fc::operator>= ( const sha3 & h1,
const sha3 & h2 )

Definition at line 250 of file sha3.cpp.

251{
252 return memcmp(h1._hash, h2._hash, sizeof(h1._hash)) >= 0;
253}

◆ operator>=() [6/6]

bool fc::operator>= ( const sha512 & h1,
const sha512 & h2 )

Definition at line 75 of file sha512.cpp.

75 {
76 return memcmp( h1._hash, h2._hash, sizeof(h1._hash) ) >= 0;
77 }

◆ operator>>() [1/14]

sha256 fc::operator>> ( const sha256 & h1,
uint32_t i )

Definition at line 76 of file sha256.cpp.

76 {
77 sha256 result;
78 fc::detail::shift_r( h1.data(), result.data(), result.data_size(), i );
79 return result;
80 }

◆ operator>>() [2/14]

sha3 fc::operator>> ( const sha3 & h1,
uint32_t i )

Definition at line 235 of file sha3.cpp.

236{
237 sha3 result;
238 fc::detail::shift_r(h1.data(), result.data(), result.data_size(), i);
239 return result;
240}

◆ operator>>() [3/14]

template<typename ST , typename DATA >
datastream< ST > & fc::operator>> ( datastream< ST > & ds,
__int128 & d )
inline

Definition at line 186 of file datastream.hpp.

186 {
187 ds.read((char*)&d, sizeof(d) );
188 return ds;
189}

◆ operator>>() [4/14]

template<typename ST , typename DATA >
datastream< ST > & fc::operator>> ( datastream< ST > & ds,
int16_t & d )
inline

Definition at line 258 of file datastream.hpp.

258 {
259 ds.read((char*)&d, sizeof(d) );
260 return ds;
261}

◆ operator>>() [5/14]

template<typename ST , typename DATA >
datastream< ST > & fc::operator>> ( datastream< ST > & ds,
int32_t & d )
inline

Definition at line 234 of file datastream.hpp.

234 {
235 ds.read((char*)&d, sizeof(d) );
236 return ds;
237}

◆ operator>>() [6/14]

template<typename ST , typename DATA >
datastream< ST > & fc::operator>> ( datastream< ST > & ds,
int64_t & d )
inline

Definition at line 210 of file datastream.hpp.

210 {
211 ds.read((char*)&d, sizeof(d) );
212 return ds;
213}

◆ operator>>() [7/14]

template<typename ST , typename DATA >
datastream< ST > & fc::operator>> ( datastream< ST > & ds,
int8_t & d )
inline

Definition at line 281 of file datastream.hpp.

281 {
282 ds.read((char*)&d, sizeof(d) );
283 return ds;
284}

◆ operator>>() [8/14]

template<typename ST , typename DATA >
datastream< ST > & fc::operator>> ( datastream< ST > & ds,
uint16_t & d )
inline

Definition at line 270 of file datastream.hpp.

270 {
271 ds.read((char*)&d, sizeof(d) );
272 return ds;
273}

◆ operator>>() [9/14]

template<typename ST , typename DATA >
datastream< ST > & fc::operator>> ( datastream< ST > & ds,
uint32_t & d )
inline

Definition at line 246 of file datastream.hpp.

246 {
247 ds.read((char*)&d, sizeof(d) );
248 return ds;
249}

◆ operator>>() [10/14]

template<typename ST , typename DATA >
datastream< ST > & fc::operator>> ( datastream< ST > & ds,
uint64_t & d )
inline

Definition at line 222 of file datastream.hpp.

222 {
223 ds.read((char*)&d, sizeof(d) );
224 return ds;
225}

◆ operator>>() [11/14]

template<typename ST , typename DATA >
datastream< ST > & fc::operator>> ( datastream< ST > & ds,
uint8_t & d )
inline

Definition at line 292 of file datastream.hpp.

292 {
293 ds.read((char*)&d, sizeof(d) );
294 return ds;
295}

◆ operator>>() [12/14]

template<typename ST , typename DATA >
datastream< ST > & fc::operator>> ( datastream< ST > & ds,
unsigned __int128 & d )
inline

Definition at line 198 of file datastream.hpp.

198 {
199 ds.read((char*)&d, sizeof(d) );
200 return ds;
201}

◆ operator>>() [13/14]

template<typename ST , typename T >
datastream< ST > & fc::operator>> ( datastream< ST > & s,
sysio::chain::may_not_exist< T > & v )

Definition at line 152 of file abi_def.hpp.

152 {
153 if (s.remaining())
154 raw::unpack(s, v.value);
155 return s;
156}
Here is the call graph for this function:

◆ operator>>() [14/14]

template<typename T , unsigned int S, typename U , typename A >
auto fc::operator>> ( U & u,
fwd< T, S, A > & f ) -> typename detail::extract_op<U,T>::type

Definition at line 51 of file fwd_impl.hpp.

51{ return u >> *f; }

◆ operator^() [1/7]

bloom_filter fc::operator^ ( const bloom_filter & a,
const bloom_filter & b )
inline

Definition at line 596 of file bloom_filter.hpp.

597{
598 bloom_filter result = a;
599 result ^= b;
600 return result;
601}

◆ operator^() [2/7]

ripemd160 fc::operator^ ( const ripemd160 & h1,
const ripemd160 & h2 )

Definition at line 78 of file ripemd160.cpp.

78 {
79 ripemd160 result;
80 result._hash[0] = h1._hash[0] ^ h2._hash[0];
81 result._hash[1] = h1._hash[1] ^ h2._hash[1];
82 result._hash[2] = h1._hash[2] ^ h2._hash[2];
83 result._hash[3] = h1._hash[3] ^ h2._hash[3];
84 result._hash[4] = h1._hash[4] ^ h2._hash[4];
85 return result;
86}

◆ operator^() [3/7]

sha1 fc::operator^ ( const sha1 & h1,
const sha1 & h2 )

Definition at line 64 of file sha1.cpp.

64 {
65 sha1 result;
66 result._hash[0] = h1._hash[0] ^ h2._hash[0];
67 result._hash[1] = h1._hash[1] ^ h2._hash[1];
68 result._hash[2] = h1._hash[2] ^ h2._hash[2];
69 result._hash[3] = h1._hash[3] ^ h2._hash[3];
70 result._hash[4] = h1._hash[4] ^ h2._hash[4];
71 return result;
72}

◆ operator^() [4/7]

sha224 fc::operator^ ( const sha224 & h1,
const sha224 & h2 )

Definition at line 62 of file sha224.cpp.

62 {
63 sha224 result;
64 for( uint32_t i = 0; i < 7; ++i )
65 result._hash[i] = h1._hash[i] ^ h2._hash[i];
66 return result;
67 }

◆ operator^() [5/7]

sha256 fc::operator^ ( const sha256 & h1,
const sha256 & h2 )

Definition at line 81 of file sha256.cpp.

81 {
82 sha256 result;
83 result._hash[0] = h1._hash[0] ^ h2._hash[0];
84 result._hash[1] = h1._hash[1] ^ h2._hash[1];
85 result._hash[2] = h1._hash[2] ^ h2._hash[2];
86 result._hash[3] = h1._hash[3] ^ h2._hash[3];
87 return result;
88 }

◆ operator^() [6/7]

sha3 fc::operator^ ( const sha3 & h1,
const sha3 & h2 )

Definition at line 241 of file sha3.cpp.

242{
243 sha3 result;
244 result._hash[0] = h1._hash[0] ^ h2._hash[0];
245 result._hash[1] = h1._hash[1] ^ h2._hash[1];
246 result._hash[2] = h1._hash[2] ^ h2._hash[2];
247 result._hash[3] = h1._hash[3] ^ h2._hash[3];
248 return result;
249}

◆ operator^() [7/7]

sha512 fc::operator^ ( const sha512 & h1,
const sha512 & h2 )

Definition at line 63 of file sha512.cpp.

63 {
64 sha512 result;
65 result._hash[0] = h1._hash[0] ^ h2._hash[0];
66 result._hash[1] = h1._hash[1] ^ h2._hash[1];
67 result._hash[2] = h1._hash[2] ^ h2._hash[2];
68 result._hash[3] = h1._hash[3] ^ h2._hash[3];
69 result._hash[4] = h1._hash[4] ^ h2._hash[4];
70 result._hash[5] = h1._hash[5] ^ h2._hash[5];
71 result._hash[6] = h1._hash[6] ^ h2._hash[6];
72 result._hash[7] = h1._hash[7] ^ h2._hash[7];
73 return result;
74 }

◆ operator|()

bloom_filter fc::operator| ( const bloom_filter & a,
const bloom_filter & b )
inline

Definition at line 589 of file bloom_filter.hpp.

590{
591 bloom_filter result = a;
592 result |= b;
593 return result;
594}

◆ overloaded()

template<class... Ts>
fc::overloaded ( Ts... ) -> overloaded< Ts... >

◆ parseEscape()

template<typename T >
char fc::parseEscape ( T & in)

Definition at line 36 of file json.cpp.

37 {
38 if( in.peek() == '\\' )
39 {
40 try {
41 in.get();
42 switch( in.peek() )
43 {
44 case 't':
45 in.get();
46 return '\t';
47 case 'n':
48 in.get();
49 return '\n';
50 case 'r':
51 in.get();
52 return '\r';
53 case '\\':
54 in.get();
55 return '\\';
56 default:
57 return in.get();
58 }
59 } FC_RETHROW_EXCEPTIONS( info, "Stream ended with '\\'" );
60 }
61 FC_THROW_EXCEPTION( parse_error_exception, "Expected '\\'" );
62 }
Here is the caller graph for this function:

◆ pretty_print()

std::string fc::pretty_print ( const std::string & v,
uint8_t indent )

Definition at line 682 of file json.cpp.

682 {
683 int level = 0;
684 std::stringstream ss;
685 bool first = false;
686 bool quote = false;
687 bool escape = false;
688 for( uint32_t i = 0; i < v.size(); ++i ) {
689 switch( v[i] ) {
690 case '\\':
691 if( !escape ) {
692 if( quote )
693 escape = true;
694 } else { escape = false; }
695 ss<<v[i];
696 break;
697 case ':':
698 if( !quote ) {
699 ss<<": ";
700 } else {
701 ss<<':';
702 }
703 break;
704 case '"':
705 if( first ) {
706 ss<<'\n';
707 for( int i = 0; i < level*indent; ++i ) ss<<' ';
708 first = false;
709 }
710 if( !escape ) {
711 quote = !quote;
712 }
713 escape = false;
714 ss<<'"';
715 break;
716 case '{':
717 case '[':
718 ss<<v[i];
719 if( !quote ) {
720 ++level;
721 first = true;
722 }else {
723 escape = false;
724 }
725 break;
726 case '}':
727 case ']':
728 if( !quote ) {
729 if( v[i-1] != '[' && v[i-1] != '{' ) {
730 ss<<'\n';
731 }
732 --level;
733 if( !first ) {
734 for( int i = 0; i < level*indent; ++i ) ss<<' ';
735 }
736 first = false;
737 ss<<v[i];
738 break;
739 } else {
740 escape = false;
741 ss<<v[i];
742 }
743 break;
744 case ',':
745 if( !quote ) {
746 ss<<',';
747 first = true;
748 } else {
749 escape = false;
750 ss<<',';
751 }
752 break;
753 case 'n':
754 //If we're in quotes and see a \n, \b, \f, \r, \t, or \u, just print it literally but unset the escape flag.
755 case 'b':
756 case 'f':
757 case 'r':
758 case 't':
759 case 'u':
760 if( quote && escape )
761 escape = false;
762 //No break; fall through to default case
763 default:
764 if( first ) {
765 ss<<'\n';
766 for( int i = 0; i < level*indent; ++i ) ss<<' ';
767 first = false;
768 }
769 ss << v[i];
770 }
771 }
772 return ss.str();
773 }
uint32_t level
Type of a channel package.
Definition levels.hpp:37
Here is the caller graph for this function:

◆ prune_invalid_utf8()

string fc::prune_invalid_utf8 ( const std::string_view & str)

Invalid utf8 code points are purned, 0x80-0x9F C1 control characters are escaped

Definition at line 47 of file utf8.cpp.

47 {
48 const auto invalid_range = std::make_pair<uint32_t, uint32_t>(0x80, 0x9F);
49 auto [itr, v] = find_invalid( str.begin(), str.end(), invalid_range );
50 if( itr == str.end() ) return std::string( str );
51
52 string result;
53 auto escape = [&result](uint32_t v) { // v is [0x80-0x9F]
54 result += "\\u00";
55 result += hex_digits[v >> 4u];
56 result += hex_digits[v & 15u];
57 };
58
59 result = string( str.begin(), itr );
60 if( v != UINT32_MAX ) escape(v);
61 while( itr != str.end() ) {
62 ++itr;
63 auto start = itr;
64 std::tie(itr, v) = find_invalid( start, str.end(), invalid_range );
65 result += string( start, itr );
66 if( v != UINT32_MAX ) escape(v);
67 }
68 return result;
69 }
constexpr char hex_digits[]
Definition utf8.cpp:11
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rand_bytes()

void fc::rand_bytes ( char * buf,
int count )

Definition at line 9 of file rand.cpp.

10{
11 int result = RAND_bytes((unsigned char*)buf, count);
12 if (result != 1)
13 FC_THROW("Error calling OpenSSL's RAND_bytes(): ${code}", ("code", (uint32_t)ERR_get_error()));
14}
int * count
Here is the caller graph for this function:

◆ rand_pseudo_bytes()

void fc::rand_pseudo_bytes ( char * buf,
int count )

Definition at line 16 of file rand.cpp.

17{
19}
void rand_bytes(char *buf, int count)
Definition rand.cpp:9
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_file_contents()

void fc::read_file_contents ( const fc::path & filename,
std::string & result )

Grab the full contents of a file into a string object. NB reading a full file into memory is a poor choice if the file may be very large.

Definition at line 14 of file fstream.cpp.

15 {
16 const boost::filesystem::path& bfp = filename;
17 boost::filesystem::ifstream f( bfp, std::ios::in | std::ios::binary );
18 FC_ASSERT(f, "Failed to open ${filename}", ("filename", filename));
19 // don't use fc::stringstream here as we need something with override for << rdbuf()
20 std::stringstream ss;
21 ss << f.rdbuf();
22 FC_ASSERT(f, "Failed reading ${filename}", ("filename", filename));
23 result = ss.str();
24 }
Here is the caller graph for this function:

◆ record_assert_trip()

void fc::record_assert_trip ( const char * filename,
uint32_t lineno,
const char * expr )

Definition at line 305 of file exception.cpp.

310 {
311 fc::mutable_variant_object assert_trip_info =
313 ("source_file", filename)
314 ("source_lineno", lineno)
315 ("expr", expr)
316 ;
317 /* TODO: restore this later
318 std::cout
319 << "FC_ASSERT triggered: "
320 << fc::json::to_string( assert_trip_info ) << "\n";
321 */
322 return;
323 }

◆ remove()

bool fc::remove ( const path & p)

Definition at line 350 of file filesystem.cpp.

350 {
351 try {
352 return boost::filesystem::remove( f );
353 } catch ( ... ) {
354 FC_THROW( "Unable to remove '${path}'", ( "path", f )("exception", fc::except_str() ) );
355 }
356 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ remove_all()

void fc::remove_all ( const path & p)

Definition at line 248 of file filesystem.cpp.

248{ boost::filesystem::remove_all(p); }
Here is the caller graph for this function:

◆ rename()

void fc::rename ( const path & from,
const path & to )

Definition at line 326 of file filesystem.cpp.

326 {
327 try {
328 boost::filesystem::rename( boost::filesystem::path(f), boost::filesystem::path(t) );
329 } catch ( boost::system::system_error& ) {
330 try{
331 boost::filesystem::copy( boost::filesystem::path(f), boost::filesystem::path(t) );
332 boost::filesystem::remove( boost::filesystem::path(f));
333 } catch ( boost::system::system_error& e ) {
334 FC_THROW( "Rename from ${srcfile} to ${dstfile} failed because ${reason}",
335 ("srcfile",f)("dstfile",t)("reason",e.what() ) );
336 }
337 } catch ( ... ) {
338 FC_THROW( "Rename from ${srcfile} to ${dstfile} failed",
339 ("srcfile",f)("dstfile",t)("inner", fc::except_str() ) );
340 }
341 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ resize_file()

void fc::resize_file ( const path & file,
size_t s )

Definition at line 282 of file filesystem.cpp.

283 {
284 try {
285 boost::filesystem::resize_file( f, t );
286 }
287 catch ( boost::system::system_error& e )
288 {
289 FC_THROW( "Resize file '${f}' to size ${s} failed: ${reason}",
290 ("f",f)("s",t)( "reason", e.what() ) );
291 }
292 catch ( ... )
293 {
294 FC_THROW( "Resize file '${f}' to size ${s} failed: ${reason}",
295 ("f",f)("s",t)( "reason", fc::except_str() ) );
296 }
297 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ resolve()

std::vector< boost::asio::ip::udp::endpoint > fc::resolve ( boost::asio::io_service & io_service,
const std::string & host,
uint16_t port )

Definition at line 6 of file resolve.cpp.

8 {
9 using q = boost::asio::ip::udp::resolver::query;
10 using b = boost::asio::ip::resolver_query_base;
11 boost::asio::ip::udp::resolver res(io_service);
12 boost::system::error_code ec;
13 auto ep = res.resolve(q(host, std::to_string(uint64_t(port)),
14 b::address_configured | b::numeric_service), ec);
15 if(!ec)
16 {
17 std::vector<boost::asio::ip::udp::endpoint> eps;
18 while(ep != boost::asio::ip::udp::resolver::iterator())
19 {
20 if(ep->endpoint().address().is_v4())
21 {
22 eps.push_back(*ep);
23 }
24 // TODO: add support for v6
25 ++ep;
26 }
27 return eps;
28 }
29 FC_THROW_EXCEPTION(unknown_host_exception,
30 "name resolution failed: ${reason}",
31 ("reason", ec.message()));
32 }
Here is the caller graph for this function:

◆ seconds()

microseconds fc::seconds ( int64_t s)
inlineconstexpr

Definition at line 32 of file time.hpp.

32{ return microseconds( s * 1000000 ); }
Here is the caller graph for this function:

◆ serialize_secondary_index()

template<typename ST , typename T >
datastream< ST > & fc::serialize_secondary_index ( datastream< ST > & ds,
const sysio::chain::table_id_object & context,
const T & obj )

Definition at line 220 of file serialization.hpp.

221 {
223 fc::raw::pack(ds, as_type<uint64_t>(context.code.to_uint64_t()));
224 fc::raw::pack(ds, as_type<uint64_t>(context.scope.to_uint64_t()));
225 fc::raw::pack(ds, as_type<uint64_t>(context.table.to_uint64_t()));
226 fc::raw::pack(ds, as_type<uint64_t>(obj.primary_key));
227 fc::raw::pack(ds, as_type<uint64_t>(obj.payer.to_uint64_t()));
228 serialize_secondary_index_data(ds, obj.secondary_key);
229 return ds;
230}
void serialize_secondary_index_data(datastream< ST > &ds, const T &obj)

◆ serialize_secondary_index_data() [1/4]

template<typename ST >
void fc::serialize_secondary_index_data ( datastream< ST > & ds,
const float128_t & obj )

Definition at line 202 of file serialization.hpp.

202 {
203 __uint128_t i;
204 memcpy(&i, &obj, sizeof(i));
205 fc::raw::pack(ds, i);
206}
Here is the call graph for this function:

◆ serialize_secondary_index_data() [2/4]

template<typename ST >
void fc::serialize_secondary_index_data ( datastream< ST > & ds,
const float64_t & obj )

Definition at line 195 of file serialization.hpp.

195 {
196 uint64_t i;
197 memcpy(&i, &obj, sizeof(i));
198 fc::raw::pack(ds, i);
199}
Here is the call graph for this function:

◆ serialize_secondary_index_data() [3/4]

template<typename ST >
void fc::serialize_secondary_index_data ( datastream< ST > & ds,
const sysio::chain::key256_t & obj )

Definition at line 209 of file serialization.hpp.

209 {
210 auto rev = [&](__uint128_t x) {
211 char* ch = reinterpret_cast<char*>(&x);
212 std::reverse(ch, ch + sizeof(x));
213 return x;
214 };
215 fc::raw::pack(ds, rev(obj[0]));
216 fc::raw::pack(ds, rev(obj[1]));
217}
Here is the call graph for this function:

◆ serialize_secondary_index_data() [4/4]

template<typename ST , typename T >
void fc::serialize_secondary_index_data ( datastream< ST > & ds,
const T & obj )

Definition at line 190 of file serialization.hpp.

190 {
191 fc::raw::pack(ds, obj);
192}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_console_echo()

void fc::set_console_echo ( bool enable_echo)

enables / disables echoing of console input, useful for entering passwords on the console.

Definition at line 28 of file console.cpp.

29{
30 termios oldt;
31 tcgetattr(STDIN_FILENO, &oldt);
32 termios newt = oldt;
33 if( enable_echo )
34 {
35 newt.c_lflag |= ECHO;
36 }
37 else
38 {
39 newt.c_lflag &= ~ECHO;
40 }
41 tcsetattr(STDIN_FILENO, TCSANOW, &newt);
42}
Here is the caller graph for this function:

◆ set_os_thread_name()

void fc::set_os_thread_name ( const string & name)

Definition at line 136 of file logger_config.cpp.

136 {
137#ifdef FC_USE_PTHREAD_NAME_NP
138 pthread_setname_np( pthread_self(), name.c_str() );
139#endif
140 }
Here is the caller graph for this function:

◆ set_thread_name()

void fc::set_thread_name ( const string & name)

Definition at line 141 of file logger_config.cpp.

141 {
142 thread_name = name;
143 }

◆ set_variant_type()

void fc::set_variant_type ( variant * v,
variant::type_id t )

The TypeID is stored in the 'last byte' of the variant.

Definition at line 18 of file variant.cpp.

19{
20 char* data = reinterpret_cast<char*>(v);
21 data[ sizeof(variant) -1 ] = t;
22}
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
Definition variant.hpp:191
Here is the caller graph for this function:

◆ skip_white_space()

template<typename T >
bool fc::skip_white_space ( T & in)

Definition at line 65 of file json.cpp.

66 {
67 bool skipped = false;
68 while( true )
69 {
70 switch( in.peek() )
71 {
72 case ' ':
73 case '\t':
74 case '\n':
75 case '\r':
76 skipped = true;
77 in.get();
78 break;
79 case '\0':
80 FC_THROW_EXCEPTION( eof_exception, "unexpected end of file" );
81 break;
82 default:
83 return skipped;
84 }
85 }
86 }
Here is the caller graph for this function:

◆ smaz_compress() [1/2]

uint32_t fc::smaz_compress ( const char * in,
int inlen,
char * out,
int outlen )

Definition at line 85 of file smaz.cpp.

85 {
86 unsigned int h1,h2,h3=0;
87 int verblen = 0, _outlen = outlen;
88 char verb[256], *_out = out;
89
90 while(inlen) {
91 int j = 7, needed;
92 char *flush = NULL;
93 const char *slot;
94
95 h1 = h2 = in[0]<<3;
96 if (inlen > 1) h2 += in[1];
97 if (inlen > 2) h3 = h2^in[2];
98 if (j > inlen) j = inlen;
99
100 /* Try to lookup substrings into the hash table, starting from the
101 * longer to the shorter substrings */
102 for (; j > 0; j--) {
103 switch(j) {
104 case 1: slot = Smaz_cb[h1%241]; break;
105 case 2: slot = Smaz_cb[h2%241]; break;
106 default: slot = Smaz_cb[h3%241]; break;
107 }
108 while(slot[0]) {
109 if (slot[0] == j && memcmp(slot+1,in,j) == 0) {
110 /* Match found in the hash table,
111 * prepare a verbatim bytes flush if needed */
112 if (verblen) {
113 needed = (verblen == 1) ? 2 : 2+verblen;
114 flush = out;
115 out += needed;
116 outlen -= needed;
117 }
118 /* Emit the byte */
119 if (outlen <= 0) return _outlen+1;
120 out[0] = slot[slot[0]+1];
121 out++;
122 outlen--;
123 inlen -= j;
124 in += j;
125 goto out;
126 } else {
127 slot += slot[0]+2;
128 }
129 }
130 }
131 /* Match not found - add the byte to the verbatim buffer */
132 verb[verblen] = in[0];
133 verblen++;
134 inlen--;
135 in++;
136out:
137 /* Prepare a flush if we reached the flush length limit, and there
138 * is not already a pending flush operation. */
139 if (!flush && (verblen == 256 || (verblen > 0 && inlen == 0))) {
140 needed = (verblen == 1) ? 2 : 2+verblen;
141 flush = out;
142 out += needed;
143 outlen -= needed;
144 if (outlen < 0) return _outlen+1;
145 }
146 /* Perform a verbatim flush if needed */
147 if (flush) {
148 if (verblen == 1) {
149 flush[0] = (signed char)254;
150 flush[1] = verb[0];
151 } else {
152 flush[0] = (signed char)255;
153 flush[1] = (signed char)(verblen-1);
154 memcpy(flush+2,verb,verblen);
155 }
156 flush = NULL;
157 verblen = 0;
158 }
159 }
160 return out-_out;
161}
yubihsm_pkcs11_slot * slot
Here is the call graph for this function:

◆ smaz_compress() [2/2]

std::string fc::smaz_compress ( const std::string & in)

Definition at line 207 of file smaz.cpp.

208 {
209 std::string out;
210 out.resize(in.size());
211 auto out_len = smaz_compress( in.c_str(), in.size(), &out[0], out.size() );
212 FC_ASSERT( out_len <= out.size() );
213 out.resize(out_len);
214 return out;
215 }
std::string smaz_compress(const std::string &in)
Definition smaz.cpp:207
size_t out_len
Here is the call graph for this function:
Here is the caller graph for this function:

◆ smaz_decompress() [1/2]

void fc::smaz_decompress ( const char * in,
uint32_t inlen,
std::stringstream & ss )

Definition at line 163 of file smaz.cpp.

163 {
164 const unsigned char *c = (const unsigned char*) in;
165// char *_out = out;
166// int _outlen = outlen;
167
168 while(inlen) {
169 if (*c == 254) {
170 /* Verbatim byte */
171 //if (outlen < 1) return _outlen+1;
172 //*out = *(c+1);
173 ss.put( *(c+1) );
174 //out++;
175 //outlen--;
176 c += 2;
177 inlen -= 2;
178 } else if (*c == 255) {
179 /* Verbatim string */
180 int len = (*(c+1))+1;
181 //if (outlen < len) return _outlen+1;
182 ss.write( (const char*)(c+2),len );
183
184 //memcpy(out,c+2,len);
185 //out += len;
186 //outlen -= len;
187 c += 2+len;
188 inlen -= 2+len;
189 } else {
190 /* Codebook entry */
191 const char *s = Smaz_rcb[*c];
192 int len = strlen(s);
193
194 //if (outlen < len) return _outlen+1;
195 //memcpy(out,s,len);
196 ss.write( s, len );
197 //out += len;
198 //outlen -= len;
199 c++;
200 inlen--;
201 }
202 }
203}

◆ smaz_decompress() [2/2]

std::string fc::smaz_decompress ( const std::string & compressed)

Definition at line 216 of file smaz.cpp.

217 {
218 std::stringstream ss;
219 smaz_decompress( compressed.c_str(), compressed.length(), ss );
220 return ss.str();
221 }
std::string smaz_decompress(const std::string &compressed)
Definition smaz.cpp:216
Here is the call graph for this function:
Here is the caller graph for this function:

◆ stringFromStream()

template<typename T >
std::string fc::stringFromStream ( T & in)

Definition at line 89 of file json.cpp.

90 {
91 std::stringstream token;
92 try
93 {
94 char c = in.peek();
95
96 if( c != '"' )
97 FC_THROW_EXCEPTION( parse_error_exception,
98 "Expected '\"' but read '${char}'",
99 ("char", string(&c, (&c) + 1) ) );
100 in.get();
101 while( !in.eof() )
102 {
103 switch( c = in.peek() )
104 {
105 case '\\':
106 token << parseEscape( in );
107 break;
108 case 0x04:
109 FC_THROW_EXCEPTION( parse_error_exception, "EOF before closing '\"' in string '${token}'",
110 ("token", token.str() ) );
111 case '"':
112 in.get();
113 return token.str();
114 default:
115 token << c;
116 in.get();
117 }
118 }
119 FC_THROW_EXCEPTION( parse_error_exception, "EOF before closing '\"' in string '${token}'",
120 ("token", token.str() ) );
121 } FC_RETHROW_EXCEPTIONS( warn, "while parsing token '${token}'",
122 ("token", token.str() ) );
123 }
char parseEscape(T &in)
Definition json.cpp:36
Here is the call graph for this function:
Here is the caller graph for this function:

◆ stringFromToken()

template<typename T >
std::string fc::stringFromToken ( T & in)

Definition at line 125 of file json.cpp.

126 {
127 std::stringstream token;
128 try
129 {
130 char c = in.peek();
131
132 while( !in.eof() )
133 {
134 switch( c = in.peek() )
135 {
136 case '\\':
137 token << parseEscape( in );
138 break;
139 case '\t':
140 case ' ':
141 case '\n':
142 in.get();
143 return token.str();
144 case '\0':
145 FC_THROW_EXCEPTION( eof_exception, "unexpected end of file" );
146 default:
147 if( isalnum( c ) || c == '_' || c == '-' || c == '.' || c == ':' || c == '/' )
148 {
149 token << c;
150 in.get();
151 }
152 else return token.str();
153 }
154 }
155 return token.str();
156 }
157 catch( const fc::eof_exception& eof )
158 {
159 return token.str();
160 }
161 catch (const std::ios_base::failure&)
162 {
163 return token.str();
164 }
165
166 FC_RETHROW_EXCEPTIONS( warn, "while parsing token '${token}'",
167 ("token", token.str() ) );
168 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ temp_directory_path()

path fc::temp_directory_path ( )

Definition at line 366 of file filesystem.cpp.

366{ return boost::filesystem::temp_directory_path(); }

◆ throw_bad_enum_cast() [1/2]

void fc::throw_bad_enum_cast ( const char * k,
const char * e )

Definition at line 280 of file exception.cpp.

281 {
282 FC_THROW_EXCEPTION( bad_cast_exception,
283 "invalid name '${key}' in enum '${enum}'",
284 ("key",k)("enum",e) );
285 }

◆ throw_bad_enum_cast() [2/2]

void fc::throw_bad_enum_cast ( int64_t i,
const char * e )

Definition at line 274 of file exception.cpp.

275 {
276 FC_THROW_EXCEPTION( bad_cast_exception,
277 "invalid index '${key}' in enum '${enum}'",
278 ("key",i)("enum",e) );
279 }

◆ to_base32() [1/2]

std::string fc::to_base32 ( const char * data,
size_t len )

Definition at line 15 of file base32.cpp.

16 {
17 auto s = cyoBase32EncodeGetLength(len);
18 std::vector<char> b32;
19 b32.resize(s);
20 cyoBase32Encode( b32.data(), data, len );
21 b32.resize( b32.size()-1); // strip the nullterm
22 return std::string(b32.begin(),b32.end());
23 }

◆ to_base32() [2/2]

std::string fc::to_base32 ( const std::vector< char > & vec)

Definition at line 25 of file base32.cpp.

26 {
27 return to_base32( vec.data(), vec.size() );
28 }
fc::string to_base32(const std::vector< char > &vec)
Definition base32.cpp:25
Here is the call graph for this function:
Here is the caller graph for this function:

◆ to_base36() [1/2]

fc::string fc::to_base36 ( const char * data,
size_t len )

Definition at line 8 of file base36.cpp.

9 {
10 if( len == 0 ) return fc::string();
11
12 const char* src = data;
13 int src_len = len;
14 std::unique_ptr<char[]> buffer(new char[len+1]);
15 if (*data & 0x80) {
16 buffer[0] = 0;
17 memcpy( buffer.get() + 1, data, len );
18 src = buffer.get();
19 src_len++;
20 }
21 fc::bigint value( src, src_len );
22
23 auto base36 = "0123456789abcdefghijklmnopqrstuvwxyz";
24 std::vector<char> out( static_cast<size_t>(len * 1.6) + 2 );
25 int pos = out.size() - 1;
26 out[pos] = '\0';
27 fc::bigint _36(36);
28 do {
29 if( value ) {
30 --pos;
31 out[pos] = base36[(value % _36).to_int64()];
32 }
33 } while (value /= _36);
34 while (len-- > 0 && *data++ == 0) {
35 out[--pos] = '0';
36 }
37 return &out[pos]; //fc::string( &out[pos], out.size() - pos);
38 }
Here is the call graph for this function:

◆ to_base36() [2/2]

fc::string fc::to_base36 ( const std::vector< char > & vec)

Definition at line 40 of file base36.cpp.

41 {
42 return to_base36( (const char*)vec.data(), vec.size() );
43 }
fc::string to_base36(const std::vector< char > &vec)
Definition base36.cpp:40
Here is the call graph for this function:
Here is the caller graph for this function:

◆ to_base58() [1/2]

std::string fc::to_base58 ( const char * d,
size_t s,
const fc::yield_function_t & yield )

Definition at line 618 of file base58.cpp.

618 {
619 return EncodeBase58( (const unsigned char*)d, (const unsigned char*)d+s, yield );
620}
std::string EncodeBase58(const unsigned char *pbegin, const unsigned char *pend, const fc::yield_function_t &yield)
Definition base58.cpp:505
Here is the call graph for this function:
Here is the caller graph for this function:

◆ to_base58() [2/2]

std::string fc::to_base58 ( const std::vector< char > & data,
const fc::yield_function_t & yield )

Definition at line 622 of file base58.cpp.

623{
624 if( d.size() )
625 return to_base58( d.data(), d.size(), yield );
626 return std::string();
627}
std::string to_base58(const char *d, size_t s, const fc::yield_function_t &yield)
Definition base58.cpp:618
Here is the call graph for this function:

◆ to_double()

double fc::to_double ( const fc::string & i)

Definition at line 118 of file string.cpp.

119 {
120 try
121 {
122 return boost::lexical_cast<double>(i.c_str(), i.size());
123 }
124 catch( const boost::bad_lexical_cast& e )
125 {
126 FC_THROW_EXCEPTION( parse_error_exception, "Couldn't parse double" );
127 }
128 FC_RETHROW_EXCEPTIONS( warn, "${i} => double", ("i",i) )
129 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ to_hex() [1/2]

std::string fc::to_hex ( const char * d,
uint32_t s )

Definition at line 17 of file hex.cpp.

18 {
19 std::string r;
20 const char* to_hex="0123456789abcdef";
21 uint8_t* c = (uint8_t*)d;
22 for( uint32_t i = 0; i < s; ++i )
23 (r += to_hex[(c[i]>>4)]) += to_hex[(c[i] &0x0f)];
24 return r;
25 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ to_hex() [2/2]

std::string fc::to_hex ( const std::vector< char > & data)

Definition at line 42 of file hex.cpp.

43 {
44 if( data.size() )
45 return to_hex( data.data(), data.size() );
46 return "";
47 }
Here is the call graph for this function:

◆ to_int64()

int64_t fc::to_int64 ( const fc::string & i)

Definition at line 92 of file string.cpp.

93 {
94 try
95 {
96 return boost::lexical_cast<int64_t>(i.c_str(), i.size());
97 }
98 catch( const boost::bad_lexical_cast& e )
99 {
100 FC_THROW_EXCEPTION( parse_error_exception, "Couldn't parse int64_t" );
101 }
102 FC_RETHROW_EXCEPTIONS( warn, "${i} => int64_t", ("i",i) )
103 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ to_lower()

std::string fc::to_lower ( const fc::string & s)

Definition at line 161 of file string.cpp.

162 {
163 auto tmp = s;
164 boost::algorithm::to_lower(tmp);
165 return tmp;
166 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ to_pretty_string()

std::string fc::to_pretty_string ( int64_t value)

Definition at line 26 of file string.cpp.

27 {
28 std::stringstream ss;
29 ss.imbue( {std::locale(), new comma_numpunct} );
30 ss << std::fixed << value;
31 return ss.str();
32 }

◆ to_scalar()

Scalar fc::to_scalar ( const bytes & be)
noexcept

Definition at line 27 of file alt_bn128.cpp.

27 {
28 mpz_t m;
29 mpz_init(m);
30 mpz_import(m, be.size(), /*order=*/1, /*size=*/1, /*endian=*/0, /*nails=*/0, &be[0]);
31 Scalar out{m};
32 mpz_clear(m);
33 return out;
34 }
Here is the caller graph for this function:

◆ to_seekable()

template<typename STREAM >
device_adaptor< STREAM, bio::source_tag > fc::to_seekable ( STREAM & strm)

◆ to_sink()

template<typename STREAM >
device_adaptor< STREAM, bio::sink_tag > fc::to_sink ( STREAM & strm)

Definition at line 19 of file bio_device_adaptor.hpp.

19 {
21}

◆ to_source()

template<typename STREAM >
device_adaptor< STREAM, bio::source_tag > fc::to_source ( STREAM & strm)

Definition at line 24 of file bio_device_adaptor.hpp.

24 {
26}

◆ to_stream() [1/3]

template<typename T >
void fc::to_stream ( T & os,
const variant & v,
const json::yield_function_t & yield,
json::output_formatting format )

Definition at line 612 of file json.cpp.

613 {
614 yield(os.tellp());
615 switch( v.get_type() )
616 {
617 case variant::null_type:
618 os << "null";
619 return;
620 case variant::int64_type:
621 {
622 int64_t i = v.as_int64();
623 if( format == json::output_formatting::stringify_large_ints_and_doubles &&
624 i > 0xffffffff )
625 os << '"'<<v.as_string()<<'"';
626 else
627 os << i;
628
629 return;
630 }
631 case variant::uint64_type:
632 {
633 uint64_t i = v.as_uint64();
634 if( format == json::output_formatting::stringify_large_ints_and_doubles &&
635 i > 0xffffffff )
636 os << '"'<<v.as_string()<<'"';
637 else
638 os << i;
639
640 return;
641 }
642 case variant::double_type:
643 if (format == json::output_formatting::stringify_large_ints_and_doubles)
644 os << '"'<<v.as_string()<<'"';
645 else
646 os << v.as_string();
647 return;
648 case variant::bool_type:
649 os << v.as_string();
650 return;
651 case variant::string_type:
652 os << '"' << escape_string( v.get_string(), yield ) << '"';
653 return;
654 case variant::blob_type:
655 os << '"' << escape_string( v.as_string(), yield ) << '"';
656 return;
657 case variant::array_type:
658 {
659 const variants& a = v.get_array();
660 to_stream( os, a, yield, format );
661 return;
662 }
663 case variant::object_type:
664 {
665 const variant_object& o = v.get_object();
666 to_stream(os, o, yield, format );
667 return;
668 }
669 default:
670 FC_THROW_EXCEPTION( fc::invalid_arg_exception, "Unsupported variant type: " + std::to_string( v.get_type() ) );
671 }
672 }
void to_stream(T &os, const variants &a, const json::yield_function_t &yield, json::output_formatting format)
Definition json.cpp:576
signed __int64 int64_t
Definition stdint.h:135
Here is the call graph for this function:

◆ to_stream() [2/3]

template<typename T >
void fc::to_stream ( T & os,
const variant_object & o,
const json::yield_function_t & yield,
json::output_formatting format )

Definition at line 593 of file json.cpp.

594 {
595 yield(os.tellp());
596 os << '{';
597 auto itr = o.begin();
598
599 while( itr != o.end() )
600 {
601 os << '"' << escape_string( itr->key(), yield ) << '"';
602 os << ':';
603 to_stream( os, itr->value(), yield, format );
604 ++itr;
605 if( itr != o.end() )
606 os << ',';
607 }
608 os << '}';
609 }
iterator begin() const
Here is the call graph for this function:

◆ to_stream() [3/3]

template<typename T >
void fc::to_stream ( T & os,
const variants & a,
const json::yield_function_t & yield,
json::output_formatting format )

Definition at line 576 of file json.cpp.

577 {
578 yield(os.tellp());
579 os << '[';
580 auto itr = a.begin();
581
582 while( itr != a.end() )
583 {
584 to_stream( os, *itr, yield, format );
585 ++itr;
586 if( itr != a.end() )
587 os << ',';
588 }
589 os << ']';
590 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ to_string() [1/6]

fc::string fc::to_string ( double d)

Definition at line 131 of file string.cpp.

132 {
133 // +2 is required to ensure that the double is rounded correctly when read back in. http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html
134 std::stringstream ss;
135 ss << std::setprecision(std::numeric_limits<double>::digits10 + 2) << std::fixed << d;
136 return ss.str();
137 }
Here is the caller graph for this function:

◆ to_string() [2/6]

fc::string fc::to_string ( int32_t v)
inline

Definition at line 20 of file string.hpp.

20{ return to_string( int64_t(v) ); }
Here is the call graph for this function:

◆ to_string() [3/6]

fc::string fc::to_string ( int64_t d)

Definition at line 144 of file string.cpp.

145 {
146 return boost::lexical_cast<std::string>(d);
147 }

◆ to_string() [4/6]

fc::string fc::to_string ( uint16_t d)

Definition at line 148 of file string.cpp.

149 {
150 return boost::lexical_cast<std::string>(d);
151 }

◆ to_string() [5/6]

fc::string fc::to_string ( uint32_t v)
inline

Definition at line 21 of file string.hpp.

21{ return to_string( uint64_t(v) ); }
Here is the call graph for this function:

◆ to_string() [6/6]

fc::string fc::to_string ( uint64_t d)

Definition at line 139 of file string.cpp.

140 {
141 return boost::lexical_cast<std::string>(d);
142 }

◆ to_uint64()

uint64_t fc::to_uint64 ( const fc::string & i)

Definition at line 105 of file string.cpp.

106 { try {
107 try
108 {
109 return boost::lexical_cast<uint64_t>(i.c_str(), i.size());
110 }
111 catch( const boost::bad_lexical_cast& e )
112 {
113 FC_THROW_EXCEPTION( parse_error_exception, "Couldn't parse uint64_t" );
114 }
115 FC_RETHROW_EXCEPTIONS( warn, "${i} => uint64_t", ("i",i) )
116 } FC_CAPTURE_AND_RETHROW( (i) ) }
#define FC_CAPTURE_AND_RETHROW(...)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ to_variant() [1/97]

void fc::to_variant ( const __int128 & var,
fc::variant & vo )

Definition at line 679 of file variant.cpp.

679 {
680 vo = boost::multiprecision::int128_t( var ).str();
681}

◆ to_variant() [2/97]

template<typename T , size_t N>
void fc::to_variant ( const array< T, N > & bi,
variant & v )

Definition at line 106 of file array.hpp.

107 {
108 v = std::vector<char>( (const char*)&bi, ((const char*)&bi) + sizeof(bi) );
109 }

◆ to_variant() [3/97]

void fc::to_variant ( const bigint & bi,
variant & v )

encodes the big int as base64 string, or a number

Definition at line 211 of file bigint.cpp.

212 {
213 std::vector<char> ve = bi;
214 v = fc::variant(base64_encode((unsigned char*)ve.data(),ve.size()));
215 }
Here is the call graph for this function:

◆ to_variant() [4/97]

template<typename K , typename V , typename... U>
void fc::to_variant ( const bip::map< K, V, U... > & m,
fc::variant & vo )

Definition at line 80 of file container.hpp.

80 {
81 detail::to_variant_from_map( m, vo );
82 }
Here is the call graph for this function:

◆ to_variant() [5/97]

template<typename K , typename V , typename... U>
void fc::to_variant ( const bip::multimap< K, V, U... > & m,
fc::variant & vo )

Definition at line 90 of file container.hpp.

90 {
91 detail::to_variant_from_map( m, vo );
92 }
Here is the call graph for this function:

◆ to_variant() [6/97]

template<typename T , typename... U>
void fc::to_variant ( const bip::multiset< T, U... > & s,
fc::variant & vo )

Definition at line 70 of file container.hpp.

70 {
71 detail::to_variant_from_set( s, vo );
72 }
Here is the call graph for this function:

◆ to_variant() [7/97]

template<typename T , typename... U>
void fc::to_variant ( const bip::set< T, U... > & s,
fc::variant & vo )

Definition at line 60 of file container.hpp.

60 {
61 detail::to_variant_from_set( s, vo );
62 }
Here is the call graph for this function:

◆ to_variant() [8/97]

void fc::to_variant ( const blob & b,
variant & v )
inline

Definition at line 190 of file database_utils.hpp.

190 {
191 v = variant(base64_encode(b.data.data(), b.data.size()));
192 }
Here is the call graph for this function:

◆ to_variant() [9/97]

template<typename T , typename... U>
void fc::to_variant ( const boost::container::deque< T, U... > & d,
fc::variant & vo )

Definition at line 542 of file variant.hpp.

543 {
544 if( d.size() > MAX_NUM_ARRAY_ELEMENTS ) throw std::range_error( "too large" );
545 variants vars(d.size());
546 for( size_t i = 0; i < d.size(); ++i ) {
547 vars[i] = fc::variant( d[i] );
548 }
549 vo = std::move( vars );
550 }

◆ to_variant() [10/97]

template<typename... U>
void fc::to_variant ( const boost::container::vector< char, U... > & vec,
fc::variant & vo )

Definition at line 126 of file flat.hpp.

126 {
127 FC_ASSERT( vec.size() <= MAX_SIZE_OF_BYTE_ARRAYS );
128 if( vec.size() )
129 vo = variant( fc::to_hex( vec.data(), vec.size() ) );
130 else
131 vo = "";
132 }
Here is the call graph for this function:

◆ to_variant() [11/97]

template<typename T , typename... U>
void fc::to_variant ( const boost::container::vector< T, U... > & vec,
fc::variant & vo )

Definition at line 104 of file flat.hpp.

104 {
105 FC_ASSERT( vec.size() <= MAX_NUM_ARRAY_ELEMENTS );
106 variants vars;
107 vars.reserve( vec.size() );
108 for( const auto& item : vec ) {
109 vars.emplace_back( item );
110 }
111 vo = std::move(vars);
112 }

◆ to_variant() [12/97]

template<typename T , typename... Args>
void fc::to_variant ( const boost::multi_index_container< T, Args... > & s,
fc::variant & v )

Definition at line 674 of file variant.hpp.

675 {
676 std::vector<fc::variant> vars;
677 vars.reserve( c.size() );
678 for( const auto& item : c )
679 vars.emplace_back( fc::variant(item) );
680 v = std::move(vars);
681 }

◆ to_variant() [13/97]

template<typename T >
void fc::to_variant ( const boost::multiprecision::number< T > & n,
fc::variant & v )

Definition at line 690 of file variant.hpp.

690 {
691 v = n.str();
692 }

◆ to_variant() [14/97]

template<typename OidType >
void fc::to_variant ( const chainbase::oid< OidType > & oid,
variant & v )

Definition at line 100 of file database_utils.hpp.

100 {
101 v = variant(oid._id);
102 }

◆ to_variant() [15/97]

void fc::to_variant ( const crypto::private_key & var,
variant & vo,
const fc::yield_function_t & yield = fc::yield_function_t() )

Definition at line 144 of file private_key.cpp.

145 {
146 vo = var.to_string(yield);
147 }
std::string to_string(const fc::yield_function_t &yield=fc::yield_function_t()) const
Here is the call graph for this function:

◆ to_variant() [16/97]

void fc::to_variant ( const crypto::public_key & var,
fc::variant & vo,
const fc::yield_function_t & yield = fc::yield_function_t() )

Definition at line 109 of file public_key.cpp.

110 {
111 vo = var.to_string(yield);
112 }
std::string to_string(const fc::yield_function_t &yield=fc::yield_function_t()) const
Here is the call graph for this function:

◆ to_variant() [17/97]

void fc::to_variant ( const crypto::r1::private_key & var,
variant & vo )

Definition at line 621 of file elliptic_r1.cpp.

622 {
623 vo = var.get_secret();
624 }
private_key_secret get_secret() const
Here is the call graph for this function:

◆ to_variant() [18/97]

void fc::to_variant ( const crypto::r1::public_key & var,
variant & vo )

Definition at line 632 of file elliptic_r1.cpp.

633 {
634 vo = var.serialize();
635 }
public_key_data serialize() const
Here is the call graph for this function:

◆ to_variant() [19/97]

void fc::to_variant ( const crypto::signature & var,
fc::variant & vo,
const fc::yield_function_t & yield = fc::yield_function_t() )

Definition at line 88 of file signature.cpp.

89 {
90 vo = var.to_string(yield);
91 }
std::string to_string(const fc::yield_function_t &yield=fc::yield_function_t()) const
Definition signature.cpp:56
Here is the call graph for this function:

◆ to_variant() [20/97]

void fc::to_variant ( const ecc::private_key & var,
variant & vo )

Definition at line 216 of file elliptic_common.cpp.

217{
218 vo = var.get_secret();
219}
private_key_secret get_secret() const
Here is the call graph for this function:

◆ to_variant() [21/97]

void fc::to_variant ( const ecc::public_key & var,
variant & vo )

Definition at line 228 of file elliptic_common.cpp.

229{
230 vo = var.serialize();
231}
public_key_data serialize() const
Here is the call graph for this function:

◆ to_variant() [22/97]

void fc::to_variant ( const em::private_key & var,
variant & vo )

Definition at line 217 of file elliptic_em_common.cpp.

218{
219 vo = var.get_secret();
220}
private_key_secret get_secret() const
Here is the call graph for this function:

◆ to_variant() [23/97]

void fc::to_variant ( const em::public_key & var,
variant & vo )

Definition at line 229 of file elliptic_em_common.cpp.

230{
231 vo = var.serialize();
232}
public_key_data serialize() const
Here is the call graph for this function:

◆ to_variant() [24/97]

template<typename IntType , typename EnumType >
void fc::to_variant ( const enum_type< IntType, EnumType > & var,
variant & vo )

Definition at line 51 of file enum_type.hpp.

52 {
53 vo = (EnumType)var.value;
54 }

◆ to_variant() [25/97]

void fc::to_variant ( const exception & e,
variant & v )

Definition at line 126 of file exception.cpp.

127 {
128 v = mutable_variant_object( "code", e.code() )
129 ( "name", e.name() )
130 ( "message", e.what() )
131 ( "stack", e.get_log() );
132
133 }
const log_messages & get_log() const
int64_t code() const
const char * name() const
const char * what() const noexcept override

◆ to_variant() [26/97]

void fc::to_variant ( const fc::microseconds & input_microseconds,
fc::variant & output_variant )

Definition at line 160 of file time.cpp.

161 {
162 output_variant = input_microseconds.count();
163 }
Here is the call graph for this function:

◆ to_variant() [27/97]

void fc::to_variant ( const fc::path & path_to_convert,
fc::variant & variant_output )

Definition at line 31 of file filesystem.cpp.

32 {
33 std::wstring wide_string = path_to_convert.generic_wstring();
34 std::string utf8_string;
35 fc::encodeUtf8(wide_string, &utf8_string);
36 variant_output = utf8_string;
37
38 //std::string path = t.to_native_ansi_path();
39 //std::replace(path.begin(), path.end(), '\\', '/');
40 //v = path;
41 }
std::wstring generic_wstring() const
void encodeUtf8(const std::wstring &input, std::string *storage)
Definition utf8.cpp:78
Here is the call graph for this function:

◆ to_variant() [28/97]

template<typename Storage >
void fc::to_variant ( const fixed_string< Storage > & s,
variant & v )

Definition at line 163 of file fixed_string.hpp.

163 {
164 v = std::string(s);
165 }

◆ to_variant() [29/97]

template<typename K , typename V , typename... U>
void fc::to_variant ( const flat_map< K, V, U... > & m,
fc::variant & vo )

Definition at line 167 of file flat.hpp.

167 {
168 detail::to_variant_from_map( m, vo );
169 }
Here is the call graph for this function:

◆ to_variant() [30/97]

template<typename K , typename V , typename... U>
void fc::to_variant ( const flat_multimap< K, V, U... > & m,
fc::variant & vo )

Definition at line 177 of file flat.hpp.

177 {
178 detail::to_variant_from_map( m, vo );
179 }
Here is the call graph for this function:

◆ to_variant() [31/97]

template<typename T , typename... U>
void fc::to_variant ( const flat_multiset< T, U... > & s,
fc::variant & vo )

Definition at line 157 of file flat.hpp.

157 {
158 detail::to_variant_from_set( s, vo );
159 }
Here is the call graph for this function:

◆ to_variant() [32/97]

template<typename T , typename... U>
void fc::to_variant ( const flat_set< T, U... > & s,
fc::variant & vo )

Definition at line 147 of file flat.hpp.

147 {
148 detail::to_variant_from_set( s, vo );
149 }
Here is the call graph for this function:

◆ to_variant() [33/97]

void fc::to_variant ( const float128_t & f,
variant & v )
inline

Definition at line 144 of file database_utils.hpp.

144 {
145 // Assumes platform is little endian and hex representation of 128-bit integer is in little endian order.
146 char as_bytes[sizeof(sysio::chain::uint128_t)];
147 memcpy(as_bytes, &f, sizeof(as_bytes));
148 std::string s = "0x";
149 s.append( to_hex( as_bytes, sizeof(as_bytes) ) );
150 v = s;
151 }
Here is the call graph for this function:

◆ to_variant() [34/97]

void fc::to_variant ( const float64_t & f,
variant & v )
inline

Definition at line 130 of file database_utils.hpp.

130 {
131 double double_f;
132 float64_to_double(f, double_f);
133 v = variant(double_f);
134 }
void float64_to_double(const float64_t &f, double &d)
Here is the call graph for this function:

◆ to_variant() [35/97]

void fc::to_variant ( const int16_t & var,
fc::variant & vo )

Definition at line 645 of file variant.cpp.

645{ vo = int64_t(var); }

◆ to_variant() [36/97]

void fc::to_variant ( const int32_t & var,
fc::variant & vo )

Definition at line 655 of file variant.cpp.

655 {
656 vo = int64_t(var);
657}

◆ to_variant() [37/97]

void fc::to_variant ( const int8_t & var,
fc::variant & vo )

Definition at line 637 of file variant.cpp.

637{ vo = int64_t(var); }

◆ to_variant() [38/97]

void fc::to_variant ( const ip::address & var,
variant & vo )

Definition at line 149 of file ip.cpp.

150 {
151 vo = fc::string(var);
152 }

◆ to_variant() [39/97]

void fc::to_variant ( const ip::endpoint & var,
variant & vo )

Definition at line 140 of file ip.cpp.

141 {
142 vo = fc::string(var);
143 }

◆ to_variant() [40/97]

void fc::to_variant ( const log_context & l,
variant & v )

Definition at line 90 of file log_message.cpp.

91 {
92 v = l.to_variant();
93 }

◆ to_variant() [41/97]

void fc::to_variant ( const log_message & l,
variant & v )

Definition at line 104 of file log_message.cpp.

105 {
106 v = m.to_variant();
107 }
Here is the call graph for this function:

◆ to_variant() [42/97]

void fc::to_variant ( const mutable_variant_object & var,
fc::variant & vo )

Definition at line 414 of file variant_object.cpp.

415 {
416 vo = variant(var);
417 }

◆ to_variant() [43/97]

void fc::to_variant ( const params::permission_level & a,
fc::variant & v )
inline

Overloaded to_variant so that permission is only present if it is set

Parameters
a
v

Definition at line 97 of file account_query_db.hpp.

97 {
98 if (a.permission.empty()) {
99 v = a.actor.to_string();
100 } else {
101 v = mutable_variant_object()
102 ("actor", a.actor.to_string())
103 ("permission", a.permission.to_string());
104 }
105 }

◆ to_variant() [44/97]

void fc::to_variant ( const private_key & bi,
variant & v )

encodes the big int as base64 string, or a number

Definition at line 353 of file pke.cpp.

354 {
355 v = bi.serialize();
356 }
bytes serialize() const
Definition pke.cpp:294
Here is the call graph for this function:

◆ to_variant() [45/97]

void fc::to_variant ( const public_key & bi,
variant & v )

encodes the big int as base64 string, or a number

Definition at line 340 of file pke.cpp.

341 {
342 v = bi.serialize();
343 }
bytes serialize() const
Definition pke.cpp:132
Here is the call graph for this function:

◆ to_variant() [46/97]

void fc::to_variant ( const real128 & var,
variant & vo )

Definition at line 121 of file real128.cpp.

122 {
123 vo = std::string(var);
124 }

◆ to_variant() [47/97]

void fc::to_variant ( const ripemd160 & bi,
variant & v )

Definition at line 103 of file ripemd160.cpp.

104 {
105 v = std::vector<char>( (const char*)&bi, ((const char*)&bi) + sizeof(bi) );
106 }

◆ to_variant() [48/97]

template<typename T >
void fc::to_variant ( const safe< T > & s,
fc::variant & v )

Definition at line 669 of file variant.hpp.

669{ v = s.value; }

◆ to_variant() [49/97]

void fc::to_variant ( const sha1 & bi,
variant & v )

Definition at line 89 of file sha1.cpp.

90 {
91 v = std::vector<char>( (const char*)&bi, ((const char*)&bi) + sizeof(bi) );
92 }

◆ to_variant() [50/97]

void fc::to_variant ( const sha224 & bi,
variant & v )

Definition at line 84 of file sha224.cpp.

85 {
86 v = std::vector<char>( (const char*)&bi, ((const char*)&bi) + sizeof(bi) );
87 }

◆ to_variant() [51/97]

void fc::to_variant ( const sha256 & bi,
variant & v )

Definition at line 206 of file sha256.cpp.

207 {
208 v = std::vector<char>( (const char*)&bi, ((const char*)&bi) + sizeof(bi) );
209 }

◆ to_variant() [52/97]

void fc::to_variant ( const sha3 & bi,
variant & v )

Definition at line 276 of file sha3.cpp.

277{
278 v = std::vector<char>((const char *)&bi, ((const char *)&bi) + sizeof(bi));
279}

◆ to_variant() [53/97]

void fc::to_variant ( const sha512 & bi,
variant & v )

Definition at line 91 of file sha512.cpp.

92 {
93 v = std::vector<char>( (const char*)&bi, ((const char*)&bi) + sizeof(bi) );
94 }

◆ to_variant() [54/97]

void fc::to_variant ( const signed_int & var,
variant & vo )

Definition at line 6 of file varint.cpp.

6{ vo = var.value; }

◆ to_variant() [55/97]

template<typename T , std::size_t S>
void fc::to_variant ( const std::array< T, S > & var,
fc::variant & vo )

Definition at line 586 of file variant.hpp.

587 {
588 std::vector<fc::variant> vars(S);
589 for( std::size_t i = 0; i < S; ++i )
590 vars[i] = fc::variant(t[i]);
591 v = std::move(vars);
592 }

◆ to_variant() [56/97]

template<typename T >
void fc::to_variant ( const std::deque< T > & var,
fc::variant & vo )

Definition at line 518 of file variant.hpp.

519 {
520 if( t.size() > MAX_NUM_ARRAY_ELEMENTS ) throw std::range_error( "too large" );
521 std::vector<fc::variant> vars(t.size());
522 for( size_t i = 0; i < t.size(); ++i )
523 vars[i] = fc::variant(t[i]);
524 v = std::move(vars);
525 }

◆ to_variant() [57/97]

template<typename K , typename T >
void fc::to_variant ( const std::map< K, T > & var,
fc::variant & vo )

Definition at line 444 of file variant.hpp.

445 {
446 if( var.size() > MAX_NUM_ARRAY_ELEMENTS ) throw std::range_error( "too large" );
447 std::vector< fc::variant > vars(var.size());
448 size_t i = 0;
449 for( auto itr = var.begin(); itr != var.end(); ++itr, ++i )
450 vars[i] = fc::variant(*itr);
451 vo = vars;
452 }

◆ to_variant() [58/97]

template<typename K , typename T >
void fc::to_variant ( const std::multimap< K, T > & var,
fc::variant & vo )

Definition at line 464 of file variant.hpp.

465 {
466 if( var.size() > MAX_NUM_ARRAY_ELEMENTS ) throw std::range_error( "too large" );
467 std::vector< fc::variant > vars(var.size());
468 size_t i = 0;
469 for( auto itr = var.begin(); itr != var.end(); ++itr, ++i )
470 vars[i] = fc::variant(*itr);
471 vo = vars;
472 }

◆ to_variant() [59/97]

template<typename A , typename B >
void fc::to_variant ( const std::pair< A, B > & t,
fc::variant & v )

Definition at line 596 of file variant.hpp.

597 {
598 std::vector<fc::variant> vars(2);
599 vars[0] = fc::variant(t.first);
600 vars[1] = fc::variant(t.second);
601 v = vars;
602 }

◆ to_variant() [60/97]

template<typename T >
void fc::to_variant ( const std::set< T > & var,
fc::variant & vo )

Definition at line 485 of file variant.hpp.

486 {
487 if( var.size() > MAX_NUM_ARRAY_ELEMENTS ) throw std::range_error( "too large" );
488 std::vector<fc::variant> vars(var.size());
489 size_t i = 0;
490 for( auto itr = var.begin(); itr != var.end(); ++itr, ++i )
491 vars[i] = fc::variant(*itr);
492 vo = vars;
493 }

◆ to_variant() [61/97]

template<typename T >
void fc::to_variant ( const std::shared_ptr< T > & var,
fc::variant & vo )

Definition at line 633 of file variant.hpp.

634 {
635 if( var ) to_variant( *var, vo );
636 else vo = nullptr;
637 }
void to_variant(const sysio::chain::shared_public_key &var, fc::variant &vo)
Definition authority.cpp:4
Here is the call graph for this function:

◆ to_variant() [62/97]

void fc::to_variant ( const std::string & s,
fc::variant & v )

Definition at line 719 of file variant.cpp.

720{
721 v = variant( fc::string(s) );
722}

◆ to_variant() [63/97]

template<typename T >
void fc::to_variant ( const std::unique_ptr< T > & s,
fc::variant & v )

Definition at line 650 of file variant.hpp.

651 {
652 if( var ) to_variant( *var, vo );
653 else vo = nullptr;
654 }
Here is the call graph for this function:

◆ to_variant() [64/97]

template<typename K , typename T >
void fc::to_variant ( const std::unordered_map< K, T > & var,
fc::variant & vo )

Definition at line 424 of file variant.hpp.

425 {
426 if( var.size() > MAX_NUM_ARRAY_ELEMENTS ) throw std::range_error( "too large" );
427 std::vector< fc::variant > vars(var.size());
428 size_t i = 0;
429 for( auto itr = var.begin(); itr != var.end(); ++itr, ++i )
430 vars[i] = fc::variant(*itr);
431 vo = vars;
432 }

◆ to_variant() [65/97]

template<typename T >
void fc::to_variant ( const std::unordered_set< T > & var,
fc::variant & vo )

Definition at line 402 of file variant.hpp.

403 {
404 if( var.size() > MAX_NUM_ARRAY_ELEMENTS ) throw std::range_error( "too large" );
405 std::vector<fc::variant> vars(var.size());
406 size_t i = 0;
407 for( auto itr = var.begin(); itr != var.end(); ++itr, ++i )
408 vars[i] = fc::variant(*itr);
409 vo = vars;
410 }

◆ to_variant() [66/97]

template<typename... T>
void fc::to_variant ( const std::variant< T... > & s,
fc::variant & v )

Definition at line 71 of file static_variant.hpp.

72{
73 variants vars(2);
74 vars[0] = s.index();
75 std::visit( from_static_variant(vars[1]), s );
76 v = std::move(vars);
77}

◆ to_variant() [67/97]

void fc::to_variant ( const std::vector< char > & var,
fc::variant & vo )

Definition at line 729 of file variant.cpp.

730{
731 FC_ASSERT( var.size() <= MAX_SIZE_OF_BYTE_ARRAYS );
732 if( var.size() )
733 vo = variant(to_hex(var.data(),var.size()));
734 else vo = "";
735}
Here is the call graph for this function:

◆ to_variant() [68/97]

template<typename T >
void fc::to_variant ( const std::vector< T > & t,
fc::variant & v )

Definition at line 566 of file variant.hpp.

567 {
568 if( t.size() > MAX_NUM_ARRAY_ELEMENTS ) throw std::range_error( "too large" );
569 std::vector<fc::variant> vars(t.size());
570 for( size_t i = 0; i < t.size(); ++i )
571 vars[i] = fc::variant(t[i]);
572 v = std::move(vars);
573 }

◆ to_variant() [69/97]

void fc::to_variant ( const sysio::chain::asset & var,
fc::variant & vo )
inline

Definition at line 107 of file asset.hpp.

107{ vo = var.to_string(); }
string to_string() const
Definition asset.cpp:19
Here is the call graph for this function:

◆ to_variant() [70/97]

template<uint16_t IntervalMs, uint64_t EpochMs>
void fc::to_variant ( const sysio::chain::block_timestamp< IntervalMs, EpochMs > & t,
fc::variant & v )

Definition at line 85 of file block_timestamp.hpp.

85 {
87 }
Here is the call graph for this function:

◆ to_variant() [71/97]

void fc::to_variant ( const sysio::chain::chain_id_type & cid,
fc::variant & v )

Definition at line 14 of file chain_id_type.cpp.

14 {
15 to_variant( static_cast<const fc::sha256&>(cid), v);
16 }
Here is the call graph for this function:

◆ to_variant() [72/97]

template<typename T >
void fc::to_variant ( const sysio::chain::may_not_exist< T > & e,
fc::variant & v )

Definition at line 159 of file abi_def.hpp.

159 {
160 to_variant( e.value, v);
161}
Here is the call graph for this function:

◆ to_variant() [73/97]

void fc::to_variant ( const sysio::chain::name & c,
fc::variant & v )

Definition at line 38 of file name.cpp.

38{ v = c.to_string(); }
std::string to_string() const
Definition name.cpp:19
Here is the call graph for this function:

◆ to_variant() [74/97]

void fc::to_variant ( const sysio::chain::shared_blob & b,
variant & v )
inline

Definition at line 179 of file database_utils.hpp.

179 {
180 v = variant(base64_encode(b.data(), b.size()));
181 }
Here is the call graph for this function:

◆ to_variant() [75/97]

void fc::to_variant ( const sysio::chain::shared_public_key & var,
fc::variant & vo )

Definition at line 4 of file authority.cpp.

4 {
5 vo = var.to_string();
6 }
std::string to_string() const
Definition authority.hpp:32
Here is the call graph for this function:
Here is the caller graph for this function:

◆ to_variant() [76/97]

void fc::to_variant ( const sysio::chain::shared_string & s,
variant & v )
inline

Definition at line 167 of file database_utils.hpp.

167 {
168 v = variant(std::string(s.begin(), s.end()));
169 }

◆ to_variant() [77/97]

template<typename T >
void fc::to_variant ( const sysio::chain::shared_vector< T > & sv,
variant & v )

Definition at line 201 of file database_utils.hpp.

201 {
202 to_variant(std::vector<T>(sv.begin(), sv.end()), v);
203 }
Here is the call graph for this function:

◆ to_variant() [78/97]

void fc::to_variant ( const sysio::chain::symbol & var,
fc::variant & vo )
inline

Definition at line 172 of file symbol.hpp.

172{ vo = var.to_string(); }
string to_string() const
Definition symbol.hpp:129
Here is the call graph for this function:

◆ to_variant() [79/97]

void fc::to_variant ( const sysio::chain::symbol_code & var,
fc::variant & vo )
inline

Definition at line 179 of file symbol.hpp.

179 {
180 vo = sysio::chain::symbol(var.value << 8).name();
181 }
string name() const
Definition symbol.hpp:104
Here is the call graph for this function:

◆ to_variant() [80/97]

template<typename T >
void fc::to_variant ( const T & o,
variant & v )

Definition at line 98 of file variant.hpp.

99 {
101 }
Here is the call graph for this function:

◆ to_variant() [81/97]

void fc::to_variant ( const time_point & var,
fc::variant & vo )

Definition at line 80 of file time.cpp.

80 {
81 v = fc::string( t );
82 }

◆ to_variant() [82/97]

void fc::to_variant ( const time_point_sec & var,
fc::variant & vo )

Definition at line 86 of file time.cpp.

86 {
87 v = fc::string( t );
88 }

◆ to_variant() [83/97]

void fc::to_variant ( const uint128 & var,
variant & vo )

Definition at line 377 of file uint128.cpp.

377{ vo = std::string(var); }
Here is the call graph for this function:

◆ to_variant() [84/97]

void fc::to_variant ( const uint16_t & var,
fc::variant & vo )

Definition at line 641 of file variant.cpp.

641{ vo = uint64_t(var); }

◆ to_variant() [85/97]

void fc::to_variant ( const uint32_t & var,
fc::variant & vo )

Definition at line 649 of file variant.cpp.

649{ vo = uint64_t(var); }

◆ to_variant() [86/97]

void fc::to_variant ( const uint8_t & var,
fc::variant & vo )

Definition at line 633 of file variant.cpp.

633{ vo = uint64_t(var); }

◆ to_variant() [87/97]

void fc::to_variant ( const UInt< 16 > & n,
fc::variant & v )

Definition at line 752 of file variant.cpp.

752{ v = uint64_t(n); }

◆ to_variant() [88/97]

void fc::to_variant ( const UInt< 32 > & n,
fc::variant & v )

Definition at line 756 of file variant.cpp.

756{ v = uint64_t(n); }

◆ to_variant() [89/97]

void fc::to_variant ( const UInt< 64 > & n,
fc::variant & v )

Definition at line 760 of file variant.cpp.

760{ v = uint64_t(n); }

◆ to_variant() [90/97]

void fc::to_variant ( const UInt< 8 > & n,
fc::variant & v )

Definition at line 748 of file variant.cpp.

748{ v = uint64_t(n); }

◆ to_variant() [91/97]

void fc::to_variant ( const unsigned __int128 & var,
fc::variant & vo )

Definition at line 664 of file variant.cpp.

664 {
665 vo = boost::multiprecision::uint128_t( var ).str();
666}

◆ to_variant() [92/97]

void fc::to_variant ( const unsigned_int & var,
variant & vo )

Definition at line 8 of file varint.cpp.

8{ vo = var.value; }

◆ to_variant() [93/97]

void fc::to_variant ( const url & u,
fc::variant & v )

Definition at line 81 of file url.cpp.

82 {
83 v = fc::string(u);
84 }

◆ to_variant() [94/97]

void fc::to_variant ( const variant_object & var,
fc::variant & vo )

Definition at line 177 of file variant_object.cpp.

178 {
179 vo = variant(var);
180 }

◆ to_variant() [95/97]

void fc::to_variant ( log_level e,
variant & v )

Definition at line 109 of file log_message.cpp.

110 {
111 switch( e )
112 {
113 case log_level::all:
114 v = "all";
115 return;
116 case log_level::debug:
117 v = "debug";
118 return;
119 case log_level::info:
120 v = "info";
121 return;
122 case log_level::warn:
123 v = "warn";
124 return;
125 case log_level::error:
126 v = "error";
127 return;
128 case log_level::off:
129 v = "off";
130 return;
131 }
132 }

◆ to_variant() [96/97]

void fc::to_variant ( long long int s,
fc::variant & v )

Definition at line 871 of file variant.cpp.

871{ v = variant( int64_t(s) ); }

◆ to_variant() [97/97]

void fc::to_variant ( unsigned long long int s,
fc::variant & v )

Definition at line 872 of file variant.cpp.

872{ v = variant( uint64_t(s)); }

◆ token_from_stream()

template<typename T >
variant fc::token_from_stream ( T & in)

Definition at line 317 of file json.cpp.

318 {
319 std::stringstream ss;
320 ss.exceptions( std::ifstream::badbit );
321 bool received_eof = false;
322 bool done = false;
323
324 try
325 {
326 char c;
327 while((c = in.peek()) && !done)
328 {
329 switch( c )
330 {
331 case 'n':
332 case 'u':
333 case 'l':
334 case 't':
335 case 'r':
336 case 'e':
337 case 'f':
338 case 'a':
339 case 's':
340 ss.put( in.get() );
341 break;
342 default:
343 done = true;
344 break;
345 }
346 }
347 }
348 catch (fc::eof_exception&)
349 {
350 received_eof = true;
351 }
352 catch (const std::ios_base::failure&)
353 {
354 received_eof = true;
355 }
356
357 // we can get here either by processing a delimiter as in "null,"
358 // an EOF like "null<EOF>", or an invalid token like "nullZ"
359 std::string str = ss.str();
360 if( str == "null" )
361 return variant();
362 if( str == "true" )
363 return true;
364 if( str == "false" )
365 return false;
366 else
367 {
368 if (received_eof)
369 {
370 if (str.empty())
371 FC_THROW_EXCEPTION( parse_error_exception, "Unexpected EOF" );
372 else
373 return str;
374 }
375 else
376 {
377 // if we've reached this point, we've either seen a partial
378 // token ("tru<EOF>") or something our simple parser couldn't
379 // make out ("falfe")
380 // A strict JSON parser would signal this as an error, but we
381 // will just treat the malformed token as an un-quoted string.
382 return str + stringFromToken(in);;
383 }
384 }
385 }
std::string stringFromToken(T &in)
Definition json.cpp:125
Here is the call graph for this function:
Here is the caller graph for this function:

◆ trim()

std::string fc::trim ( const fc::string & s)

Definition at line 152 of file string.cpp.

153 {
154 return boost::algorithm::trim_copy(s);
155 /*
156 std::string cpy(s);
157 boost::algorithm::trim(cpy);
158 return cpy;
159 */
160 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ trim_and_normalize_spaces()

string fc::trim_and_normalize_spaces ( const string & s)

Definition at line 167 of file string.cpp.

168 {
169 string result = boost::algorithm::trim_copy( s );
170 while( result.find( " " ) != result.npos )
171 boost::algorithm::replace_all( result, " ", " " );
172 return result;
173 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ uint128_to_float128()

void fc::uint128_to_float128 ( const sysio::chain::uint128_t & u,
float128_t & f )
inline

Definition at line 125 of file database_utils.hpp.

125 {
126 memcpy(&f, &u, sizeof(f));
127 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Uint128High64()

uint64_t fc::Uint128High64 ( const uint128 & x)
inline

Definition at line 51 of file city.cpp.

51{ return x.high_bits(); }
uint64_t high_bits() const
Definition uint128.hpp:109
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Uint128Low64()

uint64_t fc::Uint128Low64 ( const uint128 & x)
inline

Definition at line 50 of file city.cpp.

50{ return x.low_bits(); }
uint64_t low_bits() const
Definition uint128.hpp:108
Here is the call graph for this function:
Here is the caller graph for this function:

◆ underflow_exception()

file_not_found_exception parse_error_exception invalid_arg_exception invalid_operation_exception key_not_found_exception bad_cast_exception out_of_range_exception canceled_exception assert_exception eof_exception unknown_host_exception null_optional udt_exception aes_exception overflow_exception fc::underflow_exception ( divide_by_zero_exception )

Definition at line 1 of file exception.cpp.

31 {
32 class exception_impl
33 {
34 public:
35 std::string _name;
36 std::string _what;
37 int64_t _code;
38 log_messages _elog;
39 };
40 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ unique_path()

path fc::unique_path ( )

Definition at line 365 of file filesystem.cpp.

365{ return boost::filesystem::unique_path(); }

◆ variant_from_stream()

template<typename T , json::parse_type parser_type>
variant fc::variant_from_stream ( T & in,
uint32_t max_depth )

Definition at line 389 of file json.cpp.

390 {
391 if( max_depth == 0 )
392 FC_THROW_EXCEPTION( parse_error_exception, "Too many nested items in JSON input!" );
394 variant var;
395 while( 1 )
396 {
397 signed char c = in.peek();
398 switch( c )
399 {
400 case ' ':
401 case '\t':
402 case '\n':
403 case '\r':
404 in.get();
405 continue;
406 case '"':
407 return stringFromStream( in );
408 case '{':
409 return objectFromStream<T, parser_type>( in, max_depth - 1 );
410 case '[':
411 return arrayFromStream<T, parser_type>( in, max_depth - 1 );
412 case '-':
413 case '.':
414 case '0':
415 case '1':
416 case '2':
417 case '3':
418 case '4':
419 case '5':
420 case '6':
421 case '7':
422 case '8':
423 case '9':
424 return number_from_stream<T, parser_type>( in );
425 // null, true, false, or 'warning' / string
426 case 'n':
427 case 't':
428 case 'f':
429 return token_from_stream( in );
430 case 0x04: // ^D end of transmission
431 case EOF:
432 case '\0':
433 FC_THROW_EXCEPTION( eof_exception, "unexpected end of file" );
434 default:
435 FC_THROW_EXCEPTION( parse_error_exception, "Unexpected char '${c}' in \"${s}\"",
436 ("c", c)("s", stringFromToken(in)) );
437 }
438 }
439 return variant();
440 }
variant token_from_stream(T &in)
Definition json.cpp:317
Here is the call graph for this function:
Here is the caller graph for this function:

◆ zlib_compress()

string fc::zlib_compress ( const string & in)

Definition at line 11 of file zlib.cpp.

12 {
13 string out;
14 bio::filtering_ostream comp;
15 comp.push(bio::zlib_compressor(bio::zlib::default_compression));
16 comp.push(bio::back_inserter(out));
17 bio::write(comp, in.data(), in.size());
18 bio::close(comp);
19 return out;
20 }
Here is the caller graph for this function:

Variable Documentation

◆ do_default_config

bool fc::do_default_config = configure_logging( logging_config::default_config() )

Definition at line 107 of file logger.cpp.

◆ enable_record_assert_trip

bool fc::enable_record_assert_trip = false

Definition at line 325 of file exception.cpp.

◆ git_revision_sha

const char* const fc::git_revision_sha
extern

◆ git_revision_unix_timestamp

const uint32_t fc::git_revision_unix_timestamp
extern

◆ hex_digits

char fc::hex_digits[] = "0123456789abcdef"
inlineconstexpr

Definition at line 11 of file utf8.cpp.

◆ minimize_max_size

size_t fc::minimize_max_size = 1024
constexpr

Definition at line 763 of file variant.cpp.

◆ y

uint64_t fc::y { return (x << y) | (x >> (64-y))

Definition at line 34 of file sha3.cpp.