changed itoa to c++ style and put it in utils, and change utils dependencies to not depend on webserv

This commit is contained in:
hugogogo
2022-07-31 13:19:22 +02:00
parent af8dc072c1
commit 537572e2d0
7 changed files with 17 additions and 64 deletions

View File

@@ -1,8 +1,5 @@
#include "Webserv.hpp"
#include "utils.hpp"
std::vector<std::string> split(std::string input, char delimiter)
{
@@ -16,4 +13,11 @@ std::vector<std::string> split(std::string input, char delimiter)
return answer;
}
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() ) );
}