Ubuntu 18.04 Upgrade #3
2 changed files with 22 additions and 0 deletions
|
|
@ -191,6 +191,7 @@ set( fc_sources
|
||||||
src/rpc/http_api.cpp
|
src/rpc/http_api.cpp
|
||||||
src/rpc/json_connection.cpp
|
src/rpc/json_connection.cpp
|
||||||
src/rpc/state.cpp
|
src/rpc/state.cpp
|
||||||
|
src/rpc/bstate.cpp
|
||||||
src/rpc/websocket_api.cpp
|
src/rpc/websocket_api.cpp
|
||||||
src/log/log_message.cpp
|
src/log/log_message.cpp
|
||||||
src/log/logger.cpp
|
src/log/logger.cpp
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,13 @@
|
||||||
|
|
||||||
namespace fc {
|
namespace fc {
|
||||||
namespace raw {
|
namespace raw {
|
||||||
|
|
||||||
|
template<typename Stream, typename Arg0, typename... Args>
|
||||||
|
inline void pack( Stream& s, const Arg0& a0, Args... args ) {
|
||||||
|
pack( s, a0 );
|
||||||
|
pack( s, args... );
|
||||||
|
}
|
||||||
|
|
||||||
template<typename Stream>
|
template<typename Stream>
|
||||||
inline void pack( Stream& s, const fc::exception& e )
|
inline void pack( Stream& s, const fc::exception& e )
|
||||||
{
|
{
|
||||||
|
|
@ -547,6 +554,20 @@ namespace fc {
|
||||||
return vec;
|
return vec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename T, typename... Next>
|
||||||
|
inline std::vector<char> pack( const T& v, Next... next ) {
|
||||||
|
datastream<size_t> ps;
|
||||||
|
fc::raw::pack(ps,v,next...);
|
||||||
|
std::vector<char> vec(ps.tellp());
|
||||||
|
|
||||||
|
if( vec.size() ) {
|
||||||
|
datastream<char*> ds( vec.data(), size_t(vec.size()) );
|
||||||
|
fc::raw::pack(ds,v,next...);
|
||||||
|
}
|
||||||
|
return vec;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
inline T unpack( const std::vector<char>& s )
|
inline T unpack( const std::vector<char>& s )
|
||||||
{ try {
|
{ try {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue