-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.cpp
More file actions
33 lines (23 loc) · 736 Bytes
/
Copy pathtest.cpp
File metadata and controls
33 lines (23 loc) · 736 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
#include "iniFile.h"
#include "value.h"
using namespace louis::value;
using namespace louis::ini;
int main(int argc, char const* argv[]) {
IniFile ini;
ini.load("./main.ini");
// const string& ip = ini.get("server", "ip");
// int port = ini.get("server", "port");
const string& ip = ini["server"]["ip"];
int port = ini["server"]["port"];
ini.set("server", "flag", true);
ini.set("server", "timeout", 1000);
ini["server"]["flag"] = false;
ini["server"]["timeout"] = 2000;
bool flag1 = ini.has("server");
bool flag2 = ini.has("serve");
bool flag3 = ini.has("server", "ip");
bool flag4 = ini.has("server", "ipp");
ini.show();
ini.save("./tmp.ini");
return 0;
}