ArAsset implementation that stores asset content in a heap-allocated buffer managed by this object.
More...
|
| AR_API | ~ArInMemoryAsset () |
| | Destructor. More...
|
| |
| AR_API size_t | GetSize () const override |
| | Returns the size of the buffer managed by this object. More...
|
| |
| AR_API std::shared_ptr< const char > | GetBuffer () const override |
| | Returns the buffer managed by this object. More...
|
| |
| AR_API size_t | Read (void *buffer, size_t count, size_t offset) const override |
| | Reads count bytes from the buffer held by this object at the given offset into buffer. More...
|
| |
| AR_API std::pair< FILE *, size_t > | GetFileUnsafe () const override |
| | Returns { nullptr, 0 } as this object is not associated with a file. More...
|
| |
| AR_API std::shared_ptr< ArAsset > | GetDetachedAsset () const override |
| | Returns a new ArInMemoryAsset instance that shares the same buffer as this object. More...
|
| |
|
template<class BufferSharedPtr > |
| | ArInMemoryAsset (BufferSharedPtr &&buffer, size_t bufferSize, PrivateCtorTag) |
| |
|
| ArAsset (const ArAsset &)=delete |
| |
|
ArAsset & | operator= (const ArAsset &)=delete |
| |
|
| static AR_API std::shared_ptr< ArInMemoryAsset > | FromAsset (const ArAsset &srcAsset) |
| | Constructs a new instance containing the entire contents of srcAsset. More...
|
| |
| static AR_API std::shared_ptr< ArInMemoryAsset > | FromBuffer (const std::shared_ptr< const char > &buffer, size_t bufferSize) |
| | Constructs a new instance sharing ownership of the given buffer containing bufferSize bytes. More...
|
| |
| static AR_API std::shared_ptr< ArInMemoryAsset > | FromBuffer (std::shared_ptr< const char > &&buffer, size_t bufferSize) |
| | Constructs a new instance taking ownership of the given buffer containing bufferSize bytes. More...
|
| |
ArAsset implementation that stores asset content in a heap-allocated buffer managed by this object.
Definition at line 40 of file inMemoryAsset.h.
◆ ~ArInMemoryAsset()
Destructor.
Note that this may not destroy the associated buffer if a client is holding on to the result of GetBuffer().
◆ FromAsset()
Constructs a new instance containing the entire contents of srcAsset.
Returns nullptr if a buffer large enough to hold srcAsset's contents cannot be allocated or if an error occurs when reading srcAsset's contents into the buffer.
◆ FromBuffer() [1/2]
| static AR_API std::shared_ptr<ArInMemoryAsset> FromBuffer |
( |
const std::shared_ptr< const char > & |
buffer, |
|
|
size_t |
bufferSize |
|
) |
| |
|
static |
Constructs a new instance sharing ownership of the given buffer containing bufferSize bytes.
◆ FromBuffer() [2/2]
| static AR_API std::shared_ptr<ArInMemoryAsset> FromBuffer |
( |
std::shared_ptr< const char > && |
buffer, |
|
|
size_t |
bufferSize |
|
) |
| |
|
static |
Constructs a new instance taking ownership of the given buffer containing bufferSize bytes.
◆ GetBuffer()
| AR_API std::shared_ptr<const char> GetBuffer |
( |
| ) |
const |
|
overridevirtual |
Returns the buffer managed by this object.
Implements ArAsset.
◆ GetDetachedAsset()
| AR_API std::shared_ptr<ArAsset> GetDetachedAsset |
( |
| ) |
const |
|
overridevirtual |
Returns a new ArInMemoryAsset instance that shares the same buffer as this object.
Reimplemented from ArAsset.
◆ GetFileUnsafe()
| AR_API std::pair<FILE*, size_t> GetFileUnsafe |
( |
| ) |
const |
|
overridevirtual |
Returns { nullptr, 0 } as this object is not associated with a file.
Implements ArAsset.
◆ GetSize()
| AR_API size_t GetSize |
( |
| ) |
const |
|
overridevirtual |
Returns the size of the buffer managed by this object.
Implements ArAsset.
◆ Read()
| AR_API size_t Read |
( |
void * |
buffer, |
|
|
size_t |
count, |
|
|
size_t |
offset |
|
) |
| const |
|
overridevirtual |
Reads count bytes from the buffer held by this object at the given offset into buffer.
Implements ArAsset.
The documentation for this class was generated from the following file: