-
Notifications
You must be signed in to change notification settings - Fork 22
/
dotenv.h
45 lines (27 loc) · 793 Bytes
/
dotenv.h
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
#pragma once
#include <string>
namespace dotenv
{
class dotenv
{
public:
using key_type = std::string;
using value_type = std::string;
public:
dotenv& load_dotenv(const std::string& dotenv_path = env_filename,
const bool overwrite = false,
const bool interpolate = true);
const value_type operator[](const key_type& k) const;
public:
virtual ~dotenv() = default;
dotenv(const dotenv&) = delete;
void operator=(const dotenv&) = delete;
static dotenv& instance();
private:
dotenv() = default;
private:
static const std::string env_filename;
static dotenv _instance;
};
extern dotenv& env;
}