CBFSVaultStream (declared in qcbfsvault.h)
The CBFSVaultStream type is returned by some of the CBVault class's methods. All stream types in CBFS Vault share a common API, inherited from Qt's QIODevice class, documented below. As with any class derived from QIODevice, the CBFSVaultStream type's open method must be called before it can be used.
Note that, for brevity, many of the members offered by QIODevice are not documented here; please refer to the Qt documentation for more information.
Whether the stream supports reading.
Whether the stream supports writing.
Gets the current position within the stream.
Gets the length of the stream, in bytes.
Closes the stream. Has no effect if the stream is already closed.
Closed streams can be reopened using the open method.
Forces all data held by the stream's buffers to be written out to storage. Has no effect if the stream is closed.
Opens the stream for use.
bool open(QIODevice::OpenMode mode);
Returns true if the stream is successfully opened in the specified mode; false otherwise.
Reads a sequence of bytes from the stream and advances the current position within the stream by the number of bytes read.
qint64 read(char *data, qint64 maxSize);
Up to maxSize bytes will be read from the stream. Fewer than maxSize bytes may be read if fewer than maxSize bytes are available. The first variant of this method reads the bytes into the buffer pointed to by data and returns the number of bytes read; the second variant returns the bytes as a QByteArray.
If an error occurs, the first variant of this method returns -1; the second variant returns an empty QByteArray.
Reads and returns all bytes available in the stream from the current position onwards.
Sets the current position within the stream.
bool seek(qint64 pos);
Returns true if the seek operation was successful; false otherwise.
Writes a sequence of bytes to the stream and advances the current position within the stream by the number of bytes written.
qint64 write(const char *data, qint64 maxSize);
The first variant of this method writes up to maxSize bytes from the buffer pointed to by data to the stream. The second variant writes data from a zero-terminated string of 8-bit characters to the stream. The third variant writes the contents of byteArray to the stream.
All variants of this method return the number of bytes actually written to the stream, or -1 if an error occurred.