Commit 20a14772 authored by Davis King's avatar Davis King
Browse files

update docs

parent ab346ddf
...@@ -49,9 +49,19 @@ ...@@ -49,9 +49,19 @@
For convenience, you can also serialize to a file using this syntax: For convenience, you can also serialize to a file using this syntax:
serialize("your_file.dat") << some_object << another_object; serialize("your_file.dat") << some_object << another_object;
// or to a memory buffer.
std::vector<char> memory_buffer;
serialize(memory_buffer) << some_object << another_object;
// or some other stream
std::ostringstream memory_buffer2;
serialize(memory_buffer2) << some_object << another_object;
That overwrites the contents of your_file.dat with the serialized data from some_object That overwrites the contents of your_file.dat with the serialized data from some_object
and another_object. Then to recall the objects from the file you can do: and another_object. Then to recall the objects from the file you can do:
deserialize("your_file.dat") >> some_object >> another_object; deserialize("your_file.dat") >> some_object >> another_object;
// or from a memory buffer or another stream called memory_buffer.
deserialize(memory_buffer) >> some_object >> another_object;
Finally, you can chain as many objects together using the << and >> operators as you Finally, you can chain as many objects together using the << and >> operators as you
like. like.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment