raw pack of fc::path
This commit is contained in:
parent
3da6a03987
commit
81c0290568
4 changed files with 27 additions and 0 deletions
|
|
@ -73,6 +73,7 @@ class ripemd160
|
|||
void from_variant( const variant& v, ripemd160& bi );
|
||||
|
||||
typedef ripemd160 uint160_t;
|
||||
typedef ripemd160 uint160;
|
||||
|
||||
} // namespace fc
|
||||
|
||||
|
|
|
|||
|
|
@ -61,6 +61,14 @@ class sha256
|
|||
friend bool operator >= ( const sha256& h1, const sha256& h2 );
|
||||
friend bool operator > ( const sha256& h1, const sha256& h2 );
|
||||
friend bool operator < ( const sha256& h1, const sha256& h2 );
|
||||
|
||||
uint32_t pop_count()
|
||||
{
|
||||
return __builtin_popcountll(_hash[0]) +
|
||||
__builtin_popcountll(_hash[1]) +
|
||||
__builtin_popcountll(_hash[2]) +
|
||||
__builtin_popcountll(_hash[3]);
|
||||
}
|
||||
|
||||
uint64_t _hash[4];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -7,12 +7,26 @@
|
|||
#include <fc/array.hpp>
|
||||
#include <fc/time.hpp>
|
||||
#include <fc/io/raw_fwd.hpp>
|
||||
#include <fc/filesystem.hpp>
|
||||
#include <fc/exception/exception.hpp>
|
||||
|
||||
#define MAX_ARRAY_ALLOC_SIZE (1024*1024*10)
|
||||
|
||||
namespace fc {
|
||||
namespace raw {
|
||||
template<typename Stream>
|
||||
inline void pack( Stream& s, const fc::path& tp )
|
||||
{
|
||||
fc::raw::pack( s, tp.generic_string() );
|
||||
}
|
||||
|
||||
template<typename Stream>
|
||||
inline void unpack( Stream& s, fc::path& tp )
|
||||
{
|
||||
std::string p;
|
||||
fc::raw::unpack( s, p );
|
||||
tp = p;
|
||||
}
|
||||
|
||||
template<typename Stream>
|
||||
inline void pack( Stream& s, const fc::time_point_sec& tp )
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ namespace fc {
|
|||
class time_point_sec;
|
||||
class variant;
|
||||
class variant_object;
|
||||
class path;
|
||||
template<typename IntType, typename EnumType> class enum_type;
|
||||
|
||||
namespace ecc { class public_key; class private_key; }
|
||||
|
|
@ -29,6 +30,9 @@ namespace fc {
|
|||
template<typename Stream> inline void pack( Stream& s, const variant& v );
|
||||
template<typename Stream> inline void unpack( Stream& s, variant& v );
|
||||
|
||||
template<typename Stream> inline void pack( Stream& s, const path& v );
|
||||
template<typename Stream> inline void unpack( Stream& s, path& v );
|
||||
|
||||
|
||||
template<typename Stream, typename T> void unpack( Stream& s, fc::optional<T>& v );
|
||||
template<typename Stream, typename T> void pack( Stream& s, const fc::optional<T>& v );
|
||||
|
|
|
|||
Loading…
Reference in a new issue