⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 charstring.hpp

📁 "More for C++" is a class library that provides some features that are usually common for object ori
💻 HPP
字号:
////  This file is part of the "More for C++" library////  Copyright (c) 1999-2003 by Thorsten Goertz (thorsten@morefor.org)////  The "More for C++" library is free software; you can redistribute it and/or//  modify it under the terms of the license that comes with this package.////  Read "license.txt" for more details.////  THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED//  WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES//  OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.////////////////////////////////////////////////////////////////////////////////#ifndef CHARSTRING_HPP#define CHARSTRING_HPP////////////////////////////////////////////////////////////////////////////////#include <more/arrayofchar.hpp>#include <more/core/tstring.hpp>////////////////////////////////////////////////////////////////////////////////namespace more{  namespace core  {    template<>    class TString<char>    {      public:        TString( const char* pcString = 0 );        TString( const TString<char>& rString );        TString( const Array<char>& rArray );        size_t getLength( ) const;        const TString<char>& operator = ( const char* pcString );        const TString<char>& operator = ( const TString<char>& rString );        const TString<char>& operator = ( const Array<char>& rArray );        const TString<char>& operator = ( const char cCharacter );        operator const char* ( ) const;        Array<char> copyToArray( ) const;        TString<char> getPrefix( size_t nSize) const;        TString<char> getSuffix( size_t nSize ) const;        Array<TString<char> > split( const char cSeparator ) const;        TString<char> getSubstring( size_t nPosition, size_t nSize ) const;        bool find( const TString<char>& rString, size_t nPosition, size_t& rnResult ) const;        TString<char> toLowerCase( ) const;        TString<char> toUpperCase( ) const;        static TString<char> from( signed8 );        static TString<char> from( unsigned8 );        static TString<char> from( signed16 );        static TString<char> from( unsigned16 );        static TString<char> from( signed32 );        static TString<char> from( unsigned32 );        static TString<char> from( float );        static TString<char> from( double );        void to( signed8& ) const;        void to( unsigned8& ) const;        void to( signed16& ) const;        void to( unsigned16& ) const;        void to( signed32& ) const;        void to( unsigned32& ) const;        void to( float& ) const;        void to( double& ) const;        bool operator < ( const TString<char>&  rString ) const;        bool operator < ( const char* pcString ) const;        bool operator <= ( const TString<char>& rString ) const;        bool operator <= ( const char* pcString ) const;        bool operator == ( const TString<char>& rString ) const;        bool operator == ( const char* pcString ) const;        bool operator != ( const TString<char>& rString ) const;        bool operator != ( const char* pcString ) const;        bool operator >= ( const TString<char>& rString ) const;        bool operator >= ( const char* pcString ) const;        bool operator > ( const TString<char>&  rString ) const;        bool operator > ( const char* pcString ) const;        TString<char> operator + ( const TString<char>& rString ) const;        TString<char> operator + ( const char* pcString ) const;        TString<char> operator + ( const char cCharacter ) const;        TString<char> operator & ( const TString<char>& rString ) const;        TString<char> operator & ( const char* pcString ) const;        TString<char> operator & ( const char cChar ) const;        TString<char> operator && ( const TString<char>& rString ) const;        TString<char> operator && ( const char* pcString ) const;        TString<char> operator && ( const char cCharacter ) const;        const TString<char>& operator += ( const TString<char>& rString );        const TString<char>& operator += ( const char* pcString );        const TString<char>& operator += ( const char cChar );        TString<char>& operator << ( signed8 );        TString<char>& operator << ( unsigned8 );        TString<char>& operator << ( signed16 );        TString<char>& operator << ( unsigned16 );        TString<char>& operator << ( signed32 );        TString<char>& operator << ( unsigned32 );        TString<char>& operator << ( float );        TString<char>& operator << ( double );        TString<char>& operator << ( const char* pcString );        TString<char>& operator << ( const TString<char>& rString );      protected:        TString( const size_t nLength );        TString( const Array<char>& rArray, const size_t nIndexOfFirstT, const size_t nLength );      private:        Array<char> m_array;#ifdef _DEBUG        const char* m_pcDebugStr;        void updateDebugString( );#endif    };    template<>    bool operator <  ( const char* pString, const TString<char>& rString );    template<>    bool operator <= ( const char* pString, const TString<char>& rString );    template<>    bool operator == ( const char* pString, const TString<char>& rString );    template<>    bool operator != ( const char* pString, const TString<char>& rString );    template<>    bool operator >= ( const char* pString, const TString<char>& rString );    template<>    bool operator >  ( const char* pString, const TString<char>& rString );    template<>    TString<char> operator +  ( const char character, const TString<char>& rString );    template<>    TString<char> operator +  ( const char* pString, const TString<char>& rString );    template<>    TString<char> operator &  ( const char character, const TString<char>& rString );    template<>    TString<char> operator &  ( const char* pString, const TString<char>& rString );    template<>    TString<char> operator && ( const char character, const TString<char>& rString );    template<>    TString<char> operator && ( const char* pString, const TString<char>& rString );  }}////////////////////////////////////////////////////////////////////////////////#ifdef _DEBUGinline void more::core::TString<char>::updateDebugString( ){  if( m_array.getLength( ) > 0 )  {    m_pcDebugStr = &m_array[0];  }  else  {    m_pcDebugStr = "";  }}#else#  define updateDebugString( )#endif////////////////////////////////////////////////////////////////////////////////#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -