changed itoa to c++ style and put it in utils, and change utils dependencies to not depend on webserv
This commit is contained in:
@@ -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() ) );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user