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

Method DeSerialize

deps/tesseract/ccutil/strngs.cpp:163–171  ·  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

161// Reads from the given file. Returns false in case of error.
162// If swap is true, assumes a big/little-endian swap is needed.
163bool STRING::DeSerialize(bool swap, FILE* fp) {
164 inT32 len;
165 if (fread(&len, sizeof(len), 1, fp) != 1) return false;
166 if (swap)
167 ReverseN(&len, sizeof(len));
168 truncate_at(len);
169 if (static_cast<int>(fread(GetCStr(), 1, len, fp)) != len) return false;
170 return true;
171}
172// Reads from the given file. Returns false in case of error.
173// If swap is true, assumes a big/little-endian swap is needed.
174bool STRING::DeSerialize(bool swap, TFile* fp) {

Callers

nothing calls this directly

Calls 3

ReverseNFunction · 0.85
GetCStrFunction · 0.85
FReadMethod · 0.80

Tested by

no test coverage detected