Webserv
Loading...
Searching...
No Matches
includes
Nodes.hpp
Go to the documentation of this file.
1
#pragma once
2
#include "
webserv.hpp
"
3
4
class
JSONNode
{
5
public
:
6
JSONObject
obj
();
7
JSONList
lst
();
8
string
str
();
9
int
nbr
();
10
bool
boo
();
11
12
private
:
13
enum
Type
{
OBJECT
,
LIST
,
STRING
,
NUMBER
,
BOOLEAN
,
NULL_TYPE
};
14
union
Values
{
15
JSONObject
*
object
;
16
JSONList
*
list
;
17
string
*
str
;
18
int
nbr
;
19
bool
bValue
;
20
}
values
;
21
Type
type
;
22
23
void
setObject
(
JSONObject
*
object
);
24
void
setList
(
JSONList
*list);
25
void
setString
(
string
*
str
);
26
void
setNumber
(
int
nbr
);
27
void
setBoolean
(
bool
v);
28
void
setNull
();
29
30
string
stringify
(
int
indentationLevel);
31
friend
class
JSONParser
;
32
};
JSONNode
Definition:
Nodes.hpp:4
JSONNode::Type
Type
Definition:
Nodes.hpp:13
JSONNode::LIST
@ LIST
Definition:
Nodes.hpp:13
JSONNode::NUMBER
@ NUMBER
Definition:
Nodes.hpp:13
JSONNode::STRING
@ STRING
Definition:
Nodes.hpp:13
JSONNode::BOOLEAN
@ BOOLEAN
Definition:
Nodes.hpp:13
JSONNode::NULL_TYPE
@ NULL_TYPE
Definition:
Nodes.hpp:13
JSONNode::OBJECT
@ OBJECT
Definition:
Nodes.hpp:13
JSONNode::values
union JSONNode::Values values
JSONNode::setObject
void setObject(JSONObject *object)
Definition:
Nodes.cpp:29
JSONNode::type
Type type
Definition:
Nodes.hpp:21
JSONNode::nbr
int nbr()
Definition:
Nodes.cpp:18
JSONNode::setNumber
void setNumber(int nbr)
Definition:
Nodes.cpp:41
JSONNode::obj
JSONObject obj()
Definition:
Nodes.cpp:3
JSONNode::setNull
void setNull()
Definition:
Nodes.cpp:49
JSONNode::setBoolean
void setBoolean(bool v)
Definition:
Nodes.cpp:45
JSONNode::stringify
string stringify(int indentationLevel)
Definition:
Nodes.cpp:51
JSONNode::lst
JSONList lst()
Definition:
Nodes.cpp:8
JSONNode::str
string str()
Definition:
Nodes.cpp:13
JSONNode::setString
void setString(string *str)
Definition:
Nodes.cpp:37
JSONNode::setList
void setList(JSONList *list)
Definition:
Nodes.cpp:33
JSONNode::boo
bool boo()
Definition:
Nodes.cpp:23
JSONParser
Definition:
Parser.hpp:4
JSONNode::Values
Definition:
Nodes.hpp:14
JSONNode::Values::list
JSONList * list
Definition:
Nodes.hpp:16
JSONNode::Values::object
JSONObject * object
Definition:
Nodes.hpp:15
JSONNode::Values::nbr
int nbr
Definition:
Nodes.hpp:18
JSONNode::Values::bValue
bool bValue
Definition:
Nodes.hpp:19
JSONNode::Values::str
string * str
Definition:
Nodes.hpp:17
webserv.hpp
JSONList
std::vector< JSONNode * > JSONList
Definition:
webserv.hpp:49
JSONObject
std::map< string, JSONNode * > JSONObject
Definition:
webserv.hpp:48
Generated by
1.9.7