You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
620 B
33 lines
620 B
#pragma once
|
|
#include "webserv.hpp"
|
|
|
|
class JSONNode {
|
|
public:
|
|
JSONObject obj(void);
|
|
JSONList lst(void);
|
|
string str(void);
|
|
int nbr(void);
|
|
bool boo(void);
|
|
~JSONNode(void);
|
|
|
|
private:
|
|
enum Type { OBJECT, LIST, STRING, NUMBER, BOOLEAN, NULL_TYPE };
|
|
union Values {
|
|
JSONObject *object;
|
|
JSONList *list;
|
|
string *str;
|
|
int nbr;
|
|
bool bValue;
|
|
} values;
|
|
Type type;
|
|
|
|
void setObj(JSONObject *object);
|
|
void setLst(JSONList *list);
|
|
void setStr(string *str);
|
|
void setNbr(int nbr);
|
|
void setBoo(bool v);
|
|
void setNull(void);
|
|
|
|
string stringify(int indentationLevel);
|
|
friend class JSONParser;
|
|
};
|
|
|