#include <fileio.h>
Definition at line 31 of file fileio.h.
◆ Delete()
bool tesseract::File::Delete |
( |
const char * |
pathname | ) |
|
|
static |
Definition at line 89 of file fileio.cpp.
90 const int status = unlink(pathname);
92 tprintf(
"ERROR: Unable to delete file %s\n", pathname);
◆ DeleteMatchingFiles()
bool tesseract::File::DeleteMatchingFiles |
( |
const char * |
pattern | ) |
|
|
static |
Definition at line 113 of file fileio.cpp.
116 bool all_deleted =
true;
117 if (glob(pattern, 0, NULL, &pglob) == 0) {
118 for (paths = pglob.gl_pathv; *paths != NULL; paths++) {
static bool Delete(const char *pathname)
◆ JoinPath()
string tesseract::File::JoinPath |
( |
const string & |
prefix, |
|
|
const string & |
suffix |
|
) |
| |
|
static |
Definition at line 83 of file fileio.cpp.
84 return (prefix.empty() || prefix[prefix.size() - 1] ==
'/')
86 : 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 |
◆ Readable()
bool tesseract::File::Readable |
( |
const string & |
filename | ) |
|
|
static |
◆ ReadFileToString()
bool tesseract::File::ReadFileToString |
( |
const string & |
filename, |
|
|
string * |
out |
|
) |
| |
|
static |
Definition at line 73 of file fileio.cpp.
77 InputBuffer in(stream);
80 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 53 of file fileio.cpp.
55 FILE* stream = fopen(
filename.c_str(),
"wb");
60 fputs(str.c_str(), stream);
The documentation for this class was generated from the following files: