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

skAsciiString.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: skAsciiString_8h-source.html,v 1.1 2003/04/14 15:53:25 simkin_cvs Exp $
00020 */
00021 
00022 
00023 #ifndef skASCIISTRING_H
00024 #define skASCIISTRING_H
00025 
00026 #include "skGeneral.h"
00027 
00028 #ifdef STREAMS_ENABLED
00029 #include <iostream.h>
00030 #endif
00031 
00032 
00033 
00034 class P_AsciiString;
00035 
00040 class CLASSEXPORT skAsciiString 
00041 {
00042  public:
00046   skAsciiString();
00050   skAsciiString(const char *);
00054   skAsciiString(const skAsciiString&);
00060   skAsciiString(const char * buffer, USize len);
00066   skAsciiString(const char repeatchar, USize len);
00070   virtual ~skAsciiString();
00074   skAsciiString& operator=(const skAsciiString&);
00078   skAsciiString& operator=(const char *);
00083   bool operator<(const skAsciiString&) const;
00088   bool operator==(const skAsciiString&) const;
00093   bool operator==(const char *) const;
00098   bool operator!=(const skAsciiString&) const;
00103   bool operator!=(const char *) const;
00108   operator const char * () const;
00113   bool equalsIgnoreCase(const skAsciiString&) const;
00117   USize hash() const;
00123   char at(USize index) const;
00130   skAsciiString substr(USize start,USize length) const;
00136   skAsciiString substr(USize start) const;
00141   skAsciiString operator+(const skAsciiString&) const ;
00146   skAsciiString& operator+=(const skAsciiString&);
00151   USize length() const;
00156   int indexOf(const skAsciiString& s) const;
00161   int indexOf(char c) const;
00166   int indexOfLast(char c) const;
00170   int to() const;
00171 #ifdef USE_FLOATING_POINT
00172 
00175   float toFloat() const;
00176 #endif
00177 
00180   static skAsciiString literal(const char *);
00184   static skAsciiString from(int);
00188   static skAsciiString from(USize);
00189 #ifdef USE_FLOATING_POINT
00190 
00193   static skAsciiString from(float);
00194 #endif
00195 
00198   static skAsciiString from(char ch);
00202   static skAsciiString fromBuffer(char * buffer);
00206   skAsciiString ltrim() const;
00207  protected:
00211   skAsciiString(P_AsciiString *);
00215   skAsciiString(const char * s,int);
00219   void assign(const char *,int len=0);                          
00223   void deRef();
00227   P_AsciiString * pimp;
00228 };
00229 /*
00230  * A hashKey function for HashTables
00231  */
00232 inline USize hashKey(const skAsciiString * s)
00233 {
00234     return s->hash();
00235 }
00236 /*
00237  * An operator to add strings
00238  */
00239 CLASSEXPORT skAsciiString operator+(const char * s1,const skAsciiString& s2);
00240 
00241 #ifdef STREAMS_ENABLED
00242 /*
00243  * A streaming operator to write a string to an output stream
00244  */
00245 CLASSEXPORT ostream& operator<<(ostream&,const skAsciiString&s);
00246 #endif
00247 
00248 #include "skAsciiString.inl"
00249 
00250 #endif
00251 
00252 
00253 

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