HDK
|
#include <FS_DiskCache.h>
Public Member Functions | |
Accessor () | |
~Accessor () | |
void | clear () |
bool | write (const void *data, exint len) |
Write data to the file. This method can be called multiple times. More... | |
bool | write (const UT_WorkBuffer &buf) |
Convenience methods to write data to the cache. More... | |
exint | bytesWritten () const |
Return the number of bytes written. More... | |
bool | read (UT_WorkBuffer &contents) const |
Read the contents of the stream. More... | |
bool | isValid () const |
Whether the accessor is valid. More... | |
bool | isRead () const |
Whether the accessor was opened as read-only. More... | |
bool | isWrite () const |
Whether the accessor was opened for writing. More... | |
const UT_StringHolder & | filename () const |
Return the full path of the file in the cache. More... | |
void | storeInCache (bool v) |
void | dump () const |
void | dump (UT_JSONWriter &w) const |
Friends | |
class | FS_DiskCache |
| |
The Accessor class is used to access items in the cache. When an accessor is in write-mode, the thread/process will have unique access to the cache item until the Accessor is destructed. Multiple threads/processes can have read-only access to the item.
Definition at line 57 of file FS_DiskCache.h.
|
inline |
Definition at line 60 of file FS_DiskCache.h.
|
inline |
Definition at line 70 of file FS_DiskCache.h.
|
inline |
Return the number of bytes written.
Definition at line 89 of file FS_DiskCache.h.
void FS_DiskCache::Accessor::clear | ( | ) |
Clear the accessor. This will close any file descriptors and release any locks.
void FS_DiskCache::Accessor::dump | ( | ) | const |
void FS_DiskCache::Accessor::dump | ( | UT_JSONWriter & | w | ) | const |
|
inline |
Return the full path of the file in the cache.
Definition at line 104 of file FS_DiskCache.h.
|
inline |
Whether the accessor was opened as read-only.
Definition at line 98 of file FS_DiskCache.h.
|
inline |
Whether the accessor is valid.
Definition at line 95 of file FS_DiskCache.h.
|
inline |
Whether the accessor was opened for writing.
Definition at line 101 of file FS_DiskCache.h.
bool FS_DiskCache::Accessor::read | ( | UT_WorkBuffer & | contents | ) | const |
Read the contents of the stream.
|
inline |
Normally, accessors that write data are counted to the cache storage. This can disable this behaviour.
Definition at line 108 of file FS_DiskCache.h.
Write data to the file. This method can be called multiple times.
|
inline |
Convenience methods to write data to the cache.
Definition at line 85 of file FS_DiskCache.h.
|
friend |
Definition at line 118 of file FS_DiskCache.h.