Robert Ellis / Util

Dependents:   19E042PIM_T3_2020_0639

Committer:
Phlaphead
Date:
Sun Jun 19 13:13:00 2011 +0000
Revision:
0:3d93ff64fdee
Initial Revision

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Phlaphead 0:3d93ff64fdee 1 /*
Phlaphead 0:3d93ff64fdee 2 Copyright (c) 2011 Robert Ellis (holistic [at] robellis [dot] org [dot] uk)
Phlaphead 0:3d93ff64fdee 3
Phlaphead 0:3d93ff64fdee 4 Permission is hereby granted, free of charge, to any person obtaining a copy
Phlaphead 0:3d93ff64fdee 5 of this software and associated documentation files (the "Software"), to deal
Phlaphead 0:3d93ff64fdee 6 in the Software without restriction, including without limitation the rights
Phlaphead 0:3d93ff64fdee 7 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
Phlaphead 0:3d93ff64fdee 8 copies of the Software, and to permit persons to whom the Software is
Phlaphead 0:3d93ff64fdee 9 furnished to do so, subject to the following conditions:
Phlaphead 0:3d93ff64fdee 10
Phlaphead 0:3d93ff64fdee 11 The above copyright notice and this permission notice shall be included in
Phlaphead 0:3d93ff64fdee 12 all copies or substantial portions of the Software.
Phlaphead 0:3d93ff64fdee 13
Phlaphead 0:3d93ff64fdee 14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
Phlaphead 0:3d93ff64fdee 15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Phlaphead 0:3d93ff64fdee 16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Phlaphead 0:3d93ff64fdee 17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
Phlaphead 0:3d93ff64fdee 18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
Phlaphead 0:3d93ff64fdee 19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
Phlaphead 0:3d93ff64fdee 20 THE SOFTWARE.
Phlaphead 0:3d93ff64fdee 21 */
Phlaphead 0:3d93ff64fdee 22
Phlaphead 0:3d93ff64fdee 23 #ifndef STRING_UTILS_H
Phlaphead 0:3d93ff64fdee 24 #define STRING_UTILS_H
Phlaphead 0:3d93ff64fdee 25
Phlaphead 0:3d93ff64fdee 26 #include <string>
Phlaphead 0:3d93ff64fdee 27 #include <vector>
Phlaphead 0:3d93ff64fdee 28 using namespace std;
Phlaphead 0:3d93ff64fdee 29
Phlaphead 0:3d93ff64fdee 30 /**
Phlaphead 0:3d93ff64fdee 31 * Trims whitespace characters from beginning and end of given string.
Phlaphead 0:3d93ff64fdee 32 */
Phlaphead 0:3d93ff64fdee 33 string trim(const string& src, const string& c = " \r\n");
Phlaphead 0:3d93ff64fdee 34
Phlaphead 0:3d93ff64fdee 35 /**
Phlaphead 0:3d93ff64fdee 36 * Tokenize given string delimmted by given delimter into a vector of seprate strings.
Phlaphead 0:3d93ff64fdee 37 */
Phlaphead 0:3d93ff64fdee 38 vector<string> tokenize(const string& str, const string& delimiters = " ");
Phlaphead 0:3d93ff64fdee 39
Phlaphead 0:3d93ff64fdee 40 #endif