[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/WanderWalker/msgpack/java-0.5.1/example/simple.cc [Back]  [Original]

#include 
#include 
#include 
#include 

int main(void)
{
	msgpack::type::tuple src(1, true, "example");

	// serialize the object into the buffer.
	// any classes that implements write(const char*,size_t) can be a buffer.
	std::stringstream buffer;
	msgpack::pack(buffer, src);

	// send the buffer ...
	buffer.seekg(0);

	// deserialize the buffer into msgpack::object instance.
	std::string str(buffer.str());

	// deserialized object is valid during the msgpack::zone instance alive.
	msgpack::zone mempool;

	msgpack::object deserialized;
	msgpack::unpack(str.data(), str.size(), NULL, &mempool, &deserialized);

	// msgpack::object supports ostream.
	std::cout 

Web Proxy Viewer  |  New URL  |  Original Page