#include "PBUtils.h" #include #include #include #include namespace bts { namespace utils { namespace pb { std::string to_string (google::protobuf::Message const &msg) { std::string result; google::protobuf::TextFormat::PrintToString (msg, &result); return result; } google::protobuf::Timestamp to_timestamp(datetime::PTime const &ptime) { google::protobuf::Timestamp gts; gts.set_seconds(boost::posix_time::to_time_t(ptime)); gts.set_nanos(0); return gts; } }}}