#include <fileio.h>
List of all members.
Detailed Description
Definition at line 31 of file fileio.h.
Member Function Documentation
Definition at line 97 of file fileio.cpp.
{
const int status = unlink(pathname);
if (status != 0) {
tprintf("ERROR: Unable to delete file %s\n", pathname);
return false;
}
return true;
}
Definition at line 121 of file fileio.cpp.
{
glob_t pglob;
char **paths;
bool all_deleted = true;
if (glob(pattern, 0, NULL, &pglob) == 0) {
for (paths = pglob.gl_pathv; *paths != NULL; paths++) {
all_deleted &= File::Delete(*paths);
}
globfree(&pglob);
}
return all_deleted;
}
Definition at line 92 of file fileio.cpp.
{
return (!prefix.size() || prefix[prefix.size() - 1] == '/') ?
prefix + suffix : prefix + "/" + suffix;
}
Definition at line 43 of file fileio.cpp.
{
FILE* stream = fopen(filename.c_str(), mode.c_str());
if (stream == NULL) {
tprintf("Unable to open '%s' in mode '%s'\n", filename.c_str(),
mode.c_str());
}
return stream;
}
Definition at line 64 of file fileio.cpp.
{
FILE* stream = fopen(filename.c_str(), "rb");
if (stream == NULL) {
return false;
}
fclose(stream);
return true;
}
Definition at line 73 of file fileio.cpp.
{
FILE* stream = File::Open(filename.c_str(), "rb");
if (stream == NULL)
return false;
InputBuffer in(stream);
*out = "";
string temp;
while (in.ReadLine(&temp)) {
*out += temp;
*out += '\n';
}
return in.CloseFile();
}
Definition at line 53 of file fileio.cpp.
{
FILE* stream = fopen(filename.c_str(), "wb");
if (stream == NULL) {
tprintf("Unable to open '%s' for writing\n", filename.c_str());
return;
}
fputs(str.c_str(), stream);
ASSERT_HOST(fclose(stream) == 0);
}
The documentation for this class was generated from the following files:
- /usr/local/google/home/jbreiden/tesseract-ocr-read-only/training/fileio.h
- /usr/local/google/home/jbreiden/tesseract-ocr-read-only/training/fileio.cpp