Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
20a14772
Commit
20a14772
authored
Sep 19, 2020
by
Davis King
Browse files
update docs
parent
ab346ddf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
dlib/serialize.h
dlib/serialize.h
+10
-0
No files found.
dlib/serialize.h
View file @
20a14772
...
@@ -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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment