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

Function SaveDataToFile

deps/tesseract/ccutil/genericvector.h:379–387  ·  view source on GitHub ↗

The default FileWriter writes the vector of char to the filename file, returning false on error.

Source from the content-addressed store, hash-verified

377// The default FileWriter writes the vector of char to the filename file,
378// returning false on error.
379inline bool SaveDataToFile(const GenericVector<char>& data,
380 const STRING& filename) {
381 FILE* fp = fopen(filename.string(), "wb");
382 if (fp == NULL) return false;
383 bool result =
384 static_cast<int>(fwrite(&data[0], 1, data.size(), fp)) == data.size();
385 fclose(fp);
386 return result;
387}
388
389template <typename T>
390bool cmp_eq(T const & t1, T const & t2) {

Callers 1

CloseWriteMethod · 0.85

Calls 2

stringMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected