Phoxonics  1.0
Object Oriented FDTD Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Strings.hpp
Go to the documentation of this file.
1 /*
2  * Strings.hpp
3  *
4  * Created on: Nov 17, 2014
5  * Author: cuda
6  */
7 
8 #ifndef STRINGS_HPP_
9 #define STRINGS_HPP_
10 
11 #include <string>
12 #include <sstream>
13 #include <vector>
14 #include "../common/CommonBase.hpp"
15 #include "../exception/CustomException.hpp"
16 
17 namespace phoxonics {
18 namespace common {
19 
20 class Strings : public CommonBase {
21 public:
22  explicit Strings();
23  virtual ~Strings();
24 
25  // splits a string using a delimiter
26  std::vector<std::string>& split(const std::string &s, char delim,
27  std::vector<std::string> &elems);
28 
29  // splits a string and return a vector
30  std::vector<std::string> split(const std::string &s, char delim);
31 
32  // replace a string within a string with other string
33  std::string replace(std::string str, std::string str_to_replace,
34  std::string str_to_replace_with);
35 
36  // search for a suffix in string
37  bool has_suffix(std::string &str, std::string &suffix);
38 };
39 
40 } /* namespace common */
41 } /* namespace phoxonics */
42 
43 #endif /* STRINGS_HPP_ */
virtual ~Strings()
Definition: Strings.cpp:17
bool has_suffix(std::string &str, std::string &suffix)
Definition: Strings.cpp:48
Definition: CommonBase.hpp:14
std::string replace(std::string str, std::string str_to_replace, std::string str_to_replace_with)
Definition: Strings.cpp:39
Strings()
Definition: Strings.cpp:13
Definition: CommonBase.hpp:17
Definition: Strings.hpp:20
std::vector< std::string > & split(const std::string &s, char delim, std::vector< std::string > &elems)
Definition: Strings.cpp:21