#include <StdFile.h>
|
| StdFile () |
|
| StdFile (const char *path, const char *mode) |
|
| ~StdFile () |
|
void | open (const char *path, const char *mode) |
|
int | close () |
| Close a file stream, if open. More...
|
|
size_t | read (void *dest, size_t size, size_t count) |
|
size_t | write (const void *str, size_t size, size_t count) |
|
int | print (const char *format,...) |
|
int | print (const char *format, va_list args) |
|
int | seek (long offset, int whence) |
|
long | tell () |
|
void | rewind () |
| Sets the file position indicator to the beginning of the file. More...
|
|
bool | isOpen () |
|
void | destroy (void) |
| Destroy file stream. More...
|
|
virtual | ~File (void) |
| Destructor. More...
|
|
Neo::StdFile::StdFile |
( |
| ) |
|
Neo::StdFile::StdFile |
( |
const char * |
path, |
|
|
const char * |
mode |
|
) |
| |
Neo::StdFile::~StdFile |
( |
| ) |
|
int Neo::StdFile::close |
( |
| ) |
|
|
virtual |
Close a file stream, if open.
Implements Neo::File.
void Neo::StdFile::destroy |
( |
void |
| ) |
|
|
virtual |
static StdFile* Neo::StdFile::getNew |
( |
const char * |
path, |
|
|
const char * |
mode |
|
) |
| |
|
static |
bool Neo::StdFile::isOpen |
( |
| ) |
|
|
inlinevirtual |
Checks if file is open.
- Returns
- True if file is open.
Implements Neo::File.
void Neo::StdFile::open |
( |
const char * |
path, |
|
|
const char * |
mode |
|
) |
| |
|
virtual |
Opens a file stream with the name specified by path. This usually should not be used directly and should be opened from the MFileTools interface.
- Parameters
-
path | Path to file |
mode | Read or write mode ('r' or 'w') |
Implements Neo::File.
int Neo::StdFile::print |
( |
const char * |
format, |
|
|
|
... |
|
) |
| |
|
virtual |
Produces output according to the standard printf() style format and writes to the file. Returns the number of characters written to the file (excluding the null byte used to end output strings).
- Parameters
-
- Returns
- Number of characters written
Implements Neo::File.
int Neo::StdFile::print |
( |
const char * |
format, |
|
|
va_list |
args |
|
) |
| |
|
virtual |
Produces output according to the standard printf() style format and writes to the file. Returns the number of characters written to the file (excluding the null byte used to end output strings).
- Parameters
-
format | Format string |
args | Arguments |
- Returns
- Number of characters written
Implements Neo::File.
size_t Neo::StdFile::read |
( |
void * |
dest, |
|
|
size_t |
size, |
|
|
size_t |
count |
|
) |
| |
|
virtual |
Reads count amount of elements of data, each size bytes long, from the file, storing them at the location given by dest. Returns the number of items successfully read. If an error occurs, or the end-of-file is reached, the return value is a short item count (or zero).
- Parameters
-
dest | Data |
size | Data element size in bytes |
count | Number of elements to read |
- Returns
- Number of elements read
Implements Neo::File.
void Neo::StdFile::rewind |
( |
| ) |
|
|
virtual |
Sets the file position indicator to the beginning of the file.
Implements Neo::File.
int Neo::StdFile::seek |
( |
long |
offset, |
|
|
int |
whence |
|
) |
| |
|
virtual |
Sets the file position indicator. The new position, measured in bytes, is obtained by adding offset bytes to the position specified by whence. If whence is set to SEEK_SET, SEEK_CUR, or SEEK_END, the offset is relative to the start of the file, the current position indicator, or end-of-file respectively.
- Parameters
-
offset | Offset position in bytes |
whence | SEEK_SET, SEEK_CUR, or SEEK_END |
- Returns
- The resulting location
Implements Neo::File.
long Neo::StdFile::tell |
( |
| ) |
|
|
virtual |
Obtains the current value of the file position indicator for the file.
- Returns
- Current file position
Implements Neo::File.
size_t Neo::StdFile::write |
( |
const void * |
str, |
|
|
size_t |
size, |
|
|
size_t |
count |
|
) |
| |
|
virtual |
Writes count amount of elements of data, each size bytes long, to the file, obtaining them from the location given by str. Returns the number of items successfully written.
- Parameters
-
str | Data |
size | Data element size in bytes |
count | Number of elements to write |
- Returns
- Number of elements written
Implements Neo::File.
The documentation for this class was generated from the following file: