diff --git a/CMakeLists.txt b/CMakeLists.txt index 86e8a32..b53146f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -191,6 +191,7 @@ set( fc_sources src/rpc/http_api.cpp src/rpc/json_connection.cpp src/rpc/state.cpp + src/rpc/bstate.cpp src/rpc/websocket_api.cpp src/log/log_message.cpp src/log/logger.cpp diff --git a/include/fc/io/raw.hpp b/include/fc/io/raw.hpp index bc5cd22..288c3c9 100644 --- a/include/fc/io/raw.hpp +++ b/include/fc/io/raw.hpp @@ -17,6 +17,13 @@ namespace fc { namespace raw { + + template + inline void pack( Stream& s, const Arg0& a0, Args... args ) { + pack( s, a0 ); + pack( s, args... ); + } + template inline void pack( Stream& s, const fc::exception& e ) { @@ -547,6 +554,20 @@ namespace fc { return vec; } + template + inline std::vector pack( const T& v, Next... next ) { + datastream ps; + fc::raw::pack(ps,v,next...); + std::vector vec(ps.tellp()); + + if( vec.size() ) { + datastream ds( vec.data(), size_t(vec.size()) ); + fc::raw::pack(ds,v,next...); + } + return vec; + } + + template inline T unpack( const std::vector& s ) { try {