diff options
Diffstat (limited to '')
-rw-r--r-- | src/serializerbinary.cpp | 126 |
1 files changed, 4 insertions, 122 deletions
diff --git a/src/serializerbinary.cpp b/src/serializerbinary.cpp index 23fb2b1..bfe3cc9 100644 --- a/src/serializerbinary.cpp +++ b/src/serializerbinary.cpp | |||
@@ -48,127 +48,9 @@ void SerializerBinary::write(const void * pData, int32_t nSize) | |||
48 | 48 | ||
49 | void SerializerBinary::read(void * pData, int32_t nSize) | 49 | void SerializerBinary::read(void * pData, int32_t nSize) |
50 | { | 50 | { |
51 | fread(pData, nSize, 1, fhFile); | 51 | if( fread(pData, nSize, 1, fhFile) < 1 ) |
52 | } | 52 | { |
53 | 53 | throw FileException( excodeEOF, "End of file read"); | |
54 | Serializer &SerializerBinary::operator<<(bool p) | 54 | } |
55 | { | ||
56 | fwrite(&p, sizeof(p), 1, fhFile); | ||
57 | return *this; | ||
58 | } | ||
59 | Serializer &SerializerBinary::operator<<(int8_t p) | ||
60 | { | ||
61 | fwrite(&p, sizeof(p), 1, fhFile); | ||
62 | return *this; | ||
63 | } | ||
64 | Serializer &SerializerBinary::operator<<(int16_t p) | ||
65 | { | ||
66 | fwrite(&p, sizeof(p), 1, fhFile); | ||
67 | return *this; | ||
68 | } | ||
69 | Serializer &SerializerBinary::operator<<(int32_t p) | ||
70 | { | ||
71 | fwrite(&p, sizeof(p), 1, fhFile); | ||
72 | return *this; | ||
73 | } | ||
74 | Serializer &SerializerBinary::operator<<(int64_t p) | ||
75 | { | ||
76 | fwrite(&p, sizeof(p), 1, fhFile); | ||
77 | return *this; | ||
78 | } | ||
79 | Serializer &SerializerBinary::operator<<(uint8_t p) | ||
80 | { | ||
81 | fwrite(&p, sizeof(p), 1, fhFile); | ||
82 | return *this; | ||
83 | } | ||
84 | Serializer &SerializerBinary::operator<<(uint16_t p) | ||
85 | { | ||
86 | fwrite(&p, sizeof(p), 1, fhFile); | ||
87 | return *this; | ||
88 | } | ||
89 | Serializer &SerializerBinary::operator<<(uint32_t p) | ||
90 | { | ||
91 | fwrite(&p, sizeof(p), 1, fhFile); | ||
92 | return *this; | ||
93 | } | ||
94 | Serializer &SerializerBinary::operator<<(uint64_t p) | ||
95 | { | ||
96 | fwrite(&p, sizeof(p), 1, fhFile); | ||
97 | return *this; | ||
98 | } | ||
99 | Serializer &SerializerBinary::operator<<(float p) | ||
100 | { | ||
101 | fwrite(&p, sizeof(p), 1, fhFile); | ||
102 | return *this; | ||
103 | } | ||
104 | Serializer &SerializerBinary::operator<<(double p) | ||
105 | { | ||
106 | fwrite(&p, sizeof(p), 1, fhFile); | ||
107 | return *this; | ||
108 | } | ||
109 | Serializer &SerializerBinary::operator<<(long double p) | ||
110 | { | ||
111 | fwrite(&p, sizeof(p), 1, fhFile); | ||
112 | return *this; | ||
113 | } | 55 | } |
114 | 56 | ||
115 | Serializer &SerializerBinary::operator>>(bool &p) | ||
116 | { | ||
117 | fread(&p, sizeof(p), 1, fhFile); | ||
118 | return *this; | ||
119 | } | ||
120 | Serializer &SerializerBinary::operator>>(int8_t &p) | ||
121 | { | ||
122 | fread(&p, sizeof(p), 1, fhFile); | ||
123 | return *this; | ||
124 | } | ||
125 | Serializer &SerializerBinary::operator>>(int16_t &p) | ||
126 | { | ||
127 | fread(&p, sizeof(p), 1, fhFile); | ||
128 | return *this; | ||
129 | } | ||
130 | Serializer &SerializerBinary::operator>>(int32_t &p) | ||
131 | { | ||
132 | fread(&p, sizeof(p), 1, fhFile); | ||
133 | return *this; | ||
134 | } | ||
135 | Serializer &SerializerBinary::operator>>(int64_t &p) | ||
136 | { | ||
137 | fread(&p, sizeof(p), 1, fhFile); | ||
138 | return *this; | ||
139 | } | ||
140 | Serializer &SerializerBinary::operator>>(uint8_t &p) | ||
141 | { | ||
142 | fread(&p, sizeof(p), 1, fhFile); | ||
143 | return *this; | ||
144 | } | ||
145 | Serializer &SerializerBinary::operator>>(uint16_t &p) | ||
146 | { | ||
147 | fread(&p, sizeof(p), 1, fhFile); | ||
148 | return *this; | ||
149 | } | ||
150 | Serializer &SerializerBinary::operator>>(uint32_t &p) | ||
151 | { | ||
152 | fread(&p, sizeof(p), 1, fhFile); | ||
153 | return *this; | ||
154 | } | ||
155 | Serializer &SerializerBinary::operator>>(uint64_t &p) | ||
156 | { | ||
157 | fread(&p, sizeof(p), 1, fhFile); | ||
158 | return *this; | ||
159 | } | ||
160 | Serializer &SerializerBinary::operator>>(float &p) | ||
161 | { | ||
162 | fread(&p, sizeof(p), 1, fhFile); | ||
163 | return *this; | ||
164 | } | ||
165 | Serializer &SerializerBinary::operator>>(double &p) | ||
166 | { | ||
167 | fread(&p, sizeof(p), 1, fhFile); | ||
168 | return *this; | ||
169 | } | ||
170 | Serializer &SerializerBinary::operator>>(long double &p) | ||
171 | { | ||
172 | fread(&p, sizeof(p), 1, fhFile); | ||
173 | return *this; | ||
174 | } | ||