diff options
author | tycho <tycho@localhost> | 2015-05-14 16:47:51 +0200 |
---|---|---|
committer | tycho <work.tycho@gmail.com> | 2015-05-16 11:46:51 +0200 |
commit | b9efa02c80b54e044326771bbffdddf206daef2e (patch) | |
tree | ab615f16b3c46b107f1df0e180c835300dbd19b7 /src/SettingsRepositoryInterface.h | |
parent | Added TCLAP (diff) | |
download | cuberite-b9efa02c80b54e044326771bbffdddf206daef2e.tar cuberite-b9efa02c80b54e044326771bbffdddf206daef2e.tar.gz cuberite-b9efa02c80b54e044326771bbffdddf206daef2e.tar.bz2 cuberite-b9efa02c80b54e044326771bbffdddf206daef2e.tar.lz cuberite-b9efa02c80b54e044326771bbffdddf206daef2e.tar.xz cuberite-b9efa02c80b54e044326771bbffdddf206daef2e.tar.zst cuberite-b9efa02c80b54e044326771bbffdddf206daef2e.zip |
Diffstat (limited to 'src/SettingsRepositoryInterface.h')
-rw-r--r-- | src/SettingsRepositoryInterface.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/SettingsRepositoryInterface.h b/src/SettingsRepositoryInterface.h new file mode 100644 index 000000000..775a0be47 --- /dev/null +++ b/src/SettingsRepositoryInterface.h @@ -0,0 +1,46 @@ + +#pragma once + +class cSettingsRepositoryInterface +{ +public: + + enum errors + { + noID = -1, + }; + + virtual ~cSettingsRepositoryInterface() = default; + + virtual bool KeyExists(const AString keyname) const = 0; + + virtual bool HasValue(const AString & a_KeyName, const AString & a_ValueName) const = 0; + + virtual int AddKeyName(const AString & keyname) = 0; + + virtual bool AddKeyComment(const AString & keyname, const AString & comment) = 0; + + virtual AString GetKeyComment(const AString & keyname, const int commentID) const = 0; + + virtual bool DeleteKeyComment(const AString & keyname, const int commentID) = 0; + + virtual void AddValue (const AString & a_KeyName, const AString & a_ValueName, const AString & a_Value) = 0; + + virtual std::vector<std::pair<AString, AString>> GetValues(AString a_keyName) = 0; + + virtual AString GetValue (const AString & keyname, const AString & valuename, const AString & defValue = "") const = 0; + + virtual AString GetValueSet (const AString & keyname, const AString & valuename, const AString & defValue = "") = 0; + virtual int GetValueSetI(const AString & keyname, const AString & valuename, const int defValue = 0) = 0; + virtual Int64 GetValueSetI(const AString & keyname, const AString & valuename, const Int64 defValue = 0) = 0; + virtual bool GetValueSetB(const AString & keyname, const AString & valuename, const bool defValue = false) = 0; + + virtual bool SetValue (const AString & a_KeyName, const AString & a_ValueName, const AString & a_Value, const bool a_CreateIfNotExists = true) = 0; + virtual bool SetValueI(const AString & a_KeyName, const AString & a_ValueName, const int a_Value, const bool a_CreateIfNotExists = true) = 0; + + + virtual bool DeleteValue(const AString & keyname, const AString & valuename) = 0; + + + virtual bool Flush() = 0; +}; |