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 #ifndef USTRING_HPP
00026 #define USTRING_HPP
00027
00028 #include "../src/skin_common.hpp"
00029 #include "pointer.hpp"
00030
00031
00032
00033 class UString: public SkinObject
00034 {
00035 public:
00036 static const uint32_t npos;
00037
00039 UString( const UString &rOther );
00040
00042 UString( intf_thread_t *pIntf, const char *pString );
00043
00044 ~UString();
00045
00047 const uint32_t *u_str() const { return m_pString; }
00048
00050 uint32_t length() const { return m_length; }
00051 uint32_t size() const { return m_length; }
00052
00054 bool operator ==( const UString &rOther ) const;
00055 bool operator !=( const UString &rOther ) const;
00056 bool operator <( const UString &rOther ) const;
00057 bool operator <=( const UString &rOther ) const;
00058 bool operator >( const UString &rOther ) const;
00059 bool operator >=( const UString &rOther ) const;
00061 void operator =( const UString &rOther );
00063 void operator +=( const UString &rOther );
00065 const UString operator +( const UString &rOther ) const;
00066 const UString operator +( const char *pString ) const;
00067
00068
00073 uint32_t find( const UString &str, uint32_t position = 0 ) const;
00074 uint32_t find( const char *pString, uint32_t position = 0 ) const;
00075
00078 void replace( uint32_t position, uint32_t n1, const UString &str );
00079 void replace( uint32_t position, uint32_t n1, const char *pString );
00080
00083 UString substr( uint32_t position = 0, uint32_t n = npos) const;
00084
00086 void debug() const;
00087
00088 private:
00090 uint32_t *m_pString;
00092 uint32_t m_length;
00093 };
00094
00095
00096 typedef CountedPtr<UString> UStringPtr;
00097
00098 #endif