📄 cmstring.h
字号:
#ifndef __MATRIX_STRING_H
#define __MATRIX_STRING_H
#include <windows.h>
namespace MatrixCore
{
namespace System
{
#define StringBlockSize 48
class CMString //: public CMObject
{
public:
CMString();
CMString( const CMString& source );
CMString( LPTSTR str );
CMString( LPCTSTR str );
CMString( int n, bool hex = false );
virtual ~CMString();
void format( LPCTSTR strFormat, ... );
int length(){ return stringLength; }
LPTSTR getBuffer();
bool isEmpty();
void empty();
TCHAR getAt( int nIndex );
void setAt( int nIndex, TCHAR ch );
void left( int nCount );
void right( int nCount );
void makeUpper();
void makeLower();
int compareTo( CMString& str );
int compareTo( LPCTSTR str );
int compareTo( CMString& str, int count );
int compareTo( LPCTSTR str, int count );
static LPCWSTR toWideChar( LPCSTR str );
static LPCSTR toMultiByte( LPCWSTR str );
const CMString& operator = ( CMString& str );
const CMString& operator = ( LPTSTR str );
const CMString& operator = ( LPCTSTR str );
const CMString& operator += ( CMString& str );
const CMString& operator += ( LPTSTR str );
TCHAR operator [] ( int nIndex ) const;
operator LPTSTR() const;
friend bool operator == ( CMString& str1, CMString& str2 );
friend bool operator == ( CMString& str1, LPTSTR str2 );
friend bool operator == ( LPTSTR str1, CMString& str2 );
friend bool operator != ( CMString& str1, CMString& str2 );
friend bool operator != ( CMString& str1, LPTSTR str2 );
friend bool operator != ( LPTSTR str1, CMString& str2 );
friend CMString operator + ( CMString& ls, LPTSTR rs );
friend CMString operator + ( LPTSTR ls, CMString& rs );
friend CMString operator + ( CMString& ls, CMString& rs );
friend CMString operator + ( CMString& ls, int n );
friend CMString operator + ( int n, CMString& rs );
friend CMString operator + ( CMString& ls, DWORD n );
friend CMString operator + ( DWORD n, CMString& rs );
protected:
void allocData( int strLen );
void calcStringSize();
LPTSTR chData;
int stringLength;
int allocSize;
};
}
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -