Cuberite
A lightweight, fast and extensible game server for Minecraft
|
#include <OverridesSettingsRepository.h>
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... | |
cOverridesSettingsRepository (std::unique_ptr< cSettingsRepositoryInterface > a_Main, cSettingsRepositoryInterface &a_Overrides) | |
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... | |
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 |
virtual | ~cOverridesSettingsRepository () override=default |
Public Member Functions inherited from cSettingsRepositoryInterface | |
cSettingsRepositoryInterface ()=default | |
DISALLOW_COPY_AND_ASSIGN (cSettingsRepositoryInterface) | |
virtual | ~cSettingsRepositoryInterface ()=default |
Private Attributes | |
std::unique_ptr< cSettingsRepositoryInterface > | m_Main |
cSettingsRepositoryInterface * | m_Overrides |
Additional Inherited Members | |
Public Types inherited from cSettingsRepositoryInterface | |
enum | errors { noID = -1 } |
Definition at line 6 of file OverridesSettingsRepository.h.
cOverridesSettingsRepository::cOverridesSettingsRepository | ( | std::unique_ptr< cSettingsRepositoryInterface > | a_Main, |
cSettingsRepositoryInterface & | a_Overrides | ||
) |
Definition at line 5 of file OverridesSettingsRepository.cpp.
|
overridevirtualdefault |
|
overridevirtual |
Add a key comment, will always fail if the repository does not support comments.
Implements cSettingsRepositoryInterface.
Definition at line 49 of file OverridesSettingsRepository.cpp.
|
overridevirtual |
Add a key name.
Return value is not required to mean anything
Implements cSettingsRepositoryInterface.
Definition at line 33 of file OverridesSettingsRepository.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 92 of file OverridesSettingsRepository.cpp.
|
overridevirtual |
Delete a key comment, will always fail if the repository does not support comments.
Implements cSettingsRepositoryInterface.
Definition at line 78 of file OverridesSettingsRepository.cpp.
|
overridevirtual |
Deletes the specified key, value pair.
Implements cSettingsRepositoryInterface.
Definition at line 250 of file OverridesSettingsRepository.cpp.
|
overridevirtual |
Writes the changes to the backing store, if the repository has one.
Implements cSettingsRepositoryInterface.
Definition at line 266 of file OverridesSettingsRepository.cpp.
|
overridevirtual |
Return a key comment, returns "" for repositories that do not return comments.
Implements cSettingsRepositoryInterface.
Definition at line 63 of file OverridesSettingsRepository.cpp.
|
overridevirtual |
Get the value at the specified key and value, returns defValue on failure.
Implements cSettingsRepositoryInterface.
Definition at line 138 of file OverridesSettingsRepository.cpp.
|
overridevirtual |
returns a vector containing a name, value pair for each value under the key
Implements cSettingsRepositoryInterface.
Definition at line 108 of file OverridesSettingsRepository.cpp.
|
overridevirtual |
Gets the value; if not found, write the default to the repository.
Implements cSettingsRepositoryInterface.
Definition at line 154 of file OverridesSettingsRepository.cpp.
|
overridevirtual |
Implements cSettingsRepositoryInterface.
Definition at line 202 of file OverridesSettingsRepository.cpp.
|
overridevirtual |
Implements cSettingsRepositoryInterface.
Definition at line 170 of file OverridesSettingsRepository.cpp.
|
overridevirtual |
Implements cSettingsRepositoryInterface.
Definition at line 186 of file OverridesSettingsRepository.cpp.
|
overridevirtual |
Returns true iff the specified value exists.
Implements cSettingsRepositoryInterface.
Definition at line 24 of file OverridesSettingsRepository.cpp.
|
overridevirtual |
Returns true iff the specified key exists.
Implements cSettingsRepositoryInterface.
Definition at line 15 of file OverridesSettingsRepository.cpp.
|
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 218 of file OverridesSettingsRepository.cpp.
|
overridevirtual |
Implements cSettingsRepositoryInterface.
Definition at line 234 of file OverridesSettingsRepository.cpp.
|
private |
Definition at line 46 of file OverridesSettingsRepository.h.
|
private |
Definition at line 47 of file OverridesSettingsRepository.h.