cpp-reflect
C++ Reflection and Annotations Library
Loading...
Searching...
No Matches
archive.cppm
Go to the documentation of this file.
1
5
6
export
module
reflect:archive
;
7
8
import
std;
9
10
export
import
:any;
11
12
namespace
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
}
refl::any
Definition
any.cppm:13
refl::archive::contains
bool contains(const std::string &path) const
Definition
archive.cppm:33
refl::archive::at
const any & at(const std::string &path) const
Definition
archive.cppm:29
refl::archive::operator[]
any & operator[](const std::string &path)
Definition
archive.cppm:18
refl::archive::at
any & at(const std::string &path)
Definition
archive.cppm:25
refl::archive::archive
archive()=default
reflect
refl
Definition
_types.cppm:13
src
archive.cppm
Generated by
1.13.2