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

#include <filesystemWritableAsset.h>

+ Inheritance diagram for ArFilesystemWritableAsset:

Public Member Functions

AR_API ArFilesystemWritableAsset (TfSafeOutputFile &&file)
 
virtual AR_API ~ArFilesystemWritableAsset ()
 
virtual AR_API bool Close () override
 
virtual AR_API size_t Write (const void *buffer, size_t count, size_t offset) override
 
- Public Member Functions inherited from ArWritableAsset
virtual AR_API ~ArWritableAsset ()
 
 ArWritableAsset (const ArWritableAsset &)=delete
 
ArWritableAssetoperator= (const ArWritableAsset &)=delete
 

Static Public Member Functions

static AR_API std::shared_ptr
< ArFilesystemWritableAsset
Create (const ArResolvedPath &resolvedPath, ArResolver::WriteMode writeMode)
 

Additional Inherited Members

- Protected Member Functions inherited from ArWritableAsset
AR_API ArWritableAsset ()
 

Detailed Description

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

This implementation uses TfSafeOutputFile; in the case where the asset has been opened for replacement, data will be written to a temporary file which will be renamed over the destination file when this object is destroyed. See documentation for TfSafeOutputFile for more details.

Definition at line 46 of file filesystemWritableAsset.h.

Constructor & Destructor Documentation

AR_API ArFilesystemWritableAsset::ArFilesystemWritableAsset ( TfSafeOutputFile &&  file)
explicit

Constructs an ArFilesystemWritableAsset for the given file. The ArFilesystemWritableAsset takes ownership of file.

virtual AR_API ArFilesystemWritableAsset::~ArFilesystemWritableAsset ( )
virtual

Member Function Documentation

virtual AR_API bool ArFilesystemWritableAsset::Close ( )
overridevirtual

Closes the file owned by this asset. If the TfSafeOutputFile was opened for replacement, the temporary file that was being written to be will be renamed over the destination file.

Implements ArWritableAsset.

static AR_API std::shared_ptr<ArFilesystemWritableAsset> ArFilesystemWritableAsset::Create ( const ArResolvedPath resolvedPath,
ArResolver::WriteMode  writeMode 
)
static

Constructs a new ArFilesystemWritableAsset for the file at resolvedPath with the given writeMode. Returns a null pointer if the file could not be opened.

virtual AR_API size_t ArFilesystemWritableAsset::Write ( const void buffer,
size_t  count,
size_t  offset 
)
overridevirtual

Writes count bytes from buffer at offset from the beginning of the file held by this object. Returns number of bytes written, or 0 on error.

Implements ArWritableAsset.


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