Class DownloadLicenseCacheStorage
Download license cache storage
Implements
Inherited Members
Namespace: Pixiv.VroidSdk.Cache.DataModel
Assembly: Pixiv.VroidSdk.dll
Syntax
public sealed class DownloadLicenseCacheStorage : ICacheStorage<CachedDownloadLicenseFile>, IKeyValueStorable<string, CachedDownloadLicenseFile>
Remarks
Deleted from oldest used cache
Properties
CachedData
Cached data
Declaration
public IDictionary<string, CachedDownloadLicenseFile> CachedData { get; }
Property Value
Type | Description |
---|---|
IDictionary<String, CachedDownloadLicenseFile> |
Methods
CleanOldCache(IFileDelete)
Clear old cache
Declaration
public void CleanOldCache(IFileDelete fileDelete)
Parameters
Type | Name | Description |
---|---|---|
IFileDelete | fileDelete | FIle delete module |
Remarks
Clear oldest used cache
GetObject(String)
Get CachedDownloadLicenseFile from cache
Declaration
public CachedDownloadLicenseFile GetObject(string key)
Parameters
Type | Name | Description |
---|---|---|
String | key | Key string |
Returns
Type | Description |
---|---|
CachedDownloadLicenseFile | RetrievedCachedDownloadLicenseFile |
Remarks
Returns null
if cache out, nonexistent
HasValue(String)
Returns if key is cached or not
Declaration
public bool HasValue(string key)
Parameters
Type | Name | Description |
---|---|---|
String | key | Target key string |
Returns
Type | Description |
---|---|
Boolean | Returns |
Load(String, UInt32)
Instantiate DownloadLicenseCacheStorage from cache data file
Declaration
public static DownloadLicenseCacheStorage Load(string storeFilePath, uint maxCacheCount = 10U)
Parameters
Type | Name | Description |
---|---|---|
String | storeFilePath | Cache data file path |
UInt32 | maxCacheCount | Max cache count (Default 10) |
Returns
Type | Description |
---|---|
DownloadLicenseCacheStorage | Download license cache storage |
RemoveKey(String)
Delete CachedDownloadLicenseFile of specified key
Declaration
public bool RemoveKey(string key)
Parameters
Type | Name | Description |
---|---|---|
String | key | Key to be deleted |
Returns
Type | Description |
---|---|
Boolean | Returns |
Save()
Save cache to file system
Declaration
public void Save()
SetValue(String, CachedDownloadLicenseFile)
Cache CachedDownloadLicenseFile as specified key string
Declaration
public void SetValue(string key, CachedDownloadLicenseFile value)
Parameters
Type | Name | Description |
---|---|---|
String | key | Key string |
CachedDownloadLicenseFile | value | CachedDownloadLicenseFile to cache |
Remarks
Key string is any unique key