-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJsonParser.h
38 lines (32 loc) · 833 Bytes
/
JsonParser.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
#pragma once
enum class Type
{
Int
, Float
, String
, Nothing
};
class JsonParser
{
public:
JsonParser(string fileName);
void Init();
bool StartParsing();
bool GetValue(const string& key, int32& input);
bool GetValue(const string& key, wstring& input);
bool GetValue(const string& key, string& input);
bool GetValue(const string& key, float& input);
private:
void CreateKeyValue(const string& str);
void CheckKeyValue(string key, string value, bool isString);
void InputNumberValue(string key, int32 value);
void InputStringValue(string key, string value);
void InputFloatValue(string key, float value);
private:
string _dircectoryPath = "./";
std::filesystem::path _totalPath;
map<string, int32> _intParser;
map<string, float> _floatParser;
map<string, string> _stringParser;
vector<char> _checkList;
};