6 #ifndef PXR_USD_AR_IN_MEMORY_ASSET_H
7 #define PXR_USD_AR_IN_MEMORY_ASSET_H
33 static std::shared_ptr<ArInMemoryAsset>
FromAsset(
39 static std::shared_ptr<ArInMemoryAsset>
FromBuffer(
40 const std::shared_ptr<const char>&
buffer,
46 static std::shared_ptr<ArInMemoryAsset>
FromBuffer(
47 std::shared_ptr<const char>&& buffer,
57 size_t GetSize()
const override;
61 std::shared_ptr<const char>
GetBuffer()
const override;
78 struct PrivateCtorTag {};
82 template <
class BufferSharedPtr>
84 BufferSharedPtr&& buffer,
89 std::shared_ptr<const char> _buffer;
AR_API std::shared_ptr< ArAsset > GetDetachedAsset() const override
AR_API size_t GetSize() const override
Returns the size of the buffer managed by this object.
AR_API std::pair< FILE *, size_t > GetFileUnsafe() const override
Returns { nullptr, 0 } as this object is not associated with a file.
static AR_API std::shared_ptr< ArInMemoryAsset > FromAsset(const ArAsset &srcAsset)
static AR_API std::shared_ptr< ArInMemoryAsset > FromBuffer(const std::shared_ptr< const char > &buffer, size_t bufferSize)
AR_API ~ArInMemoryAsset()
AR_API size_t Read(void *buffer, size_t count, size_t offset) const override
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
AR_API std::shared_ptr< const char > GetBuffer() const override
Returns the buffer managed by this object.
#define PXR_NAMESPACE_CLOSE_SCOPE
ArInMemoryAsset(BufferSharedPtr &&buffer, size_t bufferSize, PrivateCtorTag)