|
1
|
1 #pragma once
|
|
|
2 #include "keyValueIO.h"
|
|
|
3
|
|
|
4 #include <string>
|
|
|
5 #include <map>
|
|
|
6
|
|
|
7 namespace fb2k {
|
|
|
8 class keyValueIOimpl : public keyValueIO {
|
|
|
9 public:
|
|
|
10 fb2k::stringRef get(const char * name) {
|
|
|
11 auto i = m_content.find(name);
|
|
|
12 if (i == m_content.end()) return fb2k::makeString("");
|
|
|
13 return fb2k::makeString(i->second.c_str());
|
|
|
14 }
|
|
|
15 void put(const char * name, const char * value) {
|
|
|
16 m_content[name] = value;
|
|
|
17 }
|
|
|
18 // OVERRIDE ME
|
|
|
19 void commit() {}
|
|
|
20 // OVERRIDE ME
|
|
|
21 void reset() {}
|
|
|
22 // OVERRIDE ME
|
|
|
23 void dismiss(bool bOK) {}
|
|
|
24
|
|
|
25 protected:
|
|
|
26 std::map<std::string, std::string> m_content;
|
|
|
27 };
|
|
|
28 }
|