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.

34 lines
620 B

#pragma once
#include "webserv.hpp"
class JSONNode {
2 years ago
public:
JSONObject obj(void);
JSONList lst(void);
string str(void);
int nbr(void);
bool boo(void);
~JSONNode(void);
2 years ago
private:
2 years ago
enum Type { OBJECT, LIST, STRING, NUMBER, BOOLEAN, NULL_TYPE };
union Values {
JSONObject *object;
2 years ago
JSONList *list;
string *str;
int nbr;
bool bValue;
2 years ago
} values;
Type type;
2 years ago
void setObj(JSONObject *object);
void setLst(JSONList *list);
void setStr(string *str);
void setNbr(int nbr);
void setBoo(bool v);
void setNull(void);
2 years ago
string stringify(int indentationLevel);
friend class JSONParser;
};