Victor
 All Data Structures Functions Variables Friends Pages
stringtools.h
1 /* This file is part of Victor.
2 
3  Victor is free software: you can redistribute it and/or modify
4  it under the terms of the GNU General Public License as published by
5  the Free Software Foundation, either version 3 of the License, or
6  (at your option) any later version.
7 
8  Victor is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with Victor. If not, see <http://www.gnu.org/licenses/>.
15  */
16 // stringtools.h
17 
18 #ifndef __stringtools_H__
19 #define __stringtools_H__
20 
21 #include <iostream>
22 #include <sstream>
23 #include <string>
24 #include <vector>
25 
26 
27 void strip(std::string &str);
28 
29 std::string strip_and_return_string(std::string);
30 
31 int strip_and_return_int(std::string);
32 
33 unsigned int strip_and_return_unsigned_int(std::string);
34 
35 float strip_and_return_float(std::string);
36 
37 std::vector<std::string> split(std::string, char);
38 
39 int seq_length(const std::string);
40 
41 // template<class T>
42 // std::string to_string(const T&);
43 
44 template<class T> std::string to_string(const T &x) {
45  std::ostringstream oss;
46  oss << x;
47  return oss.str();
48 }
49 
50 std::string StringToLower(std::string);
51 std::string StringToUpper(std::string);
52 
53 #endif