ulib
1.0
S.W. Lee's essential C++ library
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Macros
Pages
include
ujson.h
Go to the documentation of this file.
1
/*
2
작성자 : swlee
3
작성일 : Apr. 4, 2013
4
버전 : 0.1.0
5
설명 :
6
미구현 :
7
버그 :
8
*/
9
10
#ifndef ___ujson___
11
#define ___ujson___
12
13
#include <stdio.h>
14
#include <string.h>
15
#include <time.h>
16
#include "
uparser.h
"
17
#include "
ustring.h
"
18
19
20
namespace
ulib {
21
22
class
CUJsonContainer;
23
class
CUJsonItem
{
24
public
:
25
26
CUString
key
;
27
CUString
value
;
28
CUJsonContainer
*
value2
;
29
30
CUJsonItem
() {
31
value2
= NULL;
32
}
33
};
34
typedef
map<string, CUJsonItem>
item_map_t
;
35
class
CUJsonContainer
{
36
public
:
37
CUString
name
;
38
item_map_t
item_map
;
39
};
40
41
42
class
CUJsonToken
{
43
public
:
44
CUString
lexical
;
45
CUString
type
;
46
int
match_idx
;
47
bool
consumed
;
48
49
CUJsonToken
()
50
{
51
match_idx
=-1;
52
consumed
=
false
;
53
}
54
};
55
56
58
class
CUJsonTokenList
:
public
CUList
{
59
public
:
60
void
PushBack
(
CUString
str );
61
CUJsonToken
*
GetAt
(
int
i );
62
void
Print
();
63
};
64
65
67
class
CUJson
:
public
CUParser
{
68
public
:
69
CUJson
();
70
~CUJson
();
71
public
:
72
73
virtual
bool
Load
(
CUString
&
str
);
74
virtual
bool
ToString
(
CUString
&ret );
75
76
bool
Tokenize
();
77
bool
MatchBrace
(
int
start_idx,
int
end_idx );
78
bool
Parse
(
int
start_idx,
int
end_idx );
79
80
public
:
81
CUString
str
;
82
CUJsonTokenList
token_list
;
83
CUJsonContainer
container
;
84
85
private
:
86
void
Preproc();
87
int
FindMatchBraceIdx(
int
start_idx,
int
end_idx,
int
pos );
88
int
FindMatchCurlBraceIdx(
int
start_idx,
int
end_idx,
int
pos );
89
90
private
:
91
92
93
};
94
95
}
96
97
#endif
98
99
// EOF ㅁ
100
Generated on Sat Apr 6 2013 15:15:05 for ulib by
1.8.1.2