libkmime

kqcstringsplitter.h
1 /*
2  kqcstringsplitter.h
3 
4  KNode, the KDE newsreader
5  Copyright (c) 1999-2001 the KNode authors.
6  See file AUTHORS for details
7 
8  This program is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation; either version 2 of the License, or
11  (at your option) any later version.
12  You should have received a copy of the GNU General Public License
13  along with this program; if not, write to the Free Software Foundation,
14  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US
15 */
16 
17 #ifndef KTQCSTRINGSPLITTER_H
18 #define KTQCSTRINGSPLITTER_H
19 
20 #include <tqcstring.h>
21 
22 #include <tdemacros.h>
23 
24 class TDE_EXPORT KTQCStringSplitter {
25 
26  public:
27  KTQCStringSplitter();
28  ~KTQCStringSplitter();
29 
30  void reset() { start=0; end=0; sep=""; incSep=false;}
31 
32  void init(const TQCString &str, const char *s);
33  void init(const char *str, const char *s);
34  void setIncludeSep(bool inc) { incSep=inc; }
35 
36  bool first();
37  bool last();
38 
39  bool next();
40  bool prev();
41 
42  TQCString& string() { return dst; }
43  const TQCString& source() { return src; }
44 
45  private:
46  TQCString src, dst, sep;
47  int start,end;
48  bool incSep;
49 
50 };
51 
52 #endif