xsi_string.h
Go to the documentation of this file.
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 wchar_t* in_str, ULONG in_nCount );
00102 
00108     CString( const char* in_str );
00109 
00115     CString(const char* in_str, ULONG in_nCount );
00116 
00134     explicit CString( const CValue& in_val );
00135 
00156     const wchar_t * GetWideString() const ;
00157 
00182     const char* GetAsciiString() const ;
00183 
00216     CStatus PutAsciiString(const char* in_pszStr);
00217 
00222     ULONG Length() const ;
00223 
00227     bool IsEmpty() const ;
00228 
00231     void Clear() ;
00232 
00237     CString& operator=(const CString& in_rhs) ;
00238 
00243     CString& operator=(const wchar_t * in_rhs) ;
00244 
00250     CString& operator=(const char* in_rhs) ;
00251 
00257     bool operator==(const CString& in_refStr) const;
00258 
00263     bool operator==(const wchar_t* in_pwstr) const;
00264 
00270     bool operator==(const char* in_pstr) const;
00271 
00288     bool IsEqualNoCase( const CString& in_rhs ) const ;
00289 
00294     bool IsEqualNoCase( const wchar_t* in_pwstr ) const ;
00295 
00302     bool IsEqualNoCase( const char* in_pstr ) const ;
00303 
00310     CStringArray Split( const CString& in_strDel ) const;
00311 
00317     bool operator!=(const CString& in_refStr) const;
00318 
00324     bool operator!=(const wchar_t* in_pwstr) const;
00325 
00332     bool operator!=(const char* in_pstr) const;
00333 
00347     CString& operator+=(const CString& in_refStr);
00348 
00353     CString& operator+=(const wchar_t* in_pwstr);
00354 
00360     CString& operator+=(const char* in_pstr);
00361 
00366     CString& operator+=(const wchar_t in_wchar);
00367 
00373     CString& operator+=(const char in_char);
00374 
00379     CString operator+(const CString& in_refStr) const;
00380 
00385     CString operator+(const wchar_t* in_pwstr) const;
00386 
00392     CString operator+(const char* in_pstr) const;
00393 
00398     CString operator+(const wchar_t in_wchar) const;
00399 
00405     CString operator+(const char in_char) const;
00406 
00415     wchar_t operator [] (ULONG in_index) const;
00416 
00426     char GetAt(ULONG in_index) const;
00427 
00434     bool operator < ( const CString& in_str) const;
00435 
00442     bool operator > ( const CString& in_str) const;
00443 
00478     ULONG FindString( const CString& in_str, ULONG in_nOffset = 0 ) const;
00479 
00512     ULONG ReverseFindString( const CString& in_str, ULONG in_nOffset = UINT_MAX ) const;
00513 
00543     CString GetSubString( ULONG in_nOffset = 0, ULONG in_nCount = UINT_MAX ) const;
00544 
00549     void Lower();
00550 
00555     void Upper();
00556 
00557 private:
00558 
00559     //*************************************************************************
00564     //*************************************************************************
00565     struct StringData
00566     {
00567         void * m_pImpl ;
00568 
00570 
00574         wchar_t* m_pWDebugStr;
00575         char* m_pDebugStr;
00576     };
00578     StringData* m_pData;
00579 };
00580 
00584 SICPPSDKDECL CString operator+( const wchar_t* in_pwstr, const CString& in_refStr ) ;
00585 
00589 SICPPSDKDECL CString operator+( const wchar_t in_wchar, const CString& in_refStr ) ;
00590 
00595 SICPPSDKDECL CString operator+( const char* in_pstr, const CString& in_refStr ) ;
00596 
00601 SICPPSDKDECL CString operator+( const char in_char, const CString& in_refStr ) ;
00602 
00603 //*************************************************************************
00612 //*************************************************************************
00613 class SICPPSDKDECL CStringArray
00614 {
00615 public:
00621     CStringArray( LONG in_size=0);
00622 
00626     CStringArray(const CStringArray& in_array );
00627 
00629     ~CStringArray();
00630 
00635     CStringArray& operator=( const CStringArray& in_array );
00636 
00640     LONG GetCount() const;
00641 
00646     CStatus Add( const CString& in_item );
00647 
00651     CStatus Clear();
00652 
00659     CStatus Resize( LONG in_size);
00660 
00666     const CString& operator[]( LONG in_index ) const;
00667 
00673     CString& operator[]( LONG in_index );
00674 
00680     bool operator==(const CStringArray& in_array) const;
00681 
00687     bool operator!=(const CStringArray& in_array) const;
00688 
00689 private:
00690     void* m_ptr;
00691 };
00692 
00693 };
00694 
00695 #endif // __XSISTRING_H__