forked from AndreyG/libgit2cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.h
More file actions
41 lines (30 loc) · 865 Bytes
/
Copy pathconfig.h
File metadata and controls
41 lines (30 loc) · 865 Bytes
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
#pragma once
#include <string>
struct git_config;
namespace git
{
struct Config
{
explicit Config(std::string const & filename);
~Config();
struct no_such_key_error : std::exception
{
explicit no_such_key_error(std::string key)
: key_(std::move(key))
{}
virtual const char * what() const noexcept override
{
return "no such key in config";
}
std::string const & key() const { return key_; }
private:
std::string key_;
};
std::string operator[] (const char * key) const;
int get_int(const char * key) const;
Config (Config const &) = delete;
Config& operator = (Config const &) = delete;
private:
git_config * cfg_;
};
}