Template class SimpleFile to read and write from files.
Currently only simple reading and writing of blocks is supported.
Definition at line 27 of file SimpleFile.h.

Public Member Functions | |
| CSimpleFile (void) | |
| CSimpleFile (char *fname, FILE *f) | |
| virtual | ~CSimpleFile () |
| T * | load (T *target, int64_t &num=0) |
| bool | save (T *target, int64_t num) |
| void | get_buffered_line (char *line, uint64_t len) |
| void | free_line_buffer () |
| void | set_line_buffer_size (int32_t bufsize) |
| bool | is_ok () |
| virtual const char * | get_name () const |
Protected Attributes | |
| FILE * | file |
| bool | status |
| char | task |
| char * | filename |
| int32_t | line_buffer_size |
| char * | line_buffer |
| CSimpleFile | ( | void | ) |
default constructor
Definition at line 31 of file SimpleFile.h.
| CSimpleFile | ( | char * | fname, | |
| FILE * | f | |||
| ) |
constructor rw is either r for read and w for write
| fname | filename | |
| f | file descriptor |
Definition at line 46 of file SimpleFile.h.
| virtual ~CSimpleFile | ( | ) | [virtual] |
Definition at line 54 of file SimpleFile.h.
| void free_line_buffer | ( | ) |
free the line buffer
Definition at line 184 of file SimpleFile.h.
| void get_buffered_line | ( | char * | line, | |
| uint64_t | len | |||
| ) |
read a line (buffered; to be implemented)
| line | linebuffer to write to | |
| len | maximum length |
Definition at line 160 of file SimpleFile.h.
| virtual const char* get_name | ( | void | ) | const [virtual] |
| bool is_ok | ( | ) |
| T* load | ( | T * | target, | |
| int64_t & | num = 0 | |||
| ) |
load
| target | load target | |
| num | number of read elements |
Definition at line 66 of file SimpleFile.h.
| bool save | ( | T * | target, | |
| int64_t | num | |||
| ) |
save
| target | target to save to | |
| num | number of elements to write |
Definition at line 135 of file SimpleFile.h.
| void set_line_buffer_size | ( | int32_t | bufsize | ) |
set the size of the line buffer
| bufsize | size of the line buffer |
Definition at line 194 of file SimpleFile.h.
FILE* file [protected] |
file descriptor
Definition at line 214 of file SimpleFile.h.
char* filename [protected] |
filename
Definition at line 220 of file SimpleFile.h.
char* line_buffer [protected] |
line buffer
Definition at line 225 of file SimpleFile.h.
int32_t line_buffer_size [protected] |
size of line buffer
Definition at line 223 of file SimpleFile.h.
bool status [protected] |
status of file operations
Definition at line 216 of file SimpleFile.h.
char task [protected] |
task
Definition at line 218 of file SimpleFile.h.