Main Page Namespace List Class Hierarchy Compound List File List Namespace Members Compound Members File Members Related Pages

# String.h

Go to the documentation of this file.

    00001
    00002
    00003
    00004 #ifndef STRING_H
    00005 #define STRING_H
    00006
    00007 #include "Types.h"
    00008
    00009 namespace wkgl {
    00010
    00016 extern "C" WCHAR* ctowc( const char *string );
    00017
    00024 extern "C" WCHAR* cntowc( const char *string, long len );
    00025
    00031 extern "C" char* wctoc( const WCHAR *string );
    00032
    00050 class String
    00051 {
    00052   protected:
    00053     WCHAR *chars;
    00054     long clen;
    00055
    00056   public:
    00060     String();
    00061
    00065     String( const String& string );
    00066
    00070     String( const char *string );
    00071
    00075     String( const WCHAR *string );
    00076
    00080     String( const char *string, long sindex, long count );
    00081
    00085     String( const WCHAR *string, long sindex, long count );
    00086
    00090     ~String();
    00091
    00095     virtual void toUpper();
    00096
    00100     virtual void toLower();
    00101
    00105     virtual void trim();
    00106
    00110     virtual void replace( char old_char, char new_char );
    00111
    00115     virtual void replace( WCHAR old_char, WCHAR new_char );
    00116
    00120     virtual String substring( long sindex );
    00121
    00125     virtual String substring( long sindex, long count );
    00126
    00130     virtual String concat( const String& string );
    00131
    00135     virtual String concat( const char *string );
    00136
    00140     virtual String concat( const WCHAR *string );
    00141
    00145     virtual void setString( const String& string );
    00146
    00150     virtual void setString( const char *string );
    00151
    00155     virtual void setString( const WCHAR *string );
    00156
    00160     virtual void insert( const String& string, int bindex );
    00161
    00165     virtual void insert( const char *string, int bindex );
    00166
    00170     virtual void insert( const WCHAR *string, int bindex );
    00171
    00175     virtual char charAt( long index );
    00176
    00180     virtual WCHAR wcharAt( long index );
    00181
    00185     virtual void setCharAt( char c, long index );
    00186
    00190     virtual void setWCharAt( WCHAR c, long index );
    00191
    00195     virtual long length();
    00196
    00200     virtual long indexOf( char c );
    00201
    00205     virtual long indexOf( WCHAR c );
    00206
    00210     virtual long indexOf( char c, long fromindex );
    00211
    00215     virtual long indexOf( WCHAR c, long fromindex );
    00216
    00220     virtual long lastIndexOf( char c );
    00221
    00225     virtual long lastIndexOf( WCHAR c );
    00226
    00230     virtual long lastIndexOf( char c, long fromindex );
    00231
    00235     virtual long lastIndexOf( WCHAR c, long fromindex  );
    00236
    00240     virtual int compareTo( const String& string );
    00241
    00245     virtual int compareTo( const char *string );
    00246
    00250     virtual int compareTo( const WCHAR *string );
    00251
    00255     virtual int compareToIgnoreCase( const String& string );
    00256
    00260     virtual int compareToIgnoreCase( const char *string );
    00261
    00265     virtual int compareToIgnoreCase( const WCHAR *string );
    00266
    00270     virtual BOOL equals( const String& string );
    00271
    00275     virtual BOOL equals( const char *string );
    00276
    00280     virtual BOOL equals( const WCHAR *string );
    00281
    00285     virtual BOOL equalsIgnoreCase( const String& string );
    00286
    00290     virtual BOOL equalsIgnoreCase( const char *string );
    00291
    00295     virtual BOOL equalsIgnoreCase( const WCHAR *string );
    00296
    00300     virtual void operator=( const String& string );
    00301
    00305     virtual void operator=( const char *string );
    00306
    00310     virtual void operator=( const WCHAR *string );
    00311
    00315     virtual BOOL operator==( const String& string );
    00316
    00320     virtual BOOL operator==( const char *string );
    00321
    00325     virtual BOOL operator==( const WCHAR *string );
    00326
    00330     virtual BOOL operator!=( const String& string );
    00331
    00335     virtual BOOL operator!=( const char *string );
    00336
    00340     virtual BOOL operator!=( const WCHAR *string );
    00341
    00345     virtual String operator+( const String& string );
    00346
    00350     virtual String operator+( const char *string );
    00351
    00355     virtual String operator+( const WCHAR *string );
    00356
    00360     virtual operator char*();
    00361
    00365     virtual operator WCHAR*();
    00366
    00370     virtual operator LPARAM();
    00371
    00375     virtual operator String*();
    00376
    00380     static String valueOf( long i );
    00381
    00385     static String valueOf( char c );
    00386
    00390     static String valueOf( const char *string );
    00391
    00395     static String valueOf( WCHAR wc );
    00396
    00400     static String valueOf( const WCHAR *string );
    00401
    00405     static String valueOf( bool b );
    00406
    00410     static String valueOf( double d );
    00411 };
    00412 }
    00413 #endif