diff --git a/include/fc/filesystem.hpp b/include/fc/filesystem.hpp index 780f7a9..28261c2 100644 --- a/include/fc/filesystem.hpp +++ b/include/fc/filesystem.hpp @@ -69,5 +69,9 @@ namespace fc { path unique_path(); path temp_directory_path(); + + class value; + void pack( fc::value& , const fc::path& ); + void unpack( const fc::value& , fc::path& ); } diff --git a/include/fc/ip.hpp b/include/fc/ip.hpp index a34ee6b..10e53dc 100644 --- a/include/fc/ip.hpp +++ b/include/fc/ip.hpp @@ -1,5 +1,4 @@ -#ifndef _FC_IP_HPP_ -#define _FC_IP_HPP_ +#pragma once #include namespace fc { @@ -47,5 +46,7 @@ namespace fc { uint32_t _port; }; } + class value; + void pack( fc::value& , const fc::ip::endpoint& ); + void unpack( const fc::value& , fc::ip::endpoint& ); } -#endif // _FC_ENDPOINT_HPP_ diff --git a/src/filesystem.cpp b/src/filesystem.cpp index ee001a9..81bd67e 100644 --- a/src/filesystem.cpp +++ b/src/filesystem.cpp @@ -2,8 +2,15 @@ #include #include #include +#include namespace fc { + void pack( fc::value& v, const fc::path& s ) { + v = s.generic_string(); + } + void unpack( const fc::value& v, fc::path& s ) { + s = path(fc::value_cast(v)); + } path::path(){} path::~path(){}; diff --git a/src/ip.cpp b/src/ip.cpp index 48b22e0..f7f8840 100644 --- a/src/ip.cpp +++ b/src/ip.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -53,4 +54,12 @@ namespace fc { namespace ip { return string(_ip) + ':' + fc::string(boost::lexical_cast(_port).c_str()); } -} } +} + void pack( fc::value& v, const fc::ip::endpoint& s ) { + v = fc::string(s); + } + void unpack( const fc::value& v, fc::ip::endpoint& s ) { + s = fc::ip::endpoint::from_string(fc::value_cast(v)); + } + +} diff --git a/src/pke.cpp b/src/pke.cpp index 97d8a00..2ed6fbf 100644 --- a/src/pke.cpp +++ b/src/pke.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include