Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

skStringTokenizer.h

00001 /*
00002   Copyright 1996-2003
00003   Simon Whiteside
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Lesser General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Lesser General Public License for more details.
00014 
00015     You should have received a copy of the GNU Lesser General Public
00016     License along with this library; if not, write to the Free Software
00017     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 
00019   $Id: skStringTokenizer_8h-source.html,v 1.1 2003/04/14 15:53:25 simkin_cvs Exp $
00020 */
00021 #ifndef skSTRINGTOKENIZER_H
00022 #define skSTRINGTOKENIZER_H
00023 
00024 #include "skString.h"
00025 
00026 
00031 class CLASSEXPORT skStringTokenizer 
00032 #ifdef __SYMBIAN32__
00033 : public CBase
00034 #endif
00035 {
00036 
00037 
00038  public:
00039 #ifndef __SYMBIAN32__
00040 
00047   skStringTokenizer(const skString& str, const skString& delim, bool returnDelims);
00048   
00059   skStringTokenizer(const skString& str, const skString& delim);
00071   skStringTokenizer(const skString& str);
00072 #endif
00073 
00076   inline skStringTokenizer();
00080   virtual ~skStringTokenizer();
00081 
00090   IMPORT_C void init(const skString& str, const skString& delim, bool returnDelims);
00100   IMPORT_C bool hasMoreTokens();
00101 
00108   IMPORT_C skString nextToken();
00122   IMPORT_C skString nextToken(const skString& delim);
00130   IMPORT_C int countTokens();
00131  private:
00132   int m_CurrentPosition;
00133   int m_NewPosition;
00134   int m_MaxPosition;
00135   skString m_Str;
00136   skString m_Delimiters;
00137   bool m_RetDelims;
00138   bool m_DelimsChanged;
00139 
00145   Char m_MaxDelimChar;
00146   
00150   void setMaxDelimChar();
00156   int skipDelimiters(int startPos);
00161   int scanToken(int startPos);
00162 };
00163 //------------------------------------------
00164 inline skStringTokenizer::skStringTokenizer()
00165 //------------------------------------------
00166   :  m_CurrentPosition(0),m_NewPosition(-1),m_MaxPosition(0),m_DelimsChanged(false)
00167 {
00168 }
00169 #endif

Generated on Mon Apr 14 16:49:22 2003 for Simkin C++ for Windows CE by doxygen1.3