|
Public Member Functions |
size_t | Read (void *const buff, size_t size) |
| Reads "size" bytes to buff from file, buff should be pre-allocated.
|
void | ReadOrDie (void *const buff, size_t size) |
| Reads "size" bytes to buff from file, buff should be pre-allocated.
|
char * | ReadLine (char *const output, uint64 max_length) |
| Reads a line from file to a string.
|
int64 | ReadToString (std::string *const line, uint64 max_length) |
| Reads the whole file to a string, with a maximum length of 'max_length'.
|
size_t | Write (const void *const buff, size_t size) |
| Writes "size" bytes of buff to file, buff should be pre-allocated.
|
void | WriteOrDie (const void *const buff, size_t size) |
| Writes "size" bytes of buff to file, buff should be pre-allocated.
|
size_t | WriteString (const std::string &line) |
| Writse a string to file.
|
bool | WriteLine (const std::string &line) |
| Writes a string to file and append a "\n".
|
bool | Close () |
| Closes the file.
|
bool | Flush () |
| Flushes buffer.
|
size_t | Size () |
| Returns file size.
|
std::string | CreateFileName () const |
| Returns the file name.
|
bool | Open () const |
Static Public Member Functions |
static File * | Open (const char *const name, const char *const flag) |
| Opens file "name" with flags specified by "flag".
|
static File * | Open (const std::string &name, const char *const mode) |
static File * | OpenOrDie (const char *const name, const char *const flag) |
| Opens file "name" with flags specified by "flag" If open failed, program will exit.
|
static void | Init () |
| Inits internal data structures.
|
static bool | Delete (char *const name) |
| Deletes a file.
|
static bool | Exists (char *const name) |
| Tests if a file exists.
|
File * operations_research::File::Open |
( |
const char *const |
name, |
|
|
const char *const |
flag | |
|
) |
| | [static] |
Opens file "name" with flags specified by "flag".
Flags are defined by fopen(), that is "r", "r+", "w", "w+". "a", and "a+". no overloading
Definition at line 88 of file file.cc.