Webserv
Loading...
Searching...
No Matches
string.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <sstream>
4
5namespace utils {
6
7template <typename T> std::string toString(T const &v) {
8 std::ostringstream ss;
9 ss << v;
10 return ss.str();
11}
12
13template <typename T> T fromString(std::string const &str) {
14 std::istringstream ss(str);
15 T ret = T();
16 ss >> ret;
17 return ret;
18}
19
20std::string trim(const std::string &s);
21
22bool isAllDigit(std::string const &s);
23void toLower(std::string &s);
24
25} // namespace utils
Definition filesystem.hpp:9
T fromString(std::string const &str)
Definition string.hpp:13
std::string trim(const std::string &s)
Definition string.cpp:7
std::string toString(T const &v)
Definition string.hpp:7
bool isAllDigit(std::string const &s)
Definition string.cpp:16
void toLower(std::string &s)
Definition string.cpp:24