|
blip
0.1
|
An application asset file. More...
#include <Asset.hpp>
Public Member Functions | |
| ~Asset () | |
| Destructor. More... | |
| size_t | read (byte_t *buf, size_t count) |
| Read raw data from the asset file. More... | |
| off_t | seek (off_t offset, ccxx::SeekMode mode) |
| Seek to a goven offset in the asset file. More... | |
| const byte_t * | getBuffer () |
| If the asset has been read into an in-memory buffer, get a pointer to that buffer. More... | |
| off_t | getLength () |
| Get the length of the asset file, in bytes. More... | |
| off_t | getBytesRemaining () |
| Get the number of bytes remaining to be read from the asset. More... | |
| bool | isAllocated () const |
| Determine if the asset's internal buffer is allocated in ordinary RAM (as opposed to being memory-mapped). More... | |
An application asset file.
See AssetManager for details about enumerating an application's assets.
This class provides a low-level interface for reading raw asset data. For a higher-level interface, use in conjunction with an AssetDataReader, which may also be passed to resource decoder classes such as PNGImageDecoder and WAVAudioDecoder.
| ~Asset | ( | ) |
Destructor.
Closes the asset file and/or deallocates the buffer.
| const byte_t * getBuffer | ( | ) |
If the asset has been read into an in-memory buffer, get a pointer to that buffer.
| IOException | If an I/O error occurs. |
| off_t getBytesRemaining | ( | ) |
Get the number of bytes remaining to be read from the asset.
| off_t getLength | ( | ) |
Get the length of the asset file, in bytes.
| bool isAllocated | ( | ) | const |
Determine if the asset's internal buffer is allocated in ordinary RAM (as opposed to being memory-mapped).
| size_t read | ( | byte_t * | buf, |
| size_t | count | ||
| ) |
Read raw data from the asset file.
| buf | The buffer to read into. |
| count | The number of bytes to read. |
| EOFException | If the end of file is reached. |
| IOException | If an I/O error occurs. |
| off_t seek | ( | off_t | offset, |
| ccxx::SeekMode | mode | ||
| ) |
Seek to a goven offset in the asset file.
| offset | The offset. |
| mode | The seek mode. |
| IOException | If an I/O error occurs. |