23 #ifndef PXR_USD_AR_IN_MEMORY_ASSET_H
24 #define PXR_USD_AR_IN_MEMORY_ASSET_H
50 static std::shared_ptr<ArInMemoryAsset>
FromAsset(
56 static std::shared_ptr<ArInMemoryAsset>
FromBuffer(
57 const std::shared_ptr<const char>&
buffer,
63 static std::shared_ptr<ArInMemoryAsset>
FromBuffer(
64 std::shared_ptr<const char>&& buffer,
74 size_t GetSize()
const override;
78 std::shared_ptr<const char>
GetBuffer()
const override;
95 struct PrivateCtorTag {};
99 template <
class BufferSharedPtr>
101 BufferSharedPtr&& buffer,
106 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)