MCPcopy Create free account
hub / github.com/creatale/node-dv / DeSerialize

Method DeSerialize

deps/tesseract/classify/shapetable.cpp:74–80  ·  view source on GitHub ↗

Reads from the given file. Returns false in case of error. If swap is true, assumes a big/little-endian swap is needed.

Source from the content-addressed store, hash-verified

72// Reads from the given file. Returns false in case of error.
73// If swap is true, assumes a big/little-endian swap is needed.
74bool UnicharAndFonts::DeSerialize(bool swap, FILE* fp) {
75 if (fread(&unichar_id, sizeof(unichar_id), 1, fp) != 1) return false;
76 if (swap)
77 ReverseN(&unichar_id, sizeof(unichar_id));
78 if (!font_ids.DeSerialize(swap, fp)) return false;
79 return true;
80}
81
82// Sort function to sort a pair of UnicharAndFonts by unichar_id.
83int UnicharAndFonts::SortByUnicharId(const void* v1, const void* v2) {

Callers 2

ReadNewCutoffsMethod · 0.45

Calls 2

ReverseNFunction · 0.85
DeSerializeClassesMethod · 0.45

Tested by

no test coverage detected