MySQL 5.6.14 Source Code Document
|
#include <File.hpp>
Public Member Functions | |
File_class () | |
File_class (const char *aFileName, const char *mode="r") | |
~File_class () | |
bool | open () |
bool | open (const char *aFileName, const char *mode) |
bool | is_open () |
bool | remove () |
bool | close () |
int | read (void *buf, size_t itemSize, size_t nitems) const |
int | readChar (char *buf, long start, long length) const |
int | readChar (char *buf) |
int | write (const void *buf, size_t itemSize, size_t nitems) |
int | writeChar (const char *buf, long start, long length) |
int | writeChar (const char *buf) |
off_t | size () const |
const char * | getName () const |
int | flush () const |
Static Public Member Functions | |
static time_t | mtime (const char *aFileName) |
static bool | exists (const char *aFileName) |
static off_t | size (FILE *f) |
static bool | rename (const char *currFileName, const char *newFileName) |
static bool | remove (const char *aFileName) |
This class provides a file abstraction . It has operations to create, read, write and delete a file.
File_class::File_class | ( | const char * | aFileName, |
const char * | mode = "r" |
||
) |
Creates a new File with the specified filename and file mode. The real file itself will not be created unless open() is called!
To see the available file modes use 'man 3 fopen'.
aFileName | a filename. |
mode | the mode which the file should be opened/created with, default "r". |
Definition at line 70 of file File.cpp.
File_class::~File_class | ( | ) |
bool File_class::close | ( | void | ) |
|
static |
int File_class::flush | ( | ) | const |
const char * File_class::getName | ( | ) | const |
bool File_class::is_open | ( | void | ) |
|
static |
bool File_class::open | ( | ) |
bool File_class::open | ( | const char * | aFileName, |
const char * | mode | ||
) |
Opens/creates the file with the specified name and mode. If open() fails then 'errno' and perror() should be used to determine the exact failure cause.
aFileName | the file to open. |
mode | the file mode to use. |
Only copy if it's not the same string
Definition at line 84 of file File.cpp.
int File_class::read | ( | void * | buf, |
size_t | itemSize, | ||
size_t | nitems | ||
) | const |
int File_class::readChar | ( | char * | buf, |
long | start, | ||
long | length | ||
) | const |
int File_class::readChar | ( | char * | buf | ) |
|
static |
bool File_class::remove | ( | void | ) |
|
static |
|
static |
off_t File_class::size | ( | void | ) | const |
int File_class::write | ( | const void * | buf, |
size_t | itemSize, | ||
size_t | nitems | ||
) |
int File_class::writeChar | ( | const char * | buf, |
long | start, | ||
long | length | ||
) |
int File_class::writeChar | ( | const char * | buf | ) |