GCS  0.2.3
gu_string_utils.hpp
1 // Copyright (C) 2009-2010 Codership Oy <info@codership.com>
2 
3 #ifndef __GU_STRING_UTILS_HPP__
4 #define __GU_STRING_UTILS_HPP__
5 
6 #include <string>
7 #include <vector>
8 
9 namespace gu
10 {
16  std::vector<std::string> strsplit(const std::string& s, char sep = ' ');
17 
25  std::vector<std::string> tokenize(const std::string& s,
26  char sep = ' ',
27  char esc = '\\',
28  bool empty = false);
29 
31  void trim (std::string& s);
32 }
33 
34 #endif /* __GU_STRING_UTILS_HPP__ */
void trim(std::string &s)
std::vector< std::string > strsplit(const std::string &s, char sep= ' ')
Split string into tokens using given separator.
std::vector< std::string > tokenize(const std::string &s, char sep= ' ', char esc= '\\', bool empty=false)
Split string into tokens using given separator and escape.