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.
32 #ifndef _SOCKETS_Parse_H
33 #define _SOCKETS_Parse_H
35 #include "sockets-config.h"
37 #pragma warning(disable:4514)
42 #ifdef SOCKETS_NAMESPACE
43 namespace SOCKETS_NAMESPACE
{
47 /***************************************************/
48 /* interface of class Parse */
50 /** Splits a string whatever way you want.
56 Parse(const std::string
&);
57 Parse(const std::string
&,const std::string
&);
58 Parse(const std::string
&,const std::string
&,short);
60 short issplit(const char);
62 void getsplit(std::string
&);
63 std::string
getword();
64 void getword(std::string
&);
65 void getword(std::string
&,std::string
&,int);
66 std::string
getrest();
67 void getrest(std::string
&);
69 void setbreak(const char);
72 void enablebreak(const char c
) {
75 void disablebreak(const char c
) {
79 void getline(std::string
&);
80 size_t getptr() { return pa_the_ptr
; }
81 void EnableQuote(bool b
) { pa_quote
= b
; }
84 std::string pa_the_str
;
85 std::string pa_splits
;
96 #ifdef SOCKETS_NAMESPACE
100 #endif // _SOCKETS_Parse_H