1 /** \file Parse.h - parse a string
3 ** Written: 1999-Feb-10 grymse@alhem.net
7 Copyright (C) 1999-2007 Anders Hedstrom
9 This library is made available under the terms of the GNU GPL.
11 If you would like to use this library in a closed-source application,
12 a separate license agreement is available. For information about
13 the closed-source license agreement for the C++ sockets library,
14 please visit http://www.alhem.net/Sockets/license.html and/or
15 email license@alhem.net.
17 This program is free software; you can redistribute it and/or
18 modify it under the terms of the GNU General Public License
19 as published by the Free Software Foundation; either version 2
20 of the License, or (at your option) any later version.
22 This program is distributed in the hope that it will be useful,
23 but WITHOUT ANY WARRANTY; without even the implied warranty of
24 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 GNU General Public License for more details.
27 You should have received a copy of the GNU General Public License
28 along with this program; if not, write to the Free Software
29 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
36 /***************************************************/
37 /* interface of class Parse */
39 /** Splits a string whatever way you want.
45 Parse(const std::string
&);
46 Parse(const std::string
&,const std::string
&);
47 Parse(const std::string
&,const std::string
&,short);
49 short issplit(const char);
51 void getsplit(std::string
&);
52 std::string
getword();
53 void getword(std::string
&);
54 void getword(std::string
&,std::string
&,int);
55 std::string
getrest();
56 void getrest(std::string
&);
58 void setbreak(const char);
61 void enablebreak(const char c
) {
64 void disablebreak(const char c
) {
68 void getline(std::string
&);
69 size_t getptr() { return pa_the_ptr
; }
70 void EnableQuote(bool b
) { pa_quote
= b
; }
73 std::string pa_the_str
;
74 std::string pa_splits
;