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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#pragma once
#include <string>
#include <vector>
#include <memory>
namespace TestProject {
/**
* @brief Storage backend interface
*
* Pure virtual interface for storage implementations.
*/
class IStorageBackend {
public:
/**
* @brief Virtual destructor for proper cleanup
*/
virtual ~IStorageBackend() = default;
/**
* @brief Store a key-value pair
* @param key The key to store
* @param value The value to associate with the key
* @return true if successful, false otherwise
*/
virtual bool store(const std::string& key, const std::string& value) = 0;
/**
* @brief Retrieve a value by key
* @param key The key to look up
* @return The associated value, or empty string if not found
*/
virtual std::string retrieve(const std::string& key) const = 0;
/**
* @brief Remove a key-value pair
* @param key The key to remove
* @return true if the key was found and removed, false otherwise
*/
virtual bool remove(const std::string& key) = 0;
/**
* @brief List all stored keys
* @return Vector of all keys in the storage
*/
virtual std::vector<std::string> listKeys() const = 0;
/**
* @brief Clear all stored data
*/
virtual void clear() = 0;
/**
* @brief Get the backend type name
* @return String identifying the backend type
*/
virtual std::string getBackendType() const = 0;
#ifdef ENABLE_DEBUG_LOGGING
/**
* @brief Debug method - only available when debug logging is enabled
* @return Debug information about the storage state
*/
virtual std::string getDebugInfo() const = 0;
#endif
};
} // namespace TestProject