libidx
|
#include <stl.h>
Public Member Functions | |
file (const char *filename, const char *mode) | |
virtual | ~file () |
Close file pointer. | |
FILE * | get_fp () |
Returns the file pointer. | |
void | incr_ref () |
Increase reference counter. | |
void | decr_ref () |
Decrease reference counter. | |
bool | no_references () |
Returns true if no object refers to this instance. | |
uint | references () |
Returns the number of references to this file pointer. | |
Protected Attributes | |
FILE * | fp |
uint | refcounter |
Count how many objects refer to this instance. |
A file class containing a reference counter which knows when to close the file pointer.
std::file::file | ( | const char * | filename, |
const char * | mode | ||
) |
Open file 'filename' with mode 'mode'. This throws an error upon failure.