|
ArWritableAsset implementation for asset represented by a file on a filesystem. More...
#include <filesystemWritableAsset.h>
Public Member Functions | |
AR_API | ArFilesystemWritableAsset (TfSafeOutputFile &&file) |
Constructs an ArFilesystemWritableAsset for the given file . | |
virtual AR_API bool | Close () override |
Closes the file owned by this asset. | |
virtual AR_API size_t | Write (const void *buffer, size_t count, size_t offset) override |
Writes count bytes from buffer at offset from the beginning of the file held by this object. | |
Public Member Functions inherited from ArWritableAsset | |
ArWritableAsset (const ArWritableAsset &)=delete | |
ArWritableAsset & | operator= (const ArWritableAsset &)=delete |
virtual bool | Close ()=0 |
Close this asset, performing any necessary finalization or commits of data that was previously written. | |
virtual size_t | Write (const void *buffer, size_t count, size_t offset)=0 |
Writes count bytes from buffer at offset from the beginning of the asset. | |
Static Public Member Functions | |
static AR_API std::shared_ptr< ArFilesystemWritableAsset > | Create (const ArResolvedPath &resolvedPath, ArResolver::WriteMode writeMode) |
Constructs a new ArFilesystemWritableAsset for the file at resolvedPath with the given writeMode . | |
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 29 of file filesystemWritableAsset.h.
|
explicit |
Constructs an ArFilesystemWritableAsset for the given file
.
The ArFilesystemWritableAsset takes ownership of file
.
|
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 |
Constructs a new ArFilesystemWritableAsset for the file at resolvedPath
with the given writeMode
.
Returns a null pointer if the file could not be opened.
|
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.