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.14 2004/12/17 21:31:14 sdw 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 #ifdef __SYMBIAN32__
00042 : public CBase
00043 #endif
00044 {
00045  public:
00049   skAsciiString();
00050 #ifndef __SYMBIAN32__
00051 
00055   skAsciiString(const char *);
00056 #endif
00057 
00060   inline skAsciiString(const skAsciiString&);
00061 #ifndef __SYMBIAN32__
00062 
00068   skAsciiString(const char * buffer, USize len);
00075   skAsciiString(const char repeatchar, USize len);
00076 #endif
00077 
00080   virtual inline ~skAsciiString();
00085   inline skAsciiString& operator=(const skAsciiString&);
00090   IMPORT_C skAsciiString& operator=(const char *);
00095   inline bool operator<(const skAsciiString&) const;
00100   inline bool operator==(const skAsciiString&) const;
00105   inline bool operator==(const char *) const;
00110   IMPORT_C bool operator!=(const skAsciiString&) const;
00115   IMPORT_C bool operator!=(const char *) const;
00116 #ifndef __SYMBIAN32__
00117 
00122   operator const char * () const;
00123 #endif
00124 
00128   inline const char * c_str() const;
00132   inline USize hash() const;
00138   inline char at(USize index) const;
00146   IMPORT_C skAsciiString substr(USize start,USize length) const;
00153   IMPORT_C skAsciiString substr(USize start) const;
00159   IMPORT_C skAsciiString operator+(const skAsciiString&) const ;
00165   IMPORT_C skAsciiString& operator+=(const skAsciiString&);
00170   inline USize length() const;
00175   IMPORT_C int indexOf(const skAsciiString& s) const;
00180   IMPORT_C int indexOf(char c) const;
00185   EXPORT_C int indexOfLast(char c) const;
00189   IMPORT_C int to() const;
00190 #ifdef USE_FLOATING_POINT
00191 
00194   IMPORT_C float toFloat() const;
00195 #endif
00196 
00199   static IMPORT_C skAsciiString literal(const char *);
00203   static IMPORT_C skAsciiString from(int);
00207   static IMPORT_C skAsciiString from(USize);
00208 #ifdef USE_FLOATING_POINT
00209 
00212   static IMPORT_C skAsciiString from(float);
00213 #endif
00214 
00217   static IMPORT_C skAsciiString from(char ch);
00221   static IMPORT_C skAsciiString fromBuffer(char * buffer);
00225   skAsciiString IMPORT_C ltrim() const;
00226  protected:
00230   skAsciiString(P_AsciiString *);
00231 #ifndef __SYMBIAN32__
00232 
00236   skAsciiString(const char * s,int);
00237 #endif
00238 
00241   void assign(const char *,int len=0);                          
00245   void deRef();
00249   P_AsciiString * pimp;
00250 };
00251 /*
00252  * A hashKey function for HashTables
00253  */
00254 inline USize hashKey(const skAsciiString * s)
00255 {
00256     return s->hash();
00257 }
00258 /*
00259  * An operator to add strings
00260  */
00261 CLASSEXPORT IMPORT_C skAsciiString operator+(const char * s1,const skAsciiString& s2);
00262 
00263 #ifdef STREAMS_ENABLED
00264 /*
00265  * A streaming operator to write a string to an output stream
00266  */
00267 CLASSEXPORT ostream& operator<<(ostream&,const skAsciiString&s);
00268 #endif
00269 
00270 #include "skAsciiString.inl"
00271 
00272 #endif
00273 
00274 
00275 

Generated on Fri Dec 17 20:27:34 2004 for Simkin by doxygen1.3