mirror of
https://github.com/3lswear/webserv.git
synced 2025-10-29 13:27:59 +03:00
Merge branch 'roman' of github.com:3lswear/webserv into roman
This commit is contained in:
@@ -1,2 +1,4 @@
|
|||||||
name = "jopa"
|
name = "jopa"
|
||||||
port = 6969
|
port = 6969
|
||||||
|
ip = "127.0.0.1"
|
||||||
|
methods = ["GET", "POST", 1, "piska", false, false]
|
||||||
|
|||||||
@@ -104,6 +104,15 @@ class toml_node
|
|||||||
*result += " ]";
|
*result += " ]";
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
case BOOL:
|
||||||
|
{
|
||||||
|
std::string *result;
|
||||||
|
if (value.boolean)
|
||||||
|
result = new std::string("true");
|
||||||
|
else
|
||||||
|
result = new std::string("false");
|
||||||
|
return (result);
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return ( new std::string("Not implemented :)"));
|
return ( new std::string("Not implemented :)"));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ namespace config
|
|||||||
}
|
}
|
||||||
case BOOL:
|
case BOOL:
|
||||||
{
|
{
|
||||||
|
tokenizer.rollBackToken();
|
||||||
(*mapObject)[key] = parseBool();
|
(*mapObject)[key] = parseBool();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -197,8 +198,10 @@ namespace config
|
|||||||
s_token token = tokenizer.getToken();
|
s_token token = tokenizer.getToken();
|
||||||
if (token.value == "true")
|
if (token.value == "true")
|
||||||
value = true;
|
value = true;
|
||||||
else
|
else if (token.value == "false")
|
||||||
value = false;
|
value = false;
|
||||||
|
else
|
||||||
|
throw std::invalid_argument("Unexpected bool value");
|
||||||
node->setBool(value);
|
node->setBool(value);
|
||||||
|
|
||||||
return (node);
|
return (node);
|
||||||
|
|||||||
@@ -209,12 +209,25 @@ namespace config
|
|||||||
token.type = BOOL;
|
token.type = BOOL;
|
||||||
token.value = "false";
|
token.value = "false";
|
||||||
file.seekg(4, std::ios_base::cur);
|
file.seekg(4, std::ios_base::cur);
|
||||||
|
|
||||||
|
/* token.value = ""; */
|
||||||
|
/* while (std::isalpha(c)) */
|
||||||
|
/* { */
|
||||||
|
/* token.value += c; */
|
||||||
|
/* file.get(c); */
|
||||||
|
/* } */
|
||||||
|
std::cerr << "value is: " << token.value << std::endl;
|
||||||
|
std::cerr << "c is: " << c << std::endl;
|
||||||
}
|
}
|
||||||
else if (c == 't')
|
else if (c == 't')
|
||||||
{
|
{
|
||||||
token.type = BOOL;
|
token.type = BOOL;
|
||||||
token.value = "true";
|
while (std::isalpha(c))
|
||||||
file.seekg(3, std::ios_base::cur);
|
{
|
||||||
|
token.value += c;
|
||||||
|
file.get(c);
|
||||||
|
}
|
||||||
|
/* file.seekg(3, std::ios_base::cur); */
|
||||||
}
|
}
|
||||||
else if (c == 'n')
|
else if (c == 'n')
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user