6#ifndef PXR_USD_AR_FILESYSTEM_ASSET_H
7#define PXR_USD_AR_FILESYSTEM_ASSET_H
12#include "pxr/usd/ar/api.h"
20PXR_NAMESPACE_OPEN_SCOPE
34 static std::shared_ptr<ArFilesystemAsset>
Open(
60 virtual std::shared_ptr<const char>
GetBuffer()
const override;
66 void* buffer,
size_t count,
size_t offset)
const override;
78PXR_NAMESPACE_CLOSE_SCOPE
Interface for accessing the contents of an asset.
ArAsset implementation for asset represented by a file on a filesystem.
AR_API ~ArFilesystemAsset()
Closes the file owned by this object.
virtual AR_API size_t GetSize() const override
Returns the size of the file held by this object.
virtual AR_API std::pair< FILE *, size_t > GetFileUnsafe() const 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.
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) const override
Reads count bytes from the file held by this object at the given offset into buffer.
static AR_API ArTimestamp GetModificationTimestamp(const ArResolvedPath &resolvedPath)
Returns an ArTimestamp holding the mtime of the file at resolvedPath.
virtual AR_API std::shared_ptr< const char > GetBuffer() const 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.
Represents a timestamp for an asset.