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

Method DeSerializeElement

deps/tesseract/ccutil/genericvector.h:585–601  ·  view source on GitHub ↗

Reads and appends to the vector the next element of the serialization.

Source from the content-addressed store, hash-verified

583 }
584 // Reads and appends to the vector the next element of the serialization.
585 bool DeSerializeElement(bool swap, TFile* fp) {
586 inT8 non_null;
587 if (fp->FRead(&non_null, sizeof(non_null), 1) != 1) return false;
588 T* item = NULL;
589 if (non_null) {
590 item = new T;
591 if (!item->DeSerialize(swap, fp)) {
592 delete item;
593 return false;
594 }
595 this->push_back(item);
596 } else {
597 // Null elements should keep their place in the vector.
598 this->push_back(NULL);
599 }
600 return true;
601 }
602 // Skips the next element of the serialization.
603 static bool DeSerializeSkip(bool swap, TFile* fp) {
604 inT8 non_null;

Callers 1

ReCachePagesMethod · 0.80

Calls 3

FReadMethod · 0.80
DeSerializeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected