kqcstringsplitter.h
00001 /* 00002 kqcstringsplitter.h 00003 00004 KNode, the KDE newsreader 00005 Copyright (c) 1999-2001 the KNode authors. 00006 See file AUTHORS for details 00007 00008 This program is free software; you can redistribute it and/or modify 00009 it under the terms of the GNU General Public License as published by 00010 the Free Software Foundation; either version 2 of the License, or 00011 (at your option) any later version. 00012 You should have received a copy of the GNU General Public License 00013 along with this program; if not, write to the Free Software Foundation, 00014 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US 00015 */ 00016 00017 #ifndef KTQCSTRINGSPLITTER_H 00018 #define KTQCSTRINGSPLITTER_H 00019 00020 #include <tqcstring.h> 00021 00022 #include <kdepimmacros.h> 00023 00024 class KDE_EXPORT KTQCStringSplitter { 00025 00026 public: 00027 KTQCStringSplitter(); 00028 ~KTQCStringSplitter(); 00029 00030 void reset() { start=0; end=0; sep=""; incSep=false;} 00031 00032 void init(const TQCString &str, const char *s); 00033 void init(const char *str, const char *s); 00034 void setIncludeSep(bool inc) { incSep=inc; } 00035 00036 bool first(); 00037 bool last(); 00038 00039 bool next(); 00040 bool prev(); 00041 00042 TQCString& string() { return dst; } 00043 const TQCString& source() { return src; } 00044 00045 private: 00046 TQCString src, dst, sep; 00047 int start,end; 00048 bool incSep; 00049 00050 }; 00051 00052 #endif