|
bytes | dev::asBytes (std::string const &_b) |
| Converts a string to a byte array containing the string's (byte) data.
|
|
bytes | dev::asNibbles (bytesConstRef const &_s) |
|
std::string | dev::asString (bytes const &_b) |
| Converts byte array to a string containing the same (binary) data.
|
|
std::string | dev::asString (bytesConstRef _b) |
| Converts byte array ref to a string containing the same (binary) data.
|
|
template<class T , class _U > |
unsigned | dev::commonPrefix (T const &_t, _U const &_u) |
|
template<class T , class V > |
bool | dev::contains (T const &_t, V const &_v) |
|
template<class T , class _In > |
T | dev::fromBigEndian (_In const &_bytes) |
| Converts a big-endian byte-stream represented on a templated collection to a templated integer value.
|
|
bytes | dev::fromHex (std::string const &_s, WhenError _throw=WhenError::DontThrow) |
|
template<class T > |
static bool | dev::isHash (std::string const &_hash) |
|
bool | dev::isHex (std::string const &_s) noexcept |
|
template<class T , class U > |
std::vector< T > | dev::keysOf (std::map< T, U > const &_m) |
|
template<class T , class U > |
std::vector< T > | dev::keysOf (std::unordered_map< T, U > const &_m) |
|
template<class T , class U > |
std::set< T > | dev::operator+ (std::set< T > _a, U const &_b) |
| Insert the contents of a container into a set.
|
|
template<class T , class U > |
std::unordered_set< T > | dev::operator+ (std::unordered_set< T > _a, U const &_b) |
| Insert the contents of a container into an unordered_set.
|
|
template<class T , class U > |
std::vector< T > | dev::operator+ (std::vector< T > _a, U const &_b) |
| Concatenate the contents of a container onto a vector.
|
|
template<class T > |
std::vector< T > | dev::operator+ (std::vector< T > const &_a, std::vector< T > const &_b) |
| Concatenate two vectors of elements.
|
|
template<class T , class U > |
std::set< T > & | dev::operator+= (std::set< T > &_a, U const &_b) |
| Insert the contents of a container into a set.
|
|
template<class T , class U > |
std::unordered_set< T > & | dev::operator+= (std::unordered_set< T > &_a, U const &_b) |
| Insert the contents of a container into an unordered_set.
|
|
template<class T , class U > |
std::vector< T > & | dev::operator+= (std::vector< T > &_a, U const &_b) |
| Concatenate the contents of a container onto a vector.
|
|
template<class T > |
std::vector< T > & | dev::operator+= (std::vector< typename std::enable_if< std::is_pod< T >::value, T >::type > &_a, std::vector< T > const &_b) |
| Concatenate two vectors of elements of POD types.
|
|
template<class T > |
std::vector< T > & | dev::operator+= (std::vector< typename std::enable_if<!std::is_pod< T >::value, T >::type > &_a, std::vector< T > const &_b) |
| Concatenate two vectors of elements.
|
|
template<class T , class _U > |
void | dev::pushFront (T &_t, _U _e) |
| Pushes an element on to the front of a collection.
|
|
bytes | dev::toCompactBigEndian (uint8_t _val, unsigned _min=0) |
|
template<class Iterator > |
std::string | dev::toHex (Iterator _it, Iterator _end, std::string _prefix) |
|
template<class T > |
std::string | dev::toHex (T const &_data) |
|
template<class T > |
std::string | dev::toHexPrefixed (T const &_data) |
|
template<class T > |
void | dev::trimFront (T &_t, unsigned _elements) |
| Trims a given number of elements from the front of a collection.
|
|
template<class T , class U > |
std::vector< U > | dev::valuesOf (std::map< T, U > const &_m) |
|
template<class T , class U > |
std::vector< U > | dev::valuesOf (std::unordered_map< T, U > const &_m) |
|
- Author
- Gav Wood i@gav.nosp@m.wood.nosp@m..com
- Date
- 2014
Shared algorithms and data types.
Definition in file CommonData.h.