#include <fileio.h>
Definition at line 31 of file fileio.h.
bool tesseract::File::Delete |
( |
const char * |
pathname | ) |
|
|
static |
Definition at line 94 of file fileio.cpp.
95 const int status = unlink(pathname);
97 tprintf(
"ERROR: Unable to delete file %s\n", pathname);
bool tesseract::File::DeleteMatchingFiles |
( |
const char * |
pattern | ) |
|
|
static |
Definition at line 118 of file fileio.cpp.
121 bool all_deleted =
true;
122 if (glob(pattern, 0,
NULL, &pglob) == 0) {
123 for (paths = pglob.gl_pathv; *paths !=
NULL; paths++) {
static bool Delete(const char *pathname)
string tesseract::File::JoinPath |
( |
const string & |
prefix, |
|
|
const string & |
suffix |
|
) |
| |
|
static |
Definition at line 89 of file fileio.cpp.
90 return (!prefix.size() || prefix[prefix.size() - 1] ==
'/') ?
91 prefix + suffix : prefix +
"/" + suffix;
FILE * tesseract::File::Open |
( |
const string & |
filename, |
|
|
const string & |
mode |
|
) |
| |
|
static |
FILE * tesseract::File::OpenOrDie |
( |
const string & |
filename, |
|
|
const string & |
mode |
|
) |
| |
|
static |
bool tesseract::File::Readable |
( |
const string & |
filename | ) |
|
|
static |
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)
void tesseract::File::ReadFileToStringOrDie |
( |
const string & |
filename, |
|
|
string * |
out |
|
) |
| |
|
static |
Definition at line 83 of file fileio.cpp.
85 "Failed to read file: %s\n",
filename.c_str());
static bool ReadFileToString(const string &filename, string *out)
#define ASSERT_HOST_MSG(x, msg...)
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: