-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjson.h
48 lines (38 loc) · 1.01 KB
/
json.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
46
47
48
// name: json.h
// version: 1.0
// description: json parsing
// ensure declarations only occur once
#ifndef JSON_H
#define JSON_H
// libraries
#include <string>
// json parsing class
class json {
public:
// constructors
json();
json(char *raw);
// operators
void operator=(char *raw);
// parsing
template<class type>
type parse(char *data);
// stringify
std::string stringify(bool data);
std::string stringify(short int data);
std::string stringify(unsigned short int data);
std::string stringify(int data);
std::string stringify(long int data);
std::string stringify(long long int data);
std::string stringify(unsigned int data);
std::string stringify(unsigned long int data);
std::string stringify(unsigned long long int data);
std::string stringify(double data);
std::string stringify(long double data);
std::string stringify(float data);
std::string stringify(char *data);
private:
// local data
std::string storage;
};
#endif