]> git.tdb.fi Git - libs/core.git/blob - source/utils.h
Revamp the split functions to allow a max_split argument and splitting by longer...
[libs/core.git] / source / utils.h
1 /* $Id$
2
3 This file is part of libmspstrings
4 Copyright © 2006-2007 Mikko Rasa
5 Distributed under the LGPL
6 */
7
8 #ifndef MSP_STRINGS_UTILS_H_
9 #define MSP_STRINGS_UTILS_H_
10
11 #include <string>
12 #include <vector>
13
14 namespace Msp {
15
16 int strcasecmp(const std::string &, const std::string &);
17 std::string tolower(const std::string &);
18 std::string toupper(const std::string &);
19
20 std::vector<std::string> split_fields(const std::string &, const std::string &, int =-1);
21 std::vector<std::string> split_fields(const std::string &, char, int =-1);
22 std::vector<std::string> split_long(const std::string &, const std::string &, int =-1);
23 std::vector<std::string> split(const std::string &, const std::string & =" \t\r\n", int =-1);
24 std::vector<std::string> split(const std::string &, char, int =-1);
25
26 template<typename T>
27 std::string join(const T &, const std::string & =" ");
28 std::string strip(const std::string &);
29
30 } // namespace Msp
31
32 #endif