Wrapper class for stdio's FILE.
More...
#include <file.h>
|
|
typedef QSharedPointer< File > | Ptr |
| |
| enum | SeekPos { BEGIN,
END,
CURRENT
} |
| |
|
| | File () |
| |
| virtual | ~File () |
| |
| void | close () |
| |
|
bool | eof () const |
| | Check to see if we are at the end of the file.
|
| |
|
QString | errorString () const |
| | Get the error string.
|
| |
| void | flush () |
| |
| bool | open (const QString &file, const QString &mode) |
| |
| Uint32 | read (void *buf, Uint32 size) |
| |
| Uint64 | seek (SeekPos from, Int64 num) |
| |
|
Uint64 | tell () const |
| | Get the current position in the file.
|
| |
| Uint32 | write (const void *buf, Uint32 size) |
| |
- Author
- Joris Guisson Wrapper class for stdio's FILE.
Definition at line 55 of file file.h.
◆ File()
◆ ~File()
| virtual bt::File::~File |
( |
| ) |
|
|
virtual |
Destructor, closes the file.
◆ close()
◆ flush()
◆ open()
| bool bt::File::open |
( |
const QString & |
file, |
|
|
const QString & |
mode |
|
) |
| |
Open the file similar to fopen
- Parameters
-
- Returns
- true upon succes
◆ read()
| Uint32 bt::File::read |
( |
void * |
buf, |
|
|
Uint32 |
size |
|
) |
| |
Read a bunch of data. If anything goes wrong an Error will be thrown.
- Parameters
-
| buf | The buffer to store the data |
| size | Size of the buffer |
- Returns
- The number of bytes read
◆ seek()
| Uint64 bt::File::seek |
( |
SeekPos |
from, |
|
|
Int64 |
num |
|
) |
| |
Seek in the file.
- Parameters
-
| from | Position to seek from |
| num | Number of bytes to move |
- Returns
- New position
◆ write()
| Uint32 bt::File::write |
( |
const void * |
buf, |
|
|
Uint32 |
size |
|
) |
| |
Write a bunch of data. If anything goes wrong an Error will be thrown.
- Parameters
-
| buf | The data |
| size | Size of the data |
- Returns
- The number of bytes written
The documentation for this class was generated from the following file: