00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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
00227
00228 inline USize hashKey(const skAsciiString * s)
00229 {
00230 return s->hash();
00231 }
00232
00233
00234
00235 CLASSEXPORT skAsciiString operator+(const char * s1,const skAsciiString& s2);
00236
00237 #ifdef STREAMS_ENABLED
00238
00239
00240
00241 CLASSEXPORT ostream& operator<<(ostream&,const skAsciiString&s);
00242 #endif
00243
00244 #include "skAsciiString.inl"
00245
00246 #endif
00247
00248
00249