#include <utility/YiPersistentStore.h>
| Enumerator |
|---|
| STORE_ERROR_OK |
|
| STORE_ERROR_NOT_FOUND |
|
| STORE_ERROR_CORRUPTED |
|
| STORE_ERROR_NOT_ENOUGH_SPACE |
|
| STORE_ERROR_BAD_PARAMETERS |
|
| STORE_ERROR_UNKNOWN |
|
| CYIPersistentStore::CYIPersistentStore |
( |
uint64_t |
uMaxSizeInBytes = 0 | ) |
|
| virtual CYIPersistentStore::~CYIPersistentStore |
( |
| ) |
|
|
virtual |
template<typename T >
| void CYIPersistentStore::Add |
( |
const CYIString & |
Key, |
|
|
const T & |
value |
|
) |
| |
|
inline |
Add a key-value pair to be saved as application state data. If the provided key already exists in the state data, it is updated with the provided value.
Example: int32_t num = 19; PersistentStore.Add("key", num);
| void CYIPersistentStore::Clear |
( |
| ) |
|
Clear the in-memory state.
| bool CYIPersistentStore::Clear |
( |
const CYIString & |
sFile | ) |
|
template<typename T >
| bool CYIPersistentStore::Find |
( |
const CYIString & |
Key, |
|
|
T * |
value |
|
) |
| const |
|
inline |
Retrieve the value for the specified key from the loaded application state. If the key is found, returns true and value is set to the key's corresponding value. Returns false if the key is not found.
Example:
int32_t num = 19;
if(PersistentStore.Find("key", &num))
{
num will now be set to the key's corresponding value }
| STORE_ERROR CYIPersistentStore::GetLastErrorCode |
( |
| ) |
const |
| bool CYIPersistentStore::Load |
( |
const CYIString & |
sFile | ) |
|
Synchronous - Load the state data from the specified file.
- Note
- This method will replace any existing state data with the state data from the file, including any keys in the state data that do not exist in the file.
| void CYIPersistentStore::Remove |
( |
const CYIString & |
key | ) |
|
Removes the key-value pair entry associated with the key key.
Example: PersistentStore.Remove("key");
| void CYIPersistentStore::RequestLoad |
( |
const CYIString & |
sFile | ) |
|
Asynchronous - Load the state data from the specified file.
- Note
- This method will replace any existing state data with the state data from the file, including any keys in the state data that do not exist in the file.
- See also
- LoadCompleted Signal
| void CYIPersistentStore::RequestSave |
( |
const CYIString & |
sFile | ) |
|
Asynchronous - Save the current state data to the specified file.
- See also
- SaveCompleted Signal
| bool CYIPersistentStore::Save |
( |
const CYIString & |
sFile | ) |
|
Synchronous - Save the current state data to the specified file.
| friend class IYIPersistentStorePriv |
|
friend |
| CYISignal<bool> CYIPersistentStore::LoadCompleted |
Callback for when the Asynchronous RequestLoad completes
| CYISignal<bool> CYIPersistentStore::SaveCompleted |
Callback for when the Asynchronous RequestSave Completes
The documentation for this class was generated from the following file: