XPopup: tstring.h Source File

- Main Page
- Classes
- Files
- Related Pages

- File List
- File Members

# tstring.h

Go to the documentation of this file.

    00001
    00016 #ifndef _TSTRING_H_
    00017 #define _TSTRING_H_
    00018
    00019 //#include <stdio.h>
    00020 //#include <string.h>
    00021
    00025 class TString {
    00026
    00027 private:
    00028
    00029   void deleteString( );
    00030
    00031 public:
    00032
    00033   char * m_pString;
    00034
    00035   TString( );
    00036   TString( const char * cString );
    00037   TString( const char chr );
    00038   TString( const TString & tString );
    00039
    00041   ~TString( );
    00042
    00046   char * to_chr( ) { return this->m_pString; };
    00047
    00048   // Operator Overloads
    00049   void operator =( const TString & tString );
    00050   void operator =( const char * cString );
    00051   void operator =( const char chr );
    00052
    00053   TString operator +( const char * cString );
    00054   TString operator +( const char chr );
    00055   TString operator +( const TString & tString );
    00056
    00057   void operator +=( const char * cString );
    00058   void operator +=( const char chr );
    00059   void operator +=( const TString & tString );
    00060
    00061   bool operator ==( const int iNull );
    00062   bool operator ==( const char * cString );
    00063   bool operator ==( const char chr );
    00064   bool operator ==( const TString & tString );
    00065
    00066   bool operator !=( const int iNull );
    00067   bool operator !=( const char * cString );
    00068   bool operator !=( const char chr );
    00069   bool operator !=( const TString & tString );
    00070
    00071   bool operator >( const char * cString );
    00072   bool operator >( const char chr );
    00073   bool operator >( const TString & tString );
    00074
    00075   bool operator >=( const char * cString );
    00076   bool operator >=( const char chr );
    00077   bool operator >=( const TString & tString );
    00078
    00079   bool operator <( const char * cString );
    00080   bool operator <( const char chr );
    00081   bool operator <( const TString & tString );
    00082
    00083   bool operator <=( const char * cString );
    00084   bool operator <=( const char chr );
    00085   bool operator <=( const TString & tString );
    00086
    00087   TString operator *( const int N );
    00088   void operator *=( const int N );
    00089
    00090   char & operator []( long int N );
    00091
    00092   // General String Lib
    00093   size_t len( );
    00094
    00095   TString mid( int pos, int n );
    00096   TString left( int n );
    00097   TString right( int n );
    00098
    00099   int find( const char * substring, int N );
    00100   int find( const char chr, int N );
    00101
    00102   TString sub( int N, int M );
    00103
    00104   void trim( );
    00105
    00106   int replace( const char * subString, const char * rString );
    00107   int replace( const char * subString, const char rchr );
    00108   int replace( const char chr, const char * rString );
    00109   int replace( const char chr, const char rchr );
    00110
    00111   // Token Lib
    00112   void addtok( char * cToken, char * sepChars );
    00113   void deltok( int N, char * sepChars );
    00114   int findtok( char * cToken, int N, char * sepChars );
    00115   TString gettok( int N, char * sepChars );
    00116   TString gettok( int N, int M, char * sepChars );
    00117   void instok( char * cToken, int N, char * sepChars );
    00118   bool istok( char * cToken, char * sepChars );
    00119   TString matchtok( char * mString, int N, char * sepChars );
    00120   int numtok( char * sepChars );
    00121   void puttok( char * cToken, int N, char * sepChars );
    00122   void remtok( char * cToken, int N, char * sepChars );
    00123   void reptok( char * cToken, char * newToken, int N, char * sepChars );
    00124   void sorttok( char * sortOptions, char * sepChars );
    00125   TString wildtok( char * wildString, int N, char * sepChars );
    00126   int nwildtok( char * wildString, char * sepChars );
    00127
    00128 };
    00129
    00130 #endif // TSTRING_H_