|
Electroneum
|
Various Tools. More...
Namespaces | |
| anonymous_namespace{util.cpp} | |
| anonymous_namespace{wallet2.cpp} | |
| base58 | |
| detail | |
| dns_utils | |
| error | |
| wallet_rpc | |
Typedefs | |
| typedef class scoped_ptr< ub_result, ub_resolve_free > | ub_result_ptr |
| typedef std::shared_ptr< download_thread_control > | download_async_handle |
Enumerations | |
| enum | { EVARINT_OVERFLOW = -1 , EVARINT_REPRESENT = -2 } |
| Error codes for varint. More... | |
Functions | |
| template<typename F > | |
| void | apply_permutation (std::vector< size_t > permutation, const F &swap) |
| template<typename T > | |
| void | apply_permutation (const std::vector< size_t > &permutation, std::vector< T > &v) |
| template<class t_object > | |
| bool | serialize_obj_to_file (t_object &obj, const std::string &file_path) |
| template<class t_object > | |
| bool | unserialize_obj_from_file (t_object &obj, const std::string &file_path) |
| uint64_t | combinations_count (uint32_t k, uint32_t n) |
| static const char * | get_record_name (int record_type) |
| boost::optional< std::string > | ipv4_to_string (const char *src, size_t len) |
| boost::optional< std::string > | ipv6_to_string (const char *src, size_t len) |
| boost::optional< std::string > | txt_to_string (const char *src, size_t len) |
| static void | add_anchors (ub_ctx *ctx) |
| static void | download_thread (download_async_handle control) |
| bool | download (const std::string &path, const std::string &url, std::function< bool(const std::string &, const std::string &, size_t, ssize_t)> cb) |
| download_async_handle | download_async (const std::string &path, const std::string &url, std::function< void(const std::string &, const std::string &, bool)> result, std::function< bool(const std::string &, const std::string &, size_t, ssize_t)> progress) |
| bool | download_finished (const download_async_handle &control) |
| bool | download_error (const download_async_handle &control) |
| bool | download_wait (const download_async_handle &control) |
| bool | download_cancel (const download_async_handle &control) |
| static void | replace (std::vector< std::string > &v, const char *tag, const char *s) |
| uint64_t | get_tick_count () |
| uint64_t | ticks_to_ns (uint64_t ticks) |
| void | set_performance_timer_log_level (el::Level level) |
| uint64_t | get_ticks_per_ns () |
| uint32_t | make_pruning_seed (uint32_t stripe, uint32_t log_stripes) |
| bool | has_unpruned_block (uint64_t block_height, uint64_t blockchain_height, uint32_t pruning_seed) |
| uint32_t | get_pruning_stripe (uint64_t block_height, uint64_t blockchain_height, uint32_t log_stripes) |
| uint32_t | get_pruning_seed (uint64_t block_height, uint64_t blockchain_height, uint32_t log_stripes) |
| uint64_t | get_next_unpruned_block_height (uint64_t block_height, uint64_t blockchain_height, uint32_t pruning_seed) |
| uint64_t | get_next_pruned_block_height (uint64_t block_height, uint64_t blockchain_height, uint32_t pruning_seed) |
| uint32_t | get_random_stripe () |
| constexpr uint32_t | get_pruning_log_stripes (uint32_t pruning_seed) |
| uint32_t | get_pruning_stripe (uint32_t pruning_seed) |
| scoped_message_writer | success_msg_writer (bool color=true) |
| scoped_message_writer | msg_writer (epee::console_colors color=epee::console_color_default) |
| scoped_message_writer | fail_msg_writer () |
| int | spawn (const char *filename, const std::vector< std::string > &args, bool wait) |
| void | set_stack_trace_log (const std::string &log) |
| void | log_stack_trace (const char *msg) |
| bool | check_updates (const std::string &software, const std::string &buildtag, std::string &version, std::string &hash) |
| std::string | get_update_url (const std::string &software, const std::string &subdir, const std::string &buildtag, const std::string &version, bool user) |
| std::string | get_nix_version_display_string () |
| std::string | get_os_version_string () |
| Returns the OS version string. More... | |
| std::string | get_default_data_dir () |
| Returns the default data directory. More... | |
| bool | create_directories_if_necessary (const std::string &path) |
| creates directories for a path More... | |
| std::error_code | replace_file (const std::string &old_name, const std::string &new_name) |
| std::rename wrapper for nix and something strange for windows. More... | |
| static bool | unbound_built_with_threads () |
| bool | sanitize_locale () |
| static void | setup_crash_dump () |
| bool | disable_core_dumps () |
| ssize_t | get_lockable_memory () |
| bool | on_startup () |
| void | set_strict_default_file_permissions (bool strict) |
| boost::optional< bool > | is_hdd (const char *file_path) |
| void | set_max_concurrency (unsigned n) |
| unsigned | get_max_concurrency () |
| bool | is_local_address (const std::string &address) |
| int | vercmp (const char *v0, const char *v1) |
| bool | sha256sum (const uint8_t *data, size_t len, crypto::hash &hash) |
| bool | sha256sum (const std::string &filename, crypto::hash &hash) |
| boost::optional< std::pair< uint32_t, uint32_t > > | parse_subaddress_lookahead (const std::string &str) |
| int | display_simple_progress_spinner (int x) |
| std::string | glob_to_regex (const std::string &val) |
| void | closefrom (int fd) |
| std::string | get_human_readable_timestamp (uint64_t ts) |
| std::string | get_human_readable_bytes (uint64_t bytes) |
| template<typename OutputIt , typename T > | |
| std::enable_if< std::is_integral< T >::value &&std::is_unsigned< T >::value, void >::type | write_varint (OutputIt &&dest, T i) |
| writes a varint to a stream. More... | |
| template<typename T > | |
| std::string | get_varint_data (const T &v) |
| Returns the string that represents the varint. More... | |
| static uint64_t | decodeRct (const rct::rctSig &rv, const crypto::key_derivation &derivation, unsigned int i, rct::key &mask, hw::device &hwdev) |
| static uint32_t | get_count_above (const std::vector< wallet2::transfer_details > &transfers, const std::vector< size_t > &indices, uint64_t threshold) |
| static std::string | ptx_to_string (const tools::wallet2::pending_tx &ptx) |
| template<typename T > | |
| static bool | is_error_value (const T &val) |
| static bool | is_error_value (const std::string &s) |
| template<typename T , typename V > | |
| static bool | fill (T &where, V s) |
| template<typename T , typename V > | |
| static bool | fill (std::list< T > &where, V s) |
| static uint64_t | total_amount (const tools::wallet2::pending_tx &ptx) |
Variables | |
| static const int | DNS_CLASS_IN = 1 |
| static const int | DNS_TYPE_A = 1 |
| static const int | DNS_TYPE_TXT = 16 |
| static const int | DNS_TYPE_AAAA = 8 |
| el::Level | performance_timer_log_level = el::Level::Info |
| static __thread std::vector< LoggingPerformanceTimer * > * | performance_timers = NULL |
| static constexpr uint32_t | PRUNING_SEED_LOG_STRIPES_SHIFT = 7 |
| static constexpr uint32_t | PRUNING_SEED_LOG_STRIPES_MASK = 0x7 |
| static constexpr uint32_t | PRUNING_SEED_STRIPE_SHIFT = 0 |
| static constexpr uint32_t | PRUNING_SEED_STRIPE_MASK = 0x7f |
| static const std::chrono::seconds | rpc_timeout = std::chrono::minutes(3) + std::chrono::seconds(30) |
| const size_t | MAX_SPLIT_ATTEMPTS = 30 |
Various Tools.
| typedef std::shared_ptr<download_thread_control> tools::download_async_handle |
| typedef class scoped_ptr< ub_result, ub_resolve_free > tools::ub_result_ptr |
|
static |
| void tools::apply_permutation | ( | const std::vector< size_t > & | permutation, |
| std::vector< T > & | v | ||
| ) |
| void tools::apply_permutation | ( | std::vector< size_t > | permutation, |
| const F & | swap | ||
| ) |
| bool tools::check_updates | ( | const std::string & | software, |
| const std::string & | buildtag, | ||
| std::string & | version, | ||
| std::string & | hash | ||
| ) |
| void tools::closefrom | ( | int | fd | ) |
| uint64_t tools::combinations_count | ( | uint32_t | k, |
| uint32_t | n | ||
| ) |
| bool tools::create_directories_if_necessary | ( | const std::string & | path | ) |
creates directories for a path
wrapper around boost::filesyste::create_directories.
(ensure-directory-exists): greenspun's tenth rule in action!
|
static |
| bool tools::disable_core_dumps | ( | ) |
| int tools::display_simple_progress_spinner | ( | int | x | ) |
| bool tools::download | ( | const std::string & | path, |
| const std::string & | url, | ||
| std::function< bool(const std::string &, const std::string &, size_t, ssize_t)> | cb | ||
| ) |
| download_async_handle tools::download_async | ( | const std::string & | path, |
| const std::string & | url, | ||
| std::function< void(const std::string &, const std::string &, bool)> | result, | ||
| std::function< bool(const std::string &, const std::string &, size_t, ssize_t)> | progress | ||
| ) |
| bool tools::download_cancel | ( | const download_async_handle & | control | ) |
| bool tools::download_error | ( | const download_async_handle & | control | ) |
| bool tools::download_finished | ( | const download_async_handle & | control | ) |
|
static |
| bool tools::download_wait | ( | const download_async_handle & | control | ) |
|
inline |
|
static |
| std::string tools::get_default_data_dir | ( | ) |
Returns the default data directory.
Windows < Vista: C:\Documents and Settings\Username\Application Data\CRYPTONOTE_NAME
Windows >= Vista: C:\Users\Username\AppData\Roaming\CRYPTONOTE_NAME
Mac: ~/Library/Application Support/CRYPTONOTE_NAME
Unix: ~/.CRYPTONOTE_NAME
| std::string tools::get_human_readable_bytes | ( | uint64_t | bytes | ) |
| std::string tools::get_human_readable_timestamp | ( | uint64_t | ts | ) |
| ssize_t tools::get_lockable_memory | ( | ) |
| unsigned tools::get_max_concurrency | ( | ) |
| uint64_t tools::get_next_pruned_block_height | ( | uint64_t | block_height, |
| uint64_t | blockchain_height, | ||
| uint32_t | pruning_seed | ||
| ) |
| uint64_t tools::get_next_unpruned_block_height | ( | uint64_t | block_height, |
| uint64_t | blockchain_height, | ||
| uint32_t | pruning_seed | ||
| ) |
| std::string tools::get_nix_version_display_string | ( | ) |
| std::string tools::get_os_version_string | ( | ) |
Returns the OS version string.
This is a wrapper around the primitives get_windows_version_display_string() and get_nix_version_display_string()
|
inlineconstexpr |
| uint32_t tools::get_pruning_seed | ( | uint64_t | block_height, |
| uint64_t | blockchain_height, | ||
| uint32_t | log_stripes | ||
| ) |
|
inline |
| uint32_t tools::get_pruning_stripe | ( | uint64_t | block_height, |
| uint64_t | blockchain_height, | ||
| uint32_t | log_stripes | ||
| ) |
| uint32_t tools::get_random_stripe | ( | ) |
|
static |
| uint64_t tools::get_tick_count | ( | ) |
| uint64_t tools::get_ticks_per_ns | ( | ) |
| std::string tools::get_update_url | ( | const std::string & | software, |
| const std::string & | subdir, | ||
| const std::string & | buildtag, | ||
| const std::string & | version, | ||
| bool | user | ||
| ) |
| std::string tools::get_varint_data | ( | const T & | v | ) |
Returns the string that represents the varint.
| std::string tools::glob_to_regex | ( | const std::string & | val | ) |
| bool tools::has_unpruned_block | ( | uint64_t | block_height, |
| uint64_t | blockchain_height, | ||
| uint32_t | pruning_seed | ||
| ) |
| boost::optional<std::string> tools::ipv4_to_string | ( | const char * | src, |
| size_t | len | ||
| ) |
| boost::optional<std::string> tools::ipv6_to_string | ( | const char * | src, |
| size_t | len | ||
| ) |
|
static |
| boost::optional< bool > tools::is_hdd | ( | const char * | file_path | ) |
| bool tools::is_local_address | ( | const std::string & | address | ) |
| void tools::log_stack_trace | ( | const char * | msg | ) |
| uint32_t tools::make_pruning_seed | ( | uint32_t | stripe, |
| uint32_t | log_stripes | ||
| ) |
|
inline |
| bool tools::on_startup | ( | ) |
| boost::optional< std::pair< uint32_t, uint32_t > > tools::parse_subaddress_lookahead | ( | const std::string & | str | ) |
|
static |
|
static |
| std::error_code tools::replace_file | ( | const std::string & | old_name, |
| const std::string & | new_name | ||
| ) |
std::rename wrapper for nix and something strange for windows.
| bool tools::sanitize_locale | ( | ) |
| bool tools::serialize_obj_to_file | ( | t_object & | obj, |
| const std::string & | file_path | ||
| ) |
| void tools::set_max_concurrency | ( | unsigned | n | ) |
| void tools::set_performance_timer_log_level | ( | el::Level | level | ) |
| void tools::set_stack_trace_log | ( | const std::string & | log | ) |
| void tools::set_strict_default_file_permissions | ( | bool | strict | ) |
|
static |
| bool tools::sha256sum | ( | const std::string & | filename, |
| crypto::hash & | hash | ||
| ) |
| bool tools::sha256sum | ( | const uint8_t * | data, |
| size_t | len, | ||
| crypto::hash & | hash | ||
| ) |
| int tools::spawn | ( | const char * | filename, |
| const std::vector< std::string > & | args, | ||
| bool | wait | ||
| ) |
|
inline |
| uint64_t tools::ticks_to_ns | ( | uint64_t | ticks | ) |
|
static |
| boost::optional<std::string> tools::txt_to_string | ( | const char * | src, |
| size_t | len | ||
| ) |
|
static |
| bool tools::unserialize_obj_from_file | ( | t_object & | obj, |
| const std::string & | file_path | ||
| ) |
| int tools::vercmp | ( | const char * | v0, |
| const char * | v1 | ||
| ) |
| std::enable_if<std::is_integral<T>::value && std::is_unsigned<T>::value, void>::type tools::write_varint | ( | OutputIt && | dest, |
| T | i | ||
| ) |
writes a varint to a stream.
|
static |
|
static |
|
static |
|
static |
| const size_t tools::MAX_SPLIT_ATTEMPTS = 30 |
| el::Level tools::performance_timer_log_level = el::Level::Info |
|
static |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
static |