00001
00044 #ifndef INC_MI32_STRUTF8_H
00045 #define INC_MI32_STRUTF8_H
00046
00047 #ifndef INC_MI32_STDDEFNS_H
00048 #include <mi32/stddefns.h>
00049 #endif
00050
00051 #ifdef MISYSTEMDLL
00052 #define CLASSLIBEXPORT MI_DLLCLASSEXPORT
00053 #else
00054 #define CLASSLIBEXPORT MI_DLLCLASSIMPORT
00055 #endif
00056
00057 #ifndef GENERATING_DOXYGEN_OUTPUT
00058 class MISTRING;
00059 #endif
00060
00065 class CLASSLIBEXPORT STRUTF8 {
00066 public:
00067
00069 STRUTF8 (
00070 );
00071
00073 STRUTF8 (
00074 const STRUTF8& rhs
00075 );
00076
00078 STRUTF8 (
00079 const char *rhs
00080 );
00081
00083 STRUTF8 (
00084 const MISTRING& rhs
00085 );
00086
00088 ~STRUTF8 ();
00089
00091 STRUTF8& operator= (
00092 const STRUTF8& rhs
00093 );
00094
00096 STRUTF8& operator= (
00097 const char *rhs
00098 );
00099
00101 STRUTF8& operator= (
00102 const unsigned char *rhs
00103 );
00104
00106 STRUTF8& operator= (
00107 const MISTRING& rhs
00108 );
00109
00111 operator const char* (
00112 ) const;
00113
00115 void Attach (
00116 char *& str
00117 );
00118
00120 void Attach (
00121 unsigned char *& str
00122 );
00123
00125 void Clear (
00126 );
00127
00129 const UINT8* GetUINT8 (
00130 ) const;
00131
00134 bool IsEmpty (
00135 ) const;
00136
00137 #ifndef GENERATING_DOXYGEN_OUTPUT
00139 bool IsEqual (
00140 const STRUTF8& rhs
00141 ) const;
00142
00144 bool IsEqual (
00145 const char* rhs
00146 ) const;
00147
00149 int Compare (
00150 const STRUTF8& rhs
00151 ) const;
00152
00154 int Compare (
00155 const char* rhs
00156 ) const;
00157
00158 #endif
00159
00160 private:
00161 #ifndef GENERATING_DOXYGEN_OUTPUT
00162 #if defined(DEBUG) && !defined(STRUTF8_C)
00163
00164
00165 class PRIV_DEBUG {
00166 const char* m_string;
00167 };
00168 PRIV_DEBUG *m_pPriv;
00169 #else
00170 class PRIV;
00171 PRIV *m_pPriv;
00172 #endif
00173 #endif
00174 };
00175
00176 inline bool operator< (
00177 const STRUTF8& lhs,
00178 const STRUTF8& rhs
00179 ) { return (lhs.Compare(rhs) < 0); }
00180
00181 inline bool operator> (
00182 const STRUTF8& lhs,
00183 const STRUTF8& rhs
00184 ) { return (lhs.Compare(rhs) > 0); }
00185
00186 inline bool operator< (
00187 const STRUTF8& lhs,
00188 const char* rhs
00189 ) { return (lhs.Compare(rhs) < 0); }
00190
00191 inline bool operator> (
00192 const STRUTF8& lhs,
00193 const char* rhs
00194 ) { return (lhs.Compare(rhs) > 0); }
00195
00196 inline bool operator< (
00197 const char* lhs,
00198 const STRUTF8& rhs
00199 ) { return (rhs.Compare(lhs) >= 0); }
00200
00201 inline bool operator> (
00202 const char* lhs,
00203 const STRUTF8& rhs
00204 ) { return (rhs.Compare(lhs) <= 0); }
00205
00206 inline bool operator== (
00207 const STRUTF8& lhs,
00208 const STRUTF8& rhs
00209 ) { return (lhs.IsEqual(rhs)); }
00210
00211 inline bool operator!= (
00212 const STRUTF8& lhs,
00213 const STRUTF8& rhs
00214 ) { return (!lhs.IsEqual(rhs)); }
00215
00216 inline bool operator== (
00217 const STRUTF8& lhs,
00218 const char* rhs
00219 ) { return (lhs.IsEqual(rhs)); }
00220
00221 inline bool operator!= (
00222 const STRUTF8& lhs,
00223 const char* rhs
00224 ) { return (!lhs.IsEqual(rhs)); }
00225
00226 inline bool operator== (
00227 const char* lhs,
00228 const STRUTF8& rhs
00229 ) { return (rhs.IsEqual(lhs)); }
00230
00231 inline bool operator!= (
00232 const char* lhs,
00233 const STRUTF8& rhs
00234 ) { return (!rhs.IsEqual(lhs)); }
00235
00236 #undef CLASSLIBEXPORT
00237
00238 #endif