Last change
on this file since 88 was
88,
checked in by jrpelegrina, 5 years ago
|
First relase to xenial
|
File size:
1.4 KB
|
Line | |
---|
1 | |
---|
2 | #ifndef _LSF_UTILS_ |
---|
3 | #define _LSF_UTILS_ |
---|
4 | |
---|
5 | #include <string> |
---|
6 | #include <vector> |
---|
7 | |
---|
8 | namespace net |
---|
9 | { |
---|
10 | namespace lliurex |
---|
11 | { |
---|
12 | namespace utils |
---|
13 | { |
---|
14 | namespace str |
---|
15 | { |
---|
16 | /*! |
---|
17 | Splits a string, using split character |
---|
18 | \param s source string |
---|
19 | \param split character used for splitting |
---|
20 | \return vector containing splitted strings |
---|
21 | */ |
---|
22 | std::vector<std::string> Split(std::string s,char split); |
---|
23 | |
---|
24 | /*! |
---|
25 | Strips whitespaces and newlines characters from both sides of the string |
---|
26 | \param s source string |
---|
27 | \return the stripped string |
---|
28 | */ |
---|
29 | std::string Strip(std::string s); |
---|
30 | |
---|
31 | /*! |
---|
32 | Replace matched substrings |
---|
33 | \param s source string |
---|
34 | \param match substring to replace |
---|
35 | \param replace string used for replacement |
---|
36 | \return replaced string |
---|
37 | */ |
---|
38 | std::string Replace(std::string s, std::string match,std::string replace); |
---|
39 | } |
---|
40 | |
---|
41 | namespace parse |
---|
42 | { |
---|
43 | /*! |
---|
44 | Checks whenever a string matches the given regex pattern |
---|
45 | \param s source string |
---|
46 | \param pattern regex |
---|
47 | */ |
---|
48 | bool Match(std::string s,std::string pattern); |
---|
49 | |
---|
50 | /*! |
---|
51 | Checks whenever a string can be parsed as an integer |
---|
52 | \param s source string |
---|
53 | */ |
---|
54 | bool IsInteger(std::string s); |
---|
55 | |
---|
56 | /*! |
---|
57 | Checks whenever a string can be parsed as a float |
---|
58 | \param s source string |
---|
59 | */ |
---|
60 | bool IsFloat(std::string s); |
---|
61 | } |
---|
62 | } |
---|
63 | } |
---|
64 | } |
---|
65 | |
---|
66 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.