#include <fileio.h>
Definition at line 31 of file fileio.h.
◆ Delete()
bool tesseract::File::Delete |
( |
const char * |
pathname | ) |
|
|
static |
Definition at line 87 of file fileio.cpp.
88 const int status = unlink(pathname);
90 tprintf(
"ERROR: Unable to delete file %s\n", pathname);
◆ DeleteMatchingFiles()
bool tesseract::File::DeleteMatchingFiles |
( |
const char * |
pattern | ) |
|
|
static |
Definition at line 111 of file fileio.cpp.
114 bool all_deleted =
true;
115 if (glob(pattern, 0,
nullptr, &pglob) == 0) {
116 for (paths = pglob.gl_pathv; *paths !=
nullptr; paths++) {
static bool Delete(const char *pathname)
◆ JoinPath()
string tesseract::File::JoinPath |
( |
const string & |
prefix, |
|
|
const string & |
suffix |
|
) |
| |
|
static |
Definition at line 81 of file fileio.cpp.
82 return (prefix.empty() || prefix[prefix.size() - 1] ==
'/')
84 : prefix +
"/" + suffix;
◆ Open()
FILE * tesseract::File::Open |
( |
const string & |
filename, |
|
|
const string & |
mode |
|
) |
| |
|
static |
◆ OpenOrDie()
FILE * tesseract::File::OpenOrDie |
( |
const string & |
filename, |
|
|
const string & |
mode |
|
) |
| |
|
static |
Definition at line 42 of file fileio.cpp.
45 if (stream ==
nullptr) {
◆ Readable()
bool tesseract::File::Readable |
( |
const string & |
filename | ) |
|
|
static |
Definition at line 63 of file fileio.cpp.
65 if (stream ==
nullptr) {
◆ ReadFileToString()
bool tesseract::File::ReadFileToString |
( |
const string & |
filename, |
|
|
string * |
out |
|
) |
| |
|
static |
Definition at line 72 of file fileio.cpp.
74 if (stream ==
nullptr)
return false;
75 InputBuffer in(stream);
78 return in.CloseFile();
static FILE * Open(const string &filename, const string &mode)
◆ WriteStringToFileOrDie()
void tesseract::File::WriteStringToFileOrDie |
( |
const string & |
str, |
|
|
const string & |
filename |
|
) |
| |
|
static |
Definition at line 52 of file fileio.cpp.
55 if (stream ==
nullptr) {
59 fputs(str.c_str(),
stream);
The documentation for this class was generated from the following files:
- /home/stefan/src/github/tesseract-ocr/tesseract/training/fileio.h
- /home/stefan/src/github/tesseract-ocr/tesseract/training/fileio.cpp