cpp-reflect
C++ Reflection and Annotations Library
Loading...
Searching...
No Matches
archive.cppm
Go to the documentation of this file.
1
5
6export module reflect:archive;
7
8import std;
9
10export import :any;
11
12namespace refl {
13 export class archive {
14 public:
15 archive() = default;
16
17 public:
18 any &operator[](const std::string &path) {
19 if (not data_.contains(path)) {
20 data_.emplace(path, any { });
21 }
22 return data_[path];
23 }
24
25 any &at(const std::string &path) {
26 return data_.at(path);
27 }
28
29 const any &at(const std::string &path) const {
30 return data_.at(path);
31 }
32
33 bool contains(const std::string &path) const {
34 return data_.contains(path);
35 }
36 private:
37 std::map<std::string, any> data_ { };
38 };
39}
bool contains(const std::string &path) const
Definition archive.cppm:33
const any & at(const std::string &path) const
Definition archive.cppm:29
any & operator[](const std::string &path)
Definition archive.cppm:18
any & at(const std::string &path)
Definition archive.cppm:25
archive()=default