LiteSQL  0.3.10
split.hpp
Go to the documentation of this file.
1 /* LiteSQL
2  *
3  * The list of contributors at http://litesql.sf.net/
4  *
5  * See LICENSE for copyright information. */
6 
9 #ifndef litesql_split_hpp
10 #define litesql_split_hpp
11 #include <string>
12 #include <vector>
13 namespace litesql {
15 class Split : public std::vector<std::string> {
16 public:
18  Split() {}
20  Split(size_t initial_size) { reserve(initial_size);}
22  Split(std::vector<std::string> data)
23  : std::vector<std::string>(data) {}
25  Split(const std::string& s, const std::string& delim=" ");
26 
32  Split slice(int start, int end) const;
34  std::string join(const std::string& delim) const;
35 
36  static std::string join(const std::vector<std::string>& strings,const std::string& delim=" ");
38  Split & extend(const std::vector<std::string> & s);
39 };
40 }
41 #endif
Definition: backend.hpp:14
Split slice(int start, int end) const
returns a part of strings
Definition: split.cpp:34
Split(size_t initial_size)
init with reserved size (only reserved)
Definition: split.hpp:20
Split()
empty split
Definition: split.hpp:18
splits and joins strings.
Definition: split.hpp:15
Split(std::vector< std::string > data)
from string vector
Definition: split.hpp:22
std::string join(const std::string &delim) const
returns strings joined with delimiter
Split & extend(const std::vector< std::string > &s)
adds contents of another split to the end
Definition: split.cpp:65

SourceForge.net Logo