resolved merge conflicts, now ConfigParser is even more intertwined with other parts

This commit is contained in:
Me
2022-07-31 16:30:14 +02:00
12 changed files with 118 additions and 127 deletions

View File

@@ -1,8 +1,5 @@
#include "Webserv.hpp"
#include "utils.hpp"
std::vector<std::string> split(std::string input, char delimiter)
{
@@ -34,10 +31,17 @@ bool isNumeric_btw(int low, int high, std::string str)
if (std::isdigit(str[i]) == false)
return false;
}
int n = atoi(str.c_str());
int n = std::atoi(str.c_str());
if (n < low || n > high)
return false;
return true;
}
char* itoa(int n)
{
std::stringstream strs;
strs << n;
// casts : https://stackoverflow.com/questions/332030/when-should-static-cast-dynamic-cast-const-cast-and-reinterpret-cast-be-used
return ( const_cast<char*>( strs.str().c_str() ) );
}