MCPcopy Create free account
hub / github.com/davisking/dlib / deserialize

Function deserialize

dlib/gui_widgets/fonts.cpp:157–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155 }
156
157 void deserialize (
158 letter& item,
159 std::istream& in
160 )
161 {
162 try
163 {
164 if (item.points)
165 delete [] item.points;
166
167 deserialize(item.w,in);
168 deserialize(item.count,in);
169
170 if (item.count > 0)
171 item.points = new letter::point[item.count];
172 else
173 item.points = 0;
174
175 for (unsigned long i = 0; i < item.count; ++i)
176 {
177 deserialize(item.points[i].x,in);
178 deserialize(item.points[i].y,in);
179 }
180 }
181 catch (serialization_error& e)
182 {
183 item.w = 0;
184 item.count = 0;
185 item.points = 0;
186 throw serialization_error(e.info + "\n while deserializing object of type letter");
187 }
188 }
189
190// ----------------------------------------------------------------------------------------
191// ----------------------------------------------------------------------------------------

Callers 3

load_graphMethod · 0.70
deserializeMethod · 0.70
default_fontMethod · 0.70

Calls 1

serialization_errorClass · 0.85

Tested by

no test coverage detected