licornea_tools
string.h
Go to the documentation of this file.
1 #ifndef LICORNEA_UTILITY_STRING_H_
2 #define LICORNEA_UTILITY_STRING_H_
3 
4 #include <string>
5 #include <vector>
6 
7 namespace tlz {
8 
9 std::string file_name_extension(const std::string& filename);
10 
11 template<typename T> std::string to_string(const T&);
12 template<typename T> T from_string(const std::string&);
13 
14 template<typename It> std::string to_string(It begin, It end, const std::string& separator = ", ");
15 
16 std::vector<std::string> explode(char separator, const std::string&);
17 std::string implode(char separator, const std::vector<std::string>&);
18 
19 template<typename T>
20 std::vector<T> explode_from_string(char separator, const std::string&);
21 
22 template<typename T>
23 std::string implode_to_string(char separator, const std::vector<T>&);
24 
25 std::string to_lower(const std::string&);
26 std::string to_upper(const std::string&);
27 
28 std::string replace_all(const std::string& subject, const std::string& find, const std::string& replace);
29 std::size_t replace_all_inplace(std::string& subject, const std::string& find, const std::string& replace);
30 
31 int string_hash(const std::string&);
32 
33 
34 }
35 
36 #include "string.tcc"
37 
38 #endif
std::size_t replace_all_inplace(std::string &subject, const std::string &find, const std::string &replace)
Definition: string.cc:63
std::string implode(char separator, const std::vector< std::string > &vec)
Definition: string.cc:31
std::vector< T > explode_from_string(char separator, const std::string &)
T from_string(const std::string &)
int string_hash(const std::string &str)
Definition: string.cc:75
std::string replace_all(const std::string &subject_orig, const std::string &find, const std::string &replace)
Definition: string.cc:56
std::string to_upper(const std::string &s_orig)
Definition: string.cc:49
std::string to_string(const T &)
std::string implode_to_string(char separator, const std::vector< T > &)
std::string file_name_extension(const std::string &filename)
Definition: string.cc:9
std::string to_lower(const std::string &s_orig)
Definition: string.cc:42
std::vector< std::string > explode(char separator, const std::string &str)
Definition: string.cc:15