#include <File.h>
Public Member Functions | |
| File (void) | |
| ~File (void) | |
| const cl7::string_type & | GetFileName () const |
| bool | IsOpen () const |
| OpenFlags | GetOpenFlags () const |
| unsigned | GetSize () const |
| bool | SetSize (unsigned size) |
| unsigned | GetPointer () const |
| unsigned | SetPointer (unsigned pointer) |
| bool | Open (const cl7::string_type &file_name) |
| bool | Open (const cl7::string_type &file_name, const OpenFlags flags) |
| bool | Open () |
| bool | Open (const OpenFlags flags) |
| bool | Close () |
| unsigned | Read (void *buffer, unsigned bytes) |
| unsigned | Write (const void *buffer, unsigned bytes) |
| unsigned | Seek (signed bytes, const SeekFlags from=current) |
The class to create, read, and write data from or into files in the file system.
| xl7::io::File::File | ( | void | ) |
Default constructor.
| xl7::io::File::~File | ( | void | ) |
Destructor.
| bool xl7::io::File::Close | ( | ) | [virtual] |
Closes the file.
Implements xl7::io::IRom.
| const cl7::string_type& xl7::io::File::GetFileName | ( | ) | const [inline] |
Returns the file name of the (open) file.
| OpenFlags xl7::io::File::GetOpenFlags | ( | ) | const [inline, virtual] |
Returns the flags the file was opened with.
Implements xl7::io::IFile.
| unsigned xl7::io::File::GetPointer | ( | ) | const [inline, virtual] |
Returns the current byte position to read or write data.
Implements xl7::io::IRom.
| unsigned xl7::io::File::GetSize | ( | ) | const [virtual] |
Returns the size of the file, in bytes.
Implements xl7::io::IRom.
| bool xl7::io::File::IsOpen | ( | ) | const [inline, virtual] |
Checks whether the file is open.
Implements xl7::io::IRom.
| bool xl7::io::File::Open | ( | const OpenFlags | flags | ) | [virtual] |
Re-opens the file for reading or writing. Ensure that you have already opened the file earlier (see Open).
Implements xl7::io::IFile.
| bool xl7::io::File::Open | ( | const cl7::string_type & | file_name | ) |
Opens the file for reading.
| bool xl7::io::File::Open | ( | const cl7::string_type & | file_name, | |
| const OpenFlags | flags | |||
| ) |
Opens the file for reading or writing.
| bool xl7::io::File::Open | ( | ) | [virtual] |
Re-opens the file for reading. Ensure that you have already opened the file earlier (see Open).
Implements xl7::io::IRom.
| unsigned xl7::io::File::Read | ( | void * | buffer, | |
| unsigned | bytes | |||
| ) | [virtual] |
Reads data from the file and returns the number of bytes read.
Implements xl7::io::IRom.
| unsigned xl7::io::File::Seek | ( | signed | bytes, | |
| const SeekFlags | from = current | |||
| ) | [virtual] |
Resets the current byte position to read or write data by moving the pointer by the specified bytes. The function returns the new position.
Implements xl7::io::IRom.
| unsigned xl7::io::File::SetPointer | ( | unsigned | pointer | ) | [virtual] |
Resets the current byte position to read or write data. The function returns the new position.
Resets the current position to read or write data. The function returns the new position.
Implements xl7::io::IRom.
| bool xl7::io::File::SetSize | ( | unsigned | size | ) | [virtual] |
Sets the size of the file, in bytes. Truncates or appends the difference in bytes.
Implements xl7::io::IFile.
| unsigned xl7::io::File::Write | ( | const void * | buffer, | |
| unsigned | bytes | |||
| ) | [virtual] |
Writes data to the file and returns the number of bytes written.
Implements xl7::io::IFile.
1.7.1