#include <fileio.h>
Definition at line 55 of file fileio.h.
◆ Delete()
bool tesseract::File::Delete |
( |
const char * |
pathname | ) |
|
|
static |
Definition at line 104 of file fileio.cpp.
108 WIN32_FIND_DATA data;
110 HANDLE handle = FindFirstFile(pattern, &data);
111 bool all_deleted =
true;
112 if (handle != INVALID_HANDLE_VALUE) {
113 for (; result; result = FindNextFile(handle, &data)) {
◆ DeleteMatchingFiles()
bool tesseract::File::DeleteMatchingFiles |
( |
const char * |
pattern | ) |
|
|
static |
◆ JoinPath()
Definition at line 98 of file fileio.cpp.
99 tprintf(
"ERROR: Unable to delete file '%s$: %s\n", pathname,
◆ Open()
◆ OpenOrDie()
Definition at line 58 of file fileio.cpp.
60 tprintf(
"Unable to open '%s' for writing: %s\n",
61 filename.c_str(), strerror(errno));
64 fputs(str.c_str(), stream);
◆ Readable()
bool tesseract::File::Readable |
( |
const std::string & |
filename | ) |
|
|
static |
Definition at line 80 of file fileio.cpp.
87 return (prefix.empty() || prefix[prefix.size() - 1] ==
'/')
◆ ReadFileToString()
Definition at line 89 of file fileio.cpp.
89 : prefix +
"/" + suffix;
93 #if !defined(_WIN32) || defined(__MINGW32__)
94 const int status = unlink(pathname);
96 const int status = _unlink(pathname);
◆ WriteStringToFileOrDie()
Definition at line 68 of file fileio.cpp.
69 FILE* stream = fopen(filename.c_str(),
"rb");
70 if (stream ==
nullptr) {
78 FILE* stream =
File::Open(filename.c_str(),
"rb");
The documentation for this class was generated from the following files: