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.2 2003/01/23 15:31:03 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;
00174   float toFloat() const;
00178   static skAsciiString literal(const char *);
00182   static skAsciiString from(int);
00186   static skAsciiString from(USize);
00190   static skAsciiString from(float);
00194   static skAsciiString from(char ch);
00198   static skAsciiString fromBuffer(char * buffer);
00202   skAsciiString ltrim() const;
00203  protected:
00207   skAsciiString(P_AsciiString *);
00211   skAsciiString(const char * s,int);
00215   void assign(const char *,int len=0);                          
00219   void deRef();
00223   P_AsciiString * pimp;
00224 };
00225 /*
00226  * A hashKey function for HashTables
00227  */
00228 inline USize hashKey(const skAsciiString * s)
00229 {
00230     return s->hash();
00231 }
00232 /*
00233  * An operator to add strings
00234  */
00235 CLASSEXPORT skAsciiString operator+(const char * s1,const skAsciiString& s2);
00236 
00237 #ifdef STREAMS_ENABLED
00238 /*
00239  * A streaming operator to write a string to an output stream
00240  */
00241 CLASSEXPORT ostream& operator<<(ostream&,const skAsciiString&s);
00242 #endif
00243 
00244 #include "skAsciiString.inl"
00245 
00246 #endif
00247 
00248 
00249 

Generated on Thu Jan 23 15:25:38 2003 for Simkin by doxygen1.3-rc1