MDA
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups
utils.hpp
1 /*
2  * utils.h
3  *
4  * Created on: Jul 28, 2012
5  * Author: Carsten Kemena
6  *
7  * This file is part of MDAT.
8  *
9  * MDAT is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU Lesser General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * MDAT is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public License
20  * along with MDAT. If not, see <http://www.gnu.org/licenses/>.
21  *
22  */
23 
28 #ifndef UTILS_HPP_
29 #define UTILS_HPP_
30 
31 #include <string>
32 #include <cstring>
33 #include <cctype>
34 
35 
36 
37 namespace MDAT
38 {
39 
40 
44 class StrTok
45 {
46 private:
47  char *_str;
48 
49 public:
54  StrTok(char *str);
55 
59  StrTok();
60 
65  void set(char *str)
66  {
67  _str=str;
68  }
69 
74  char* next(const char *sep);
75 };
76 
77 
78 
80 
81 
86 void str_upper(std::string &str);
87 
92 void str_lower(std::string &str);
93 
101 std::string get_alphabet(std::string alphabet);
102 
108 short *encode(std::string alphabet);
109 
110 
111 }
112 
113 #endif /* UTILS_H_ */