mirror of
https://github.com/3lswear/webserv.git
synced 2025-10-28 21:07:59 +03:00
feat: add getters
This commit is contained in:
@@ -27,6 +27,25 @@ toml_node::e_type toml_node::get_type(void)
|
||||
return (type);
|
||||
}
|
||||
|
||||
std::string *toml_node::getString(void) const
|
||||
{
|
||||
return (value.str);
|
||||
}
|
||||
|
||||
int toml_node::getNum(void) const
|
||||
{
|
||||
return (value.integer);
|
||||
}
|
||||
bool toml_node::getBool(void) const
|
||||
{
|
||||
return (value.boolean);
|
||||
}
|
||||
|
||||
TOMLArray *toml_node::getArray(void) const
|
||||
{
|
||||
return (value.array);
|
||||
}
|
||||
|
||||
TOMLMap *toml_node::getMap(void)
|
||||
{
|
||||
return (value.map);
|
||||
@@ -76,6 +95,7 @@ void toml_node::setMapArray(TOMLMapArray *map_array)
|
||||
type = MAPARRAY;
|
||||
}
|
||||
|
||||
|
||||
std::string *toml_node::toString(void) const
|
||||
{
|
||||
switch (type)
|
||||
|
||||
@@ -38,6 +38,10 @@ class toml_node
|
||||
|
||||
enum e_type get_type(void);
|
||||
|
||||
std::string *getString(void) const;
|
||||
int getNum(void) const;
|
||||
bool getBool(void) const;
|
||||
TOMLArray *getArray(void) const;
|
||||
TOMLMap *getMap(void);
|
||||
TOMLMapArray *getMapArray(void);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user