diff options
author | Mike Buland <eichlan@xagasoft.com> | 2006-05-13 01:54:06 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2006-05-13 01:54:06 +0000 |
commit | eb71d88041ccbb0aec3532f9b1aa40e956e948c2 (patch) | |
tree | f2cb344f21b0cac643435701ddf4742c9a581707 /src/test | |
parent | 3df557a87b39fc4c2ff14006506e6992d1620ab0 (diff) | |
download | libbu++-eb71d88041ccbb0aec3532f9b1aa40e956e948c2.tar.gz libbu++-eb71d88041ccbb0aec3532f9b1aa40e956e948c2.tar.bz2 libbu++-eb71d88041ccbb0aec3532f9b1aa40e956e948c2.tar.xz libbu++-eb71d88041ccbb0aec3532f9b1aa40e956e948c2.zip |
Changed some things in the serializer...it's cool
Diffstat (limited to '')
-rw-r--r-- | src/test/serialize.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/test/serialize.cpp b/src/test/serialize.cpp index 883be5e..e233704 100644 --- a/src/test/serialize.cpp +++ b/src/test/serialize.cpp | |||
@@ -1,24 +1,30 @@ | |||
1 | #include "serializerbinary.h" | 1 | #include "serializerbinary.h" |
2 | #include "staticstring.h" | ||
2 | #include <stdio.h> | 3 | #include <stdio.h> |
4 | #include <string> | ||
3 | 5 | ||
4 | int main() | 6 | int main() |
5 | { | 7 | { |
6 | int32_t one; | 8 | int32_t one; |
7 | double two; | 9 | double two; |
8 | bool three; | 10 | bool three; |
11 | StaticString s("Test string!"); | ||
12 | std::string ss("Another test string"); | ||
9 | SerializerBinary ar("hello.dat", false); | 13 | SerializerBinary ar("hello.dat", false); |
10 | ar << (int)85; | 14 | ar << (int)85; |
11 | ar << (double)2.63434; | 15 | ar << (double)2.63434; |
12 | ar << false; | 16 | ar << false; |
17 | ar << ss; | ||
13 | ar.close(); | 18 | ar.close(); |
14 | 19 | ||
15 | one = 0; two = 0; three = true; | 20 | one = 0; two = 0; three = true; s = "die"; |
16 | 21 | ||
17 | SerializerBinary ar2("hello.dat", true); | 22 | SerializerBinary ar2("hello.dat", true); |
18 | ar2 >> one; | 23 | ar2 >> one; |
19 | ar2 >> two; | 24 | ar2 >> two; |
20 | ar2 >> three; | 25 | ar2 >> three; |
26 | ar2 >> s; | ||
21 | 27 | ||
22 | printf("we got %d - %f - %s\n", one, two, (three ? "true":"false")); | 28 | printf("we got %d - %f - %s - \"%s\"\n", one, two, (three ? "true":"false"), s.getString() ); |
23 | return 0; | 29 | return 0; |
24 | } | 30 | } |