|
| template<class T > |
| std::string | dev::toHex (T const &_data, int _w=2, HexPrefix _prefix=HexPrefix::DontAdd) |
| |
| bytes | dev::fromHex (std::string const &_s, WhenError _throw=WhenError::DontThrow) |
| |
| bool | dev::isHex (std::string const &_s) noexcept |
| |
| std::string | dev::asString (bytes const &_b) |
| | Converts byte array to a string containing the same (binary) data. More...
|
| |
| std::string | dev::asString (bytesConstRef _b) |
| | Converts byte array ref to a string containing the same (binary) data. More...
|
| |
| bytes | dev::asBytes (std::string const &_b) |
| | Converts a string to a byte array containing the string's (byte) data. More...
|
| |
| bytes | dev::asNibbles (bytesConstRef const &_s) |
| |
| template<class T , class Out > |
| void | dev::toBigEndian (T _val, Out &o_out) |
| | Converts a templated integer value to the big-endian byte-stream represented on a templated collection. More...
|
| |
| 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. More...
|
| |
| std::string | dev::toBigEndianString (u256 _val) |
| | Convenience functions for toBigEndian. More...
|
| |
| std::string | dev::toBigEndianString (u160 _val) |
| |
| bytes | dev::toBigEndian (u256 _val) |
| |
| bytes | dev::toBigEndian (u160 _val) |
| |
| template<class T > |
| bytes | dev::toCompactBigEndian (T _val, unsigned _min=0) |
| | Convenience function for toBigEndian. More...
|
| |
| bytes | dev::toCompactBigEndian (byte _val, unsigned _min=0) |
| |
| template<class T > |
| std::string | dev::toCompactBigEndianString (T _val, unsigned _min=0) |
| | Convenience function for toBigEndian. More...
|
| |
| std::string | dev::toHex (u256 val, HexPrefix prefix=HexPrefix::DontAdd) |
| | Convenience function for conversion of a u256 to hex. More...
|
| |
| std::string | dev::toCompactHex (u256 val, HexPrefix prefix=HexPrefix::DontAdd, unsigned _min=0) |
| |
| std::string | dev::escaped (std::string const &_s, bool _all=true) |
| | Escapes a string into the C-string representation. More...
|
| |
| template<class T , class _U > |
| unsigned | dev::commonPrefix (T const &_t, _U const &_u) |
| |
| std::string | dev::randomWord () |
| | Creates a random, printable, word. More...
|
| |
| template<class T > |
| unsigned | dev::bytesRequired (T _i) |
| | Determine bytes required to encode the given integer value. More...
|
| |
| template<class T > |
| void | dev::trimFront (T &_t, unsigned _elements) |
| | Trims a given number of elements from the front of a collection. More...
|
| |
| template<class T , class _U > |
| void | dev::pushFront (T &_t, _U _e) |
| | Pushes an element on to the front of a collection. More...
|
| |
| 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. More...
|
| |
| 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. More...
|
| |
| 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. More...
|
| |
| 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. More...
|
| |
| 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. More...
|
| |
| 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. More...
|
| |
| 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. More...
|
| |
| 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. More...
|
| |
| template<class T > |
| std::vector< T > | dev::operator+ (std::vector< T > const &_a, std::vector< T > const &_b) |
| | Concatenate two vectors of elements. More...
|
| |
| template<class T > |
| std::set< T > & | dev::operator+= (std::set< T > &_a, std::set< T > const &_b) |
| | Merge two sets of elements. More...
|
| |
| template<class T > |
| std::set< T > | dev::operator+ (std::set< T > const &_a, std::set< T > const &_b) |
| | Merge two sets of elements. More...
|
| |
| template<class A , class B > |
| std::unordered_map< A, B > & | dev::operator+= (std::unordered_map< A, B > &_x, std::unordered_map< A, B > const &_y) |
| |
| template<class A , class B > |
| std::unordered_map< A, B > | dev::operator+ (std::unordered_map< A, B > const &_x, std::unordered_map< A, B > const &_y) |
| |
| std::string | dev::toString (string32 const &_s) |
| | Make normal string from fixed-length string. More...
|
| |
| 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::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) |
| |
| template<class T , class V > |
| bool | dev::contains (T const &_t, V const &_v) |
| |
- Author
- Gav Wood i@gav.nosp@m.wood.nosp@m..com
- Date
- 2014
Shared algorithms and data types.
Definition in file CommonData.h.