A CacheLocalStore implemented on the local filesystem.
More...
#include <Cache.h>
|
std::error_code | mErrorCode |
| Store the last error code.
|
|
std::filesystem::path | mRootPath |
| Store the filesystem path to the cache storage.
|
|
A CacheLocalStore implemented on the local filesystem.
◆ CacheFileSystem() [1/3]
rose::CacheFileSystem::CacheFileSystem |
( |
std::filesystem::path |
rootPath | ) |
|
|
explicit |
Constructor.
- Parameters
-
rootPath | The root path of the filesystem cache tree. |
◆ CacheFileSystem() [2/3]
rose::CacheFileSystem::CacheFileSystem |
( |
const std::string & |
rootPath | ) |
|
|
inlineexplicit |
Constructor.
- Parameters
-
rootPath | The root path of the filesystem cache tree. |
◆ CacheFileSystem() [3/3]
rose::CacheFileSystem::CacheFileSystem |
( |
const std::filesystem::path & |
rootPath, |
|
|
const std::string & |
cacheName |
|
) |
| |
|
inline |
Constructor.
- Parameters
-
rootPath | The root path to all application related filesystem cache. |
cacheName | The specific cache name, will be a directory under rootPath. |
◆ create()
Create an item on a Cache.
- Parameters
-
object | The cache object to be created. |
- Returns
- A CacheError code.
Implements rose::CacheLocalStore.
◆ fileSystemName()
std::optional< std::string > rose::CacheFileSystem::fileSystemName |
( |
const CacheObject & |
object | ) |
const |
|
overridevirtual |
Get a filesystem name locator for the object, if available.
- Returns
- A std::optional<std::string>
Reimplemented from rose::CacheLocalStore.
◆ find()
bool rose::CacheFileSystem::find |
( |
const CacheObject & |
object | ) |
|
|
overridevirtual |
Find an item on a Cache.
- Parameters
-
object | The cache object to be found. |
- Returns
- A CacheError code.
Implements rose::CacheLocalStore.
◆ moveFromTemp()
void rose::CacheFileSystem::moveFromTemp |
( |
const CacheObject & |
object | ) |
|
|
overridevirtual |
Move object from temporary cache location to permanent cache location.
- Parameters
-
object | The object to move. |
Implements rose::CacheLocalStore.
◆ openRead()
std::ifstream rose::CacheFileSystem::openRead |
( |
const CacheObject & |
object | ) |
|
|
overridevirtual |
◆ openWrite()
std::ofstream rose::CacheFileSystem::openWrite |
( |
const CacheObject & |
object, |
|
|
bool |
temp |
|
) |
| |
|
overridevirtual |
◆ operator bool()
rose::CacheFileSystem::operator bool |
( |
| ) |
const |
|
inlineexplicitnoexcept |
Return false if mErrorCode is zero.
- Returns
- true if there is an error code, false otherwise.
◆ removeTemp()
void rose::CacheFileSystem::removeTemp |
( |
const CacheObject & |
object | ) |
|
|
overridevirtual |
Remove a temporary cache location.
This is used when an attempt to update a cached object either failed, or did not result in new data.
- Parameters
-
object | The object to remove. |
Implements rose::CacheLocalStore.
◆ rootPath()
const std::filesystem::path& rose::CacheFileSystem::rootPath |
( |
| ) |
const |
|
inline |
Accessor for cache root path.
- Returns
- The filesystem path to the cache.
The documentation for this class was generated from the following files: