C
QSafeFile Class
class SafeRenderer::QSafeFileThe QSafeFile class reads the data from the file. More...
Header: | #include <QSafeFile> |
Since: | QtSafeRenderer 1.0 |
This class was introduced in QtSafeRenderer 1.0.
Public Types
enum | FileException { FailureToOpen, SeekError, ReadError } |
Public Functions
QSafeFile(const SafeRenderer::qchar *const filenameArg) | |
~QSafeFile() | |
SafeRenderer::quint32 | available() |
void | readData(SafeRenderer::quchar *const bufferArg, const SafeRenderer::quint32 bytes) const |
Member Type Documentation
enum QSafeFile::FileException
This enum describes the exception values in the QSafeFile class.
Constant | Value | Description |
---|---|---|
SafeRenderer::QSafeFile::FailureToOpen | 0 | Could not open the file for reading. |
SafeRenderer::QSafeFile::SeekError | 1 | Seek has failed on the opened file. For example, a filesystem error or file being a pipe may have caused the error. |
SafeRenderer::QSafeFile::ReadError | 2 | The requested number of bytes could not be read from the opened file. |
Member Function Documentation
QSafeFile::QSafeFile(const SafeRenderer::qchar *const filenameArg)
Constructs the safe file object.
Opens the file named filenameArg.
In case of a failure, the following exception will be thrown:
Constant | Description |
---|---|
SafeRenderer::QSafeFile::FailureToOpen | The file could not be opened for reading. |
QSafeFile::~QSafeFile()
Destructs a safe file object.
Closes the file if the file is open.
SafeRenderer::quint32 QSafeFile::available()
Returns the amount of bytes is available in the file.
In case of a failure, the following exception will be thrown:
Constant | Description |
---|---|
SafeRenderer::QSafeFile::SeekError | Seek has failed on the opened file. For example, a filesystem error or file being a pipe may have caused the error. |
void QSafeFile::readData(SafeRenderer::quchar *const bufferArg, const SafeRenderer::quint32 bytes) const
Reads bytes amount of data from the opened file to the bufferArg.
In case of a failure, the following exception will be thrown:
Constant | Description |
---|---|
SafeRenderer::QSafeFile::ReadError | The requested number of bytes could not be read from the opened file or the provided buffer is a NULL pointer. |
Available under certain Qt licenses.
Find out more.