blob: 988bb26bc168dccb34f35bf92b38bc9f4896eb66 (
plain)
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
70
71
72
73
74
|
#pragma once
#include <string>
#include <vector>
#include <deque>
#include <utility>
#include <map>
class PointerList
: public std::deque<std::string>
{
public:
PointerList() = default;
PointerList(int argc, const char* const argv[]);
std::pair<int, const char* const*> get();
private:
std::vector<const char*> argptrs;
};
class EnvMap
{
public:
EnvMap() = default;
EnvMap(const char* const env[]);
EnvMap(const char* env);
std::string operator[](const std::string& key) const;
void clear();
void insert(std::string_view key_value);
void insert(const std::pair<std::string_view, std::string_view>& item);
bool contains(std::string_view key) const;
std::size_t size() const;
std::string stringify() const;
std::pair<int, const char* const*> get();
private:
std::map<std::string, std::string> data{};
PointerList pointerlist;
};
|