-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathJson.hpp
43 lines (33 loc) · 839 Bytes
/
Json.hpp
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
#pragma once
#include <nstd/Variant.hpp>
class Json
{
public:
class Parser
{
public:
Parser();
~Parser();
int getErrorLine() const;
int getErrorColumn() const;
String getErrorString() const;
bool parse(const char* data, Variant& result);
bool parse(const String& data, Variant& result);
private:
class Private;
Private* p;
};
public:
/**
* Strips C/C++ style comments from JSON data without affecting the line in which data is declared.
*
* @param [in] data The JSON data.
* @return The JSON data with stripped comments.
*/
static String stripComments(const String& data);
static bool parse(const char* data, Variant& result);
static bool parse(const String& data, Variant& result);
static String toString(const Variant& data);
private:
class Private;
};