Essential Kit
Loading...
Searching...
No Matches
KeyValueDataStore

Object represents a container to store key-value pairs.

Public Member Functions

 KeyValueDataStore (string savePath)
 Create a new instance.
 
bool GetBool (string key, bool defaultValue=default)
 Returns the boolean value associated with the specified key.
 
long GetLong (string key, long defaultValue=default)
 Returns the long value associated with the specified key.
 
double GetDouble (string key, double defaultValue=default)
 Returns the double value associated with the specified key.
 
string GetString (string key, string defaultValue=default)
 Returns the string value associated with the specified key.
 
byte[] GetByteArray (string key, byte[] defaultValue=default)
 Returns the byte array object associated with the specified key.

 
IDictionary GetSnapshot ()
 Returns the complete snapshot of data.

 
void SetBool (string key, bool value)
 Sets a boolean value for the specified key in the data store.
 
void SetLong (string key, long value)
 Sets a long value for the specified key in the data store.
 
void SetDouble (string key, double value)
 Sets a double value for the specified key in the data store.
 
void SetString (string key, string value)
 Sets a string value for the specified key in the data store.
 
void SetByteArray (string key, byte[] value)
 Sets a byte array value for the specified key in the data store.
 
void Synchronize ()
 Explicitly synchronizes in-memory data with those stored on disk.
 
void Clear ()
 Removes all the entries from the data store.
 
bool RemoveKey (string key)
 Removes the value associated with the specified key from the data store.
 

Constructor & Destructor Documentation

◆ KeyValueDataStore()

KeyValueDataStore ( string savePath)
Parameters
savePathThe file path to save contents.

Member Function Documentation

◆ GetBool()

bool GetBool ( string key,
bool defaultValue = default )
Parameters
keyA string used to identify the value stored in the data store.
defaultValueDefault value.
Returns

◆ GetLong()

long GetLong ( string key,
long defaultValue = default )
Parameters
keyA string used to identify the value stored in the data store.
defaultValueDefault value.
Returns

◆ GetDouble()

double GetDouble ( string key,
double defaultValue = default )
Parameters
keyA string used to identify the value stored in the data store.
defaultValueDefault value.
Returns

◆ GetString()

string GetString ( string key,
string defaultValue = default )
Parameters
keyA string used to identify the value stored in the data store.
defaultValueDefault value.
Returns

◆ GetByteArray()

byte[] GetByteArray ( string key,
byte[] defaultValue = default )
Parameters
keyA string used to identify the value stored in the data store.
defaultValueDefault value.
Returns

◆ GetSnapshot()

IDictionary GetSnapshot ( )
Returns
Returns IDictionary with snapshot data

◆ SetBool()

void SetBool ( string key,
bool value )
Parameters
keyThe key under which to store the value.
valueThe boolean value to store.

Referenced by CloudServices.SetBool().

◆ SetLong()

void SetLong ( string key,
long value )
Parameters
keyThe key under which to store the value.
valueThe long value to store.

Referenced by CloudServices.SetLong().

◆ SetDouble()

void SetDouble ( string key,
double value )
Parameters
keyThe key under which to store the value.
valueThe double value to store.

Referenced by CloudServices.SetDouble().

◆ SetString()

void SetString ( string key,
string value )
Parameters
keyThe key under which to store the value.
valueThe string value to store.

Referenced by CloudServices.SetString().

◆ SetByteArray()

void SetByteArray ( string key,
byte[] value )
Parameters
keyThe key under which to store the value.
valueThe long value to store.

Referenced by CloudServices.SetByteArray().

◆ RemoveKey()

bool RemoveKey ( string key)
Parameters
keyThe key corresponding to the value you want to remove.

Referenced by CloudServices.RemoveKey().