00001
00011
00012
00013 #if (_MSC_VER > 1000) || defined(SGI_COMPILER)
00014 #pragma once
00015 #endif
00016
00017 #ifndef __XSISTRING_H__
00018 #define __XSISTRING_H__
00019
00020 #include "sicppsdk.h"
00021 #include <stdlib.h>
00022
00023 namespace XSI {
00024
00025 class CStatus;
00026 class CValue;
00027 class CStringArray;
00028
00029
00074
00075
00076 class SICPPSDKDECL CString
00077 {
00078 public:
00080 CString();
00081
00083 virtual ~CString();
00084
00088 CString(const CString& in_str);
00089
00094 CString(const wchar_t * in_str );
00095
00101 CString( const char* in_str );
00102
00120 explicit CString( const CValue& in_val );
00121
00142 const wchar_t * GetWideString() const ;
00143
00168 const char* GetAsciiString() const ;
00169
00202 CStatus PutAsciiString(const char* in_pszStr);
00203
00208 ULONG Length() const ;
00209
00213 bool IsEmpty() const ;
00214
00217 void Clear() ;
00218
00223 CString& operator=(const CString& in_rhs) ;
00224
00229 CString& operator=(const wchar_t * in_rhs) ;
00230
00236 CString& operator=(const char* in_rhs) ;
00237
00243 bool operator==(const CString& in_refStr) const;
00244
00249 bool operator==(const wchar_t* in_pwstr) const;
00250
00256 bool operator==(const char* in_pstr) const;
00257
00274 bool IsEqualNoCase( const CString& in_rhs ) const ;
00275
00280 bool IsEqualNoCase( const wchar_t* in_pwstr ) const ;
00281
00288 bool IsEqualNoCase( const char* in_pstr ) const ;
00289
00296 CStringArray Split( const CString& in_strDel ) const;
00297
00303 bool operator!=(const CString& in_refStr) const;
00304
00310 bool operator!=(const wchar_t* in_pwstr) const;
00311
00318 bool operator!=(const char* in_pstr) const;
00319
00333 CString& operator+=(const CString& in_refStr);
00334
00339 CString& operator+=(const wchar_t* in_pwstr);
00340
00346 CString& operator+=(const char* in_pstr);
00347
00352 CString& operator+=(const wchar_t in_wchar);
00353
00359 CString& operator+=(const char in_char);
00360
00365 CString operator+(const CString& in_refStr) const;
00366
00371 CString operator+(const wchar_t* in_pwstr) const;
00372
00378 CString operator+(const char* in_pstr) const;
00379
00384 CString operator+(const wchar_t in_wchar) const;
00385
00391 CString operator+(const char in_char) const;
00392
00401 wchar_t operator [] (ULONG in_index) const;
00402
00412 char GetAt(ULONG in_index) const;
00413
00420 bool operator < ( const CString& in_str) const;
00421
00428 bool operator > ( const CString& in_str) const;
00429
00464 ULONG FindString( const CString& in_str, ULONG in_nOffset = 0 ) const;
00465
00498 ULONG ReverseFindString( const CString& in_str, ULONG in_nOffset = ULONG_MAX ) const;
00499
00529 CString GetSubString( ULONG in_nOffset = 0, ULONG in_nCount = ULONG_MAX ) const;
00530
00531 private:
00532
00533
00538
00539 struct StringData
00540 {
00541 void * m_pImpl ;
00542
00544
00548 wchar_t* m_pWDebugStr;
00549 char* m_pDebugStr;
00550 };
00552 StringData* m_pData;
00553 };
00554
00558 SICPPSDKDECL CString operator+( const wchar_t* in_pwstr, const CString& in_refStr ) ;
00559
00563 SICPPSDKDECL CString operator+( const wchar_t in_wchar, const CString& in_refStr ) ;
00564
00569 SICPPSDKDECL CString operator+( const char* in_pstr, const CString& in_refStr ) ;
00570
00575 SICPPSDKDECL CString operator+( const char in_char, const CString& in_refStr ) ;
00576
00577
00586
00587 class SICPPSDKDECL CStringArray
00588 {
00589 public:
00595 CStringArray( LONG in_size=0);
00596
00600 CStringArray(const CStringArray& in_array );
00601
00603 ~CStringArray();
00604
00609 CStringArray& operator=( const CStringArray& in_array );
00610
00614 LONG GetCount() const;
00615
00620 CStatus Add( const CString& in_item );
00621
00625 CStatus Clear();
00626
00633 CStatus Resize( LONG in_size);
00634
00640 const CString& operator[]( LONG in_index ) const;
00641
00647 CString& operator[]( LONG in_index );
00648
00654 bool operator==(const CStringArray& in_array) const;
00655
00661 bool operator!=(const CStringArray& in_array) const;
00662
00663 private:
00664 void* m_ptr;
00665 };
00666
00667 };
00668
00669 #endif // __XSISTRING_H__