-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.cpp
36 lines (35 loc) · 1.06 KB
/
Main.cpp
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
#include "Object.hpp"
#include "Parser.hpp"
#include <iostream>
using namespace std;
using namespace mp;
int main()
{
// copied from my vscode setting
const char *json = R"(
{
"workbench.startupEditor": "newUntitledFile",
"C_Cpp.default.cppStandard": "c++17",
"workbench.iconTheme": "material-icon-theme",
"workbench.colorTheme": [0,1,2,3.5]
}
)";
cout << json;
Parser p;
// try
// {
Object obj = p.parse(json);
cout << endl;
cout << obj["workbench.startupEditor"].get_str() << endl;
cout << obj["C_Cpp.default.cppStandard"].get_str() << endl;
cout << obj["workbench.iconTheme"].get_str() << endl;
cout << obj["workbench.colorTheme"].get_arr()[0].get_i64() << endl;
cout << obj["workbench.colorTheme"].get_arr()[1].get_i64() << endl;
cout << obj["workbench.colorTheme"].get_arr()[2].get_i64() << endl;
cout << obj["workbench.colorTheme"].get_arr()[3].get_f64() << endl;
// }
// catch (std::exception &ex)
// {
// cout << ex.what() << endl;
// }
}