diff options
author | David <david@xagasoft.com> | 2006-05-13 00:08:20 +0000 |
---|---|---|
committer | David <david@xagasoft.com> | 2006-05-13 00:08:20 +0000 |
commit | de1aa6d66e11232edf2d7bbc729425003f6c3db5 (patch) | |
tree | 443216dc0fb9ac2bc66539332286b7b3167940b2 /src/test/serialize.cpp | |
parent | 59cea3a2c49618ec7351028334d468a9204f4027 (diff) | |
download | libbu++-de1aa6d66e11232edf2d7bbc729425003f6c3db5.tar.gz libbu++-de1aa6d66e11232edf2d7bbc729425003f6c3db5.tar.bz2 libbu++-de1aa6d66e11232edf2d7bbc729425003f6c3db5.tar.xz libbu++-de1aa6d66e11232edf2d7bbc729425003f6c3db5.zip |
david - initial commit of serialize code ;p
Diffstat (limited to '')
-rw-r--r-- | src/test/serialize.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/test/serialize.cpp b/src/test/serialize.cpp new file mode 100644 index 0000000..883be5e --- /dev/null +++ b/src/test/serialize.cpp | |||
@@ -0,0 +1,24 @@ | |||
1 | #include "serializerbinary.h" | ||
2 | #include <stdio.h> | ||
3 | |||
4 | int main() | ||
5 | { | ||
6 | int32_t one; | ||
7 | double two; | ||
8 | bool three; | ||
9 | SerializerBinary ar("hello.dat", false); | ||
10 | ar << (int)85; | ||
11 | ar << (double)2.63434; | ||
12 | ar << false; | ||
13 | ar.close(); | ||
14 | |||
15 | one = 0; two = 0; three = true; | ||
16 | |||
17 | SerializerBinary ar2("hello.dat", true); | ||
18 | ar2 >> one; | ||
19 | ar2 >> two; | ||
20 | ar2 >> three; | ||
21 | |||
22 | printf("we got %d - %f - %s\n", one, two, (three ? "true":"false")); | ||
23 | return 0; | ||
24 | } | ||