23
23
#include <stdlib.h>
24
24
#include <string.h>
31
extern DLLSYM uinT64 reverse64(uinT64);
32
extern DLLSYM uinT32 reverse32(uinT32);
33
extern DLLSYM uinT16 reverse16(uinT16);
27
#include "genericvector.h"
35
29
/***********************************************************************
36
30
QUOTE_IT MACRO DEFINITION
41
35
#define QUOTE_IT( parm ) #parm
39
// Simple file class. Only does input for now.
40
// Allows for portable file input from memory.
45
// All the Open methods load the whole file into memory.
46
// Opens a file with a supplied reader, or NULL to use the default.
47
bool Open(const STRING& filename, FileReader reader);
48
// From an existing memory buffer.
49
bool Open(const char* data, int size);
50
// From an open file and an end offset.
51
bool Open(FILE* fp, inT64 end_offset);
53
// Reads a line like fgets. Returns NULL on EOF, otherwise buffer.
54
// Reads at most buffer_size bytes, including '\0' terminator, even if
55
// the line is longer. Does nothing if buffer_size <= 0.
56
char* FGets(char* buffer, int buffer_size);
57
// Replicates fread, returning the number of items read.
58
int FRead(void* buffer, int size, int count);
59
// To use fscanf use FGets and sscanf.
61
// Resets the TFile as if it has been Opened, but nothing read.
67
// The number of bytes used so far.
69
// The buffered data from the file.
70
GenericVector<char> data_;
73
} // namespace tesseract.