Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

ustring.hpp

00001 /*****************************************************************************
00002  * ustring.hpp
00003  *****************************************************************************
00004  * Copyright (C) 2003 the VideoLAN team
00005  * $Id: ustring.hpp 11664 2005-07-09 06:17:09Z courmisch $
00006  *
00007  * Authors: Cyril Deguet     <[email protected]>
00008  *          Olivier Teulière <[email protected]>
00009  *
00010  * This program is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version.
00014  *
00015  * This program is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License
00021  * along with this program; if not, write to the Free Software
00022  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
00023  *****************************************************************************/
00024 
00025 #ifndef USTRING_HPP
00026 #define USTRING_HPP
00027 
00028 #include "../src/skin_common.hpp"
00029 #include "pointer.hpp"
00030 
00031 
00032 // Class for UNICODE strings handling
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

Generated on Tue Dec 20 10:14:43 2005 for vlc-0.8.4a by  doxygen 1.4.2