Cuberite
A lightweight, fast and extensible game server for Minecraft
|
#include <MemorySettingsRepository.h>
Classes | |
struct | sValue |
Public Member Functions | |
virtual bool | AddKeyComment (const AString &keyname, const AString &comment) override |
Add a key comment, will always fail if the repository does not support comments. More... | |
virtual int | AddKeyName (const AString &keyname) override |
Add a key name. More... | |
virtual void | AddValue (const AString &a_KeyName, const AString &a_ValueName, const AString &a_Value) override |
Adds a new value to the specified key. More... | |
void | AddValue (const AString &a_KeyName, const AString &a_ValueName, const bool a_Value) |
void | AddValue (const AString &a_KeyName, const AString &a_ValueName, const Int64 a_Value) |
virtual bool | DeleteKeyComment (const AString &keyname, const int commentID) override |
Delete a key comment, will always fail if the repository does not support comments. More... | |
virtual bool | DeleteValue (const AString &keyname, const AString &valuename) override |
Deletes the specified key, value pair. More... | |
virtual bool | Flush () override |
Writes the changes to the backing store, if the repository has one. More... | |
virtual AString | GetKeyComment (const AString &keyname, const int commentID) const override |
Return a key comment, returns "" for repositories that do not return comments. More... | |
virtual AString | GetValue (const AString &keyname, const AString &valuename, const AString &defValue="") const override |
Get the value at the specified key and value, returns defValue on failure. More... | |
virtual std::vector< std::pair< AString, AString > > | GetValues (AString a_keyName) override |
returns a vector containing a name, value pair for each value under the key More... | |
virtual AString | GetValueSet (const AString &keyname, const AString &valuename, const AString &defValue="") override |
Gets the value; if not found, write the default to the repository. More... | |
virtual bool | GetValueSetB (const AString &keyname, const AString &valuename, const bool defValue=false) override |
virtual int | GetValueSetI (const AString &keyname, const AString &valuename, const int defValue=0) override |
virtual Int64 | GetValueSetI (const AString &keyname, const AString &valuename, const Int64 defValue=0) override |
virtual bool | HasValue (const AString &a_KeyName, const AString &a_ValueName) const override |
Returns true iff the specified value exists. More... | |
virtual bool | KeyExists (const AString keyname) const override |
Returns true iff the specified key exists. More... | |
void | SetReadOnly () |
virtual bool | SetValue (const AString &a_KeyName, const AString &a_ValueName, const AString &a_Value, const bool a_CreateIfNotExists=true) override |
Overwrites the value of the key, value pair Specify the optional parameter as false if you do not want the value created if it doesn't exist. More... | |
virtual bool | SetValueI (const AString &a_KeyName, const AString &a_ValueName, const int a_Value, const bool a_CreateIfNotExists=true) override |
Public Member Functions inherited from cSettingsRepositoryInterface | |
cSettingsRepositoryInterface ()=default | |
DISALLOW_COPY_AND_ASSIGN (cSettingsRepositoryInterface) | |
virtual | ~cSettingsRepositoryInterface ()=default |
Private Attributes | |
std::unordered_map< AString, std::unordered_multimap< AString, sValue > > | m_Map {} |
bool | m_Writable = true |
Additional Inherited Members | |
Public Types inherited from cSettingsRepositoryInterface | |
enum | errors { noID = -1 } |
Definition at line 6 of file MemorySettingsRepository.h.
|
overridevirtual |
Add a key comment, will always fail if the repository does not support comments.
Implements cSettingsRepositoryInterface.
Definition at line 43 of file MemorySettingsRepository.cpp.
|
overridevirtual |
Add a key name.
Return value is not required to mean anything
Implements cSettingsRepositoryInterface.
Definition at line 33 of file MemorySettingsRepository.cpp.
|
overridevirtual |
Adds a new value to the specified key.
If a value of the same name already exists, creates another one
Implements cSettingsRepositoryInterface.
Definition at line 70 of file MemorySettingsRepository.cpp.
void cMemorySettingsRepository::AddValue | ( | const AString & | a_KeyName, |
const AString & | a_ValueName, | ||
const bool | a_Value | ||
) |
Definition at line 94 of file MemorySettingsRepository.cpp.
void cMemorySettingsRepository::AddValue | ( | const AString & | a_KeyName, |
const AString & | a_ValueName, | ||
const Int64 | a_Value | ||
) |
Definition at line 82 of file MemorySettingsRepository.cpp.
|
overridevirtual |
Delete a key comment, will always fail if the repository does not support comments.
Implements cSettingsRepositoryInterface.
Definition at line 61 of file MemorySettingsRepository.cpp.
|
overridevirtual |
Deletes the specified key, value pair.
Implements cSettingsRepositoryInterface.
Definition at line 287 of file MemorySettingsRepository.cpp.
|
overridevirtual |
Writes the changes to the backing store, if the repository has one.
Implements cSettingsRepositoryInterface.
Definition at line 311 of file MemorySettingsRepository.cpp.
|
overridevirtual |
Return a key comment, returns "" for repositories that do not return comments.
Implements cSettingsRepositoryInterface.
Definition at line 52 of file MemorySettingsRepository.cpp.
|
overridevirtual |
Get the value at the specified key and value, returns defValue on failure.
Implements cSettingsRepositoryInterface.
Definition at line 120 of file MemorySettingsRepository.cpp.
|
overridevirtual |
returns a vector containing a name, value pair for each value under the key
Implements cSettingsRepositoryInterface.
Definition at line 106 of file MemorySettingsRepository.cpp.
|
overridevirtual |
Gets the value; if not found, write the default to the repository.
Implements cSettingsRepositoryInterface.
Definition at line 139 of file MemorySettingsRepository.cpp.
|
overridevirtual |
Implements cSettingsRepositoryInterface.
Definition at line 202 of file MemorySettingsRepository.cpp.
|
overridevirtual |
Implements cSettingsRepositoryInterface.
Definition at line 160 of file MemorySettingsRepository.cpp.
|
overridevirtual |
Implements cSettingsRepositoryInterface.
Definition at line 181 of file MemorySettingsRepository.cpp.
|
overridevirtual |
Returns true iff the specified value exists.
Implements cSettingsRepositoryInterface.
Definition at line 18 of file MemorySettingsRepository.cpp.
|
overridevirtual |
Returns true iff the specified key exists.
Implements cSettingsRepositoryInterface.
Definition at line 9 of file MemorySettingsRepository.cpp.
|
inline |
Definition at line 43 of file MemorySettingsRepository.h.
|
overridevirtual |
Overwrites the value of the key, value pair Specify the optional parameter as false if you do not want the value created if it doesn't exist.
Returns true if value set, false otherwise.
Implements cSettingsRepositoryInterface.
Definition at line 223 of file MemorySettingsRepository.cpp.
|
overridevirtual |
Implements cSettingsRepositoryInterface.
Definition at line 255 of file MemorySettingsRepository.cpp.
|
private |
Definition at line 101 of file MemorySettingsRepository.h.
|
private |
Definition at line 50 of file MemorySettingsRepository.h.