arnaucube
arnaucube/openEventsPlatformAppPublic Self-hosted repository
openEventsPlatformApp/plugins/ionic-plugin-keyboard/src/blackberry10/native/public/tokenizer.h
plugins/ionic-plugin-keyboard/src/blackberry10/native/public/tokenizer.hRaw
 1/************************************************************************
 2The zlib/libpng License
 3
 4Copyright (c) 2006 Joerg Wiedenmann
 5
 6This software is provided 'as-is', without any express or implied warranty.
 7In no event will the authors be held liable for any damages arising from
 8the use of this software.
 9
10Permission is granted to anyone to use this software for any purpose,
11including commercial applications, and to alter it and redistribute it
12freely, subject to the following restrictions:
13
141. The origin of this software must not be misrepresented;
15	you must not claim that you wrote the original software.
16	If you use this software in a product, an acknowledgment
17	in the product documentation would be appreciated but is
18	not required.
19
202. Altered source versions must be plainly marked as such,
21	and must not be misrepresented as being the original software.
22
233. This notice may not be removed or altered from any source distribution.
24
25***********************************************************************/
26
27/********************************************************************
28	created:	2006-01-28
29	filename: 	tokenizer.cpp
30	author:		J�rg Wiedenmann
31
32	purpose:	A tokenizer function which provides a very
33				customizable way of breaking up strings.
34*********************************************************************/
35
36#include <vector>
37#include <string>
38using namespace std;
39
40// Function to break up a string into tokens
41//
42// Parameters:
43//-----------
44// str = the input string that will be tokenized
45// result = the tokens for str
46// delimiters = the delimiter characters
47// delimiters preserve = same as above, but the delimiter characters
48//		will be put into the result as a token
49// quote = characters to protect the enclosed characters
50// esc = characters to protect a single character
51//
52
53void tokenize ( const string& str, vector<string>& result,
54			const string& delimiters, const string& delimiters_preserve = "",
55			const string& quote = "\"", const string& esc = "\\" );