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

Method SaveDocument

deps/tesseract/ccstruct/imagedata.cpp:408–417  ·  view source on GitHub ↗

Writes all the pages to the given filename. Returns false on error.

Source from the content-addressed store, hash-verified

406
407// Writes all the pages to the given filename. Returns false on error.
408bool DocumentData::SaveDocument(const char* filename, FileWriter writer) {
409 SVAutoLock lock(&pages_mutex_);
410 TFile fp;
411 fp.OpenWrite(NULL);
412 if (!pages_.Serialize(&fp) || !fp.CloseWrite(filename, writer)) {
413 tprintf("Serialize failed: %s\n", filename);
414 return false;
415 }
416 return true;
417}
418bool DocumentData::SaveToBuffer(GenericVector<char>* buffer) {
419 SVAutoLock lock(&pages_mutex_);
420 TFile fp;

Callers

nothing calls this directly

Calls 3

OpenWriteMethod · 0.80
CloseWriteMethod · 0.80
SerializeMethod · 0.45

Tested by

no test coverage detected