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/serializerbinary.cpp | |
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 'src/serializerbinary.cpp')
-rw-r--r-- | src/serializerbinary.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/serializerbinary.cpp b/src/serializerbinary.cpp index 53e469f..4b741ae 100644 --- a/src/serializerbinary.cpp +++ b/src/serializerbinary.cpp | |||
@@ -1,4 +1,5 @@ | |||
1 | #include "serializerbinary.h" | 1 | #include "serializerbinary.h" |
2 | #include "serializable.h" | ||
2 | 3 | ||
3 | SerializerBinary::SerializerBinary(FILE *fhFile, bool bLoading): | 4 | SerializerBinary::SerializerBinary(FILE *fhFile, bool bLoading): |
4 | Serializer(bLoading), | 5 | Serializer(bLoading), |
@@ -35,7 +36,7 @@ void SerializerBinary::close() | |||
35 | } | 36 | } |
36 | } | 37 | } |
37 | 38 | ||
38 | void SerializerBinary::write(void * pData, int32_t nSize) | 39 | void SerializerBinary::write(const void * pData, int32_t nSize) |
39 | { | 40 | { |
40 | fwrite(pData, nSize, 1, fhFile); | 41 | fwrite(pData, nSize, 1, fhFile); |
41 | } | 42 | } |
@@ -62,7 +63,6 @@ Serializer &SerializerBinary::operator<<(int16_t p) | |||
62 | } | 63 | } |
63 | Serializer &SerializerBinary::operator<<(int32_t p) | 64 | Serializer &SerializerBinary::operator<<(int32_t p) |
64 | { | 65 | { |
65 | printf("int: %d, size: %d\n", p, sizeof(p)); | ||
66 | fwrite(&p, sizeof(p), 1, fhFile); | 66 | fwrite(&p, sizeof(p), 1, fhFile); |
67 | return *this; | 67 | return *this; |
68 | } | 68 | } |
@@ -109,9 +109,7 @@ Serializer &SerializerBinary::operator<<(long double p) | |||
109 | 109 | ||
110 | Serializer &SerializerBinary::operator>>(bool &p) | 110 | Serializer &SerializerBinary::operator>>(bool &p) |
111 | { | 111 | { |
112 | bool bTmp; | 112 | fread(&p, sizeof(p), 1, fhFile); |
113 | fread(&bTmp, sizeof(p), 1, fhFile); | ||
114 | p = bTmp; | ||
115 | return *this; | 113 | return *this; |
116 | } | 114 | } |
117 | Serializer &SerializerBinary::operator>>(int8_t &p) | 115 | Serializer &SerializerBinary::operator>>(int8_t &p) |
@@ -126,9 +124,7 @@ Serializer &SerializerBinary::operator>>(int16_t &p) | |||
126 | } | 124 | } |
127 | Serializer &SerializerBinary::operator>>(int32_t &p) | 125 | Serializer &SerializerBinary::operator>>(int32_t &p) |
128 | { | 126 | { |
129 | printf("reding before: %d", p); | ||
130 | fread(&p, sizeof(p), 1, fhFile); | 127 | fread(&p, sizeof(p), 1, fhFile); |
131 | printf(" after: %d\n", p); | ||
132 | return *this; | 128 | return *this; |
133 | } | 129 | } |
134 | Serializer &SerializerBinary::operator>>(int64_t &p) | 130 | Serializer &SerializerBinary::operator>>(int64_t &p) |