23 #ifndef INCLUDE_AR_FILESYSTEM_ASSET
24 #error This file should not be included directly. Include filesystemAsset.h instead.
27 #ifndef PXR_USD_AR_FILESYSTEM_ASSET_V1_H
28 #define PXR_USD_AR_FILESYSTEM_ASSET_V1_H
33 #include "pxr/usd/ar/api.h"
40 PXR_NAMESPACE_OPEN_SCOPE
54 static std::shared_ptr<ArFilesystemAsset>
Open(
69 virtual size_t GetSize()
override;
74 virtual std::shared_ptr<const char>
GetBuffer()
override;
79 virtual size_t Read(
void* buffer,
size_t count,
size_t offset)
override;
91 PXR_NAMESPACE_CLOSE_SCOPE
93 #endif // PXR_USD_AR_FILESYSTEM_ASSET_V1_H
Interface for accessing the contents of an asset.
virtual AR_API size_t GetSize() override
Returns the size of the file held by this object.
AR_API ~ArFilesystemAsset()
Closes the file owned by this object.
ArAsset implementation for asset represented by a file on a filesystem.
virtual AR_API std::pair< FILE *, size_t > GetFileUnsafe() override
Returns the FILE* handle this object was created with and an offset of 0, since the asset's contents ...
static AR_API std::shared_ptr< ArFilesystemAsset > Open(const ArResolvedPath &resolvedPath)
Constructs a new ArFilesystemAsset for the file at resolvedPath.
virtual AR_API std::shared_ptr< const char > GetBuffer() override
Creates a read-only memory map for the file held by this object and returns a pointer to the start of...
Represents a resolved asset path.
AR_API ArFilesystemAsset(FILE *file)
Constructs an ArFilesystemAsset for the given file.
virtual AR_API size_t Read(void *buffer, size_t count, size_t offset) override
Reads count bytes from the file held by this object at the given offset into buffer.