All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ArFilesystemAsset Class Reference

ArAsset implementation for asset represented by a file on a filesystem. More...

+ Inheritance diagram for ArFilesystemAsset:

Public Member Functions

AR_API ArFilesystemAsset (FILE *file)
 Constructs an ArFilesystemAsset for the given file. More...
 
AR_API ~ArFilesystemAsset ()
 Closes the file owned by this object. More...
 
virtual AR_API size_t GetSize () override
 Returns the size of the file held by this object. More...
 
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 the mapped contents. More...
 
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. More...
 
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 are located at the beginning of the file. More...
 
- Public Member Functions inherited from ArAsset
 ArAsset (const ArAsset &)=delete
 
ArAssetoperator= (const ArAsset &)=delete
 

Static Public Member Functions

static AR_API std::shared_ptr
< ArFilesystemAsset
Open (const ArResolvedPath &resolvedPath)
 Constructs a new ArFilesystemAsset for the file at resolvedPath. More...
 

Detailed Description

ArAsset implementation for asset represented by a file on a filesystem.

Definition at line 47 of file filesystemAsset_v1.h.

Constructor & Destructor Documentation

AR_API ArFilesystemAsset ( FILE *  file)
explicit

Constructs an ArFilesystemAsset for the given file.

The ArFilesystemAsset object takes ownership of file and will close the file handle on destruction.

AR_API ~ArFilesystemAsset ( )

Closes the file owned by this object.

Member Function Documentation

virtual AR_API std::shared_ptr<const char> GetBuffer ( )
overridevirtual

Creates a read-only memory map for the file held by this object and returns a pointer to the start of the mapped contents.

Implements ArAsset.

virtual AR_API std::pair<FILE*, size_t> GetFileUnsafe ( )
overridevirtual

Returns the FILE* handle this object was created with and an offset of 0, since the asset's contents are located at the beginning of the file.

Implements ArAsset.

virtual AR_API size_t GetSize ( )
overridevirtual

Returns the size of the file held by this object.

Implements ArAsset.

static AR_API std::shared_ptr<ArFilesystemAsset> Open ( const ArResolvedPath resolvedPath)
static

Constructs a new ArFilesystemAsset for the file at resolvedPath.

Returns a null pointer if the file could not be opened.

virtual AR_API size_t Read ( void *  buffer,
size_t  count,
size_t  offset 
)
overridevirtual

Reads count bytes from the file held by this object at the given offset into buffer.

Implements ArAsset.


The documentation for this class was generated from the following file: