yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::app::platform::WasmStorageQuota Class Reference

#include <wasm_storage_quota.h>

Classes

struct  StorageInfo
 
struct  StorageItem
 

Public Member Functions

void GetStorageInfo (std::function< void(const StorageInfo &)> callback)
 
void CompressAndStore (const std::string &key, const std::vector< uint8_t > &data, std::function< void(bool success)> callback)
 
void LoadAndDecompress (const std::string &key, std::function< void(std::vector< uint8_t >)> callback)
 
void EvictOldest (int count, std::function< void(int evicted)> callback)
 
void EvictToTarget (float target_percent, std::function< void(int evicted)> callback)
 
void UpdateAccessTime (const std::string &key)
 
void GetStoredItems (std::function< void(std::vector< StorageItem >)> callback)
 
void DeleteItem (const std::string &key, std::function< void(bool success)> callback)
 
void ClearAll (std::function< void()> callback)
 

Static Public Member Functions

static bool IsSupported ()
 
static WasmStorageQuotaGet ()
 

Static Public Attributes

static constexpr float kDefaultTargetUsage = 70.0f
 
static constexpr float kWarningThreshold = 80.0f
 
static constexpr float kCriticalThreshold = 90.0f
 
static constexpr size_t kMinQuotaBytes = 50 * 1024 * 1024
 

Detailed Description

Definition at line 353 of file wasm_storage_quota.h.

Member Function Documentation

◆ GetStorageInfo()

void yaze::app::platform::WasmStorageQuota::GetStorageInfo ( std::function< void(const StorageInfo &)> callback)
inline

Definition at line 370 of file wasm_storage_quota.h.

◆ CompressAndStore()

void yaze::app::platform::WasmStorageQuota::CompressAndStore ( const std::string & key,
const std::vector< uint8_t > & data,
std::function< void(bool success)> callback )
inline

Definition at line 375 of file wasm_storage_quota.h.

◆ LoadAndDecompress()

void yaze::app::platform::WasmStorageQuota::LoadAndDecompress ( const std::string & key,
std::function< void(std::vector< uint8_t >)> callback )
inline

Definition at line 381 of file wasm_storage_quota.h.

◆ EvictOldest()

void yaze::app::platform::WasmStorageQuota::EvictOldest ( int count,
std::function< void(int evicted)> callback )
inline

Definition at line 386 of file wasm_storage_quota.h.

◆ EvictToTarget()

void yaze::app::platform::WasmStorageQuota::EvictToTarget ( float target_percent,
std::function< void(int evicted)> callback )
inline

Definition at line 390 of file wasm_storage_quota.h.

◆ UpdateAccessTime()

void yaze::app::platform::WasmStorageQuota::UpdateAccessTime ( const std::string & key)
inline

Definition at line 395 of file wasm_storage_quota.h.

◆ GetStoredItems()

void yaze::app::platform::WasmStorageQuota::GetStoredItems ( std::function< void(std::vector< StorageItem >)> callback)
inline

Definition at line 397 of file wasm_storage_quota.h.

◆ DeleteItem()

void yaze::app::platform::WasmStorageQuota::DeleteItem ( const std::string & key,
std::function< void(bool success)> callback )
inline

Definition at line 402 of file wasm_storage_quota.h.

◆ ClearAll()

void yaze::app::platform::WasmStorageQuota::ClearAll ( std::function< void()> callback)
inline

Definition at line 407 of file wasm_storage_quota.h.

◆ IsSupported()

static bool yaze::app::platform::WasmStorageQuota::IsSupported ( )
inlinestatic

Definition at line 409 of file wasm_storage_quota.h.

◆ Get()

static WasmStorageQuota & yaze::app::platform::WasmStorageQuota::Get ( )
inlinestatic

Definition at line 411 of file wasm_storage_quota.h.

Member Data Documentation

◆ kDefaultTargetUsage

constexpr float yaze::app::platform::WasmStorageQuota::kDefaultTargetUsage = 70.0f
staticconstexpr

Definition at line 416 of file wasm_storage_quota.h.

◆ kWarningThreshold

constexpr float yaze::app::platform::WasmStorageQuota::kWarningThreshold = 80.0f
staticconstexpr

Definition at line 417 of file wasm_storage_quota.h.

◆ kCriticalThreshold

constexpr float yaze::app::platform::WasmStorageQuota::kCriticalThreshold = 90.0f
staticconstexpr

Definition at line 418 of file wasm_storage_quota.h.

◆ kMinQuotaBytes

constexpr size_t yaze::app::platform::WasmStorageQuota::kMinQuotaBytes = 50 * 1024 * 1024
staticconstexpr

Definition at line 419 of file wasm_storage_quota.h.


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