summaryrefslogtreecommitdiffstats
path: root/src/SettingsRepositoryInterface.h
blob: 775a0be47eb3ae974a4af716c82dfa061ae6f144 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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;
};