00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef __CSIBCString_H__
00029 #define __CSIBCString_H__
00030
00031
00032
00033
00034 #include <SIBCUtil.h>
00035
00036
00037
00038
00039
00040
00042
00046 class XSICOREEXPORT CSIBCString
00047 {
00048 public:
00049
00053 CSIBCString();
00054
00059 CSIBCString( const CSIBCString &in_pString );
00060
00061
00067 CSIBCString(const SI_Char *in_pString );
00068
00069 ~CSIBCString();
00070
00074 SI_Int GetLength();
00075
00092 SI_Char *GetText();
00093
00096 void Clear();
00097
00106 SI_Error Concat(CSIBCString *in_pString);
00107
00117 SI_Error Concat(const SI_Char *in_pString);
00118
00139 SI_Error Concat(const SI_Int in_lInt);
00140
00159 SI_Error Concat(const SI_Float in_fFloat);
00160
00169 SI_Error SetText(CSIBCString *in_pString);
00170
00180 SI_Error SetText(const SI_Char *in_pString);
00181
00190 SI_Error SetText(const SI_Int in_lInt);
00191
00200 SI_Error SetText(const SI_Float in_fFloat);
00201
00216 SI_Int Compare(CSIBCString *in_pString);
00217
00232 SI_Int Compare(const SI_Char *in_pString);
00233
00241 SI_Int Compare(const SI_Int in_lInt);
00242
00250 SI_Int Compare(const SI_Float in_fFloat);
00251
00259 SI_Error LowerCase();
00260
00268 SI_Error UpperCase();
00269
00273 SI_Error RemoveIllegalXSICharacters();
00274
00278 SI_Bool IsXSILegalName();
00279
00280
00285 CSIBCString &operator = ( const CSIBCString & i_pString);
00286
00292 CSIBCString &operator = ( const SI_Char * i_pString);
00293
00298 bool operator == (CSIBCString & i_pString);
00299
00304 bool operator == (const SI_Char * i_pString);
00305
00310 bool operator != (CSIBCString & i_pString);
00311
00315 void Dump();
00316
00322 SI_UInt UsedMemory();
00323
00329 SI_UInt AllocatedMemory();
00330
00331 protected:
00332
00333
00334 private:
00335
00336 SI_Int m_lLength;
00337 SI_Char *m_pBuffer;
00338 };
00339
00340
00341
00342
00343
00345
00349 class XSICOREEXPORT CSIAccumString
00350 {
00351 enum {eAllocSize = 0x100};
00352 public:
00353
00358 CSIAccumString()
00359 {
00360 m_AllocSize = eAllocSize;
00361 m_Buffer = (SI_Char*) malloc(m_AllocSize);
00362 m_BufferEnd = m_Buffer;
00363 *m_BufferEnd = 0;
00364 }
00365
00366 ~CSIAccumString()
00367 {
00368 free( m_Buffer );
00369 }
00370
00374 void Clear()
00375 {
00376 free( m_Buffer );
00377 m_AllocSize = eAllocSize;
00378 m_Buffer = (SI_Char*) malloc(m_AllocSize);
00379 m_BufferEnd = m_Buffer;
00380 *m_BufferEnd = 0;
00381 }
00382
00386 void ConcatByte( SI_Byte in_Byte )
00387 {
00388 SI_Int l_iCurrDelta = (SI_Int)(m_BufferEnd - m_Buffer);
00389 if ( l_iCurrDelta > ( m_AllocSize - 2 ) )
00390 {
00391
00392 m_AllocSize <<= 1;
00393 m_Buffer = (SI_Char*) realloc(m_Buffer,m_AllocSize);
00394 m_BufferEnd = m_Buffer + l_iCurrDelta;
00395 }
00396 *m_BufferEnd = in_Byte;
00397 ++m_BufferEnd;
00398 *m_BufferEnd = 0;
00399 }
00400
00404 SI_Int GetLength() const { return (SI_Int)(m_BufferEnd - m_Buffer); }
00405
00411 SI_Char *GetText() const { return m_Buffer; }
00412
00413 private:
00414
00415
00416 CSIAccumString(const CSIAccumString&);
00417 const CSIAccumString& operator=( const CSIAccumString &);
00418
00419 SI_Char* m_Buffer;
00420 SI_Char* m_BufferEnd;
00421 SI_Int m_AllocSize;
00422 };
00423
00424 #endif
00425