|
发表于 2004-7-7 22:00:00
|
显示全部楼层
Re: string的用法是什么
自己包一个比较快
///////////////////////////////////////////////////////////////////////////////
// Class Declaration
///////////////////////////////////////////////////////////////////////////////
/**
* @class DiString
*
* @brief A class that is very similar to CString
*
* @usage
*/
class DiString
{
public:
////////////////////////////////////////////////////////////////////////////
// C O N T R U C T O R S / D E S T R U C T O R S
////////////////////////////////////////////////////////////////////////////
//! Constructor
DiString(void);
//! Constructor
DiString( const DiString& other );
//! Constructor
DiString( LPCTSTR pszText, UINT uintBufferLength = 0 );
//! Destructor
~DiString(void);
////////////////////////////////////////////////////////////////////////////
// P U B L I C M E T H O D S - O P E R A T I O N S
////////////////////////////////////////////////////////////////////////////
//!--------------------------------------------
//! Operator
//!--------------------------------------------
//! 是否为空字串
bool IsEmpty(void);
//! Get the length of current text
UINT GetLength(void) { return GetData()->m_dwTextLength; }
//! Get pointer to buffer for direct modification
LPTSTR GetBuffer( UINT dwLength );
//! 释放buffer
void ReleaseBuffer(void);
//! 添加文字 ( += )
void Add( LPCTSTR pszText );
//! 寻找文字
int Find( LPCTSTR pszString, UINT uintCount = 0 );
//! 比对文字
int Compare( LPCTSTR pszText ) const { return _tcscmp( m_pszText, pszText ); }
//! 转换字串
void Format(LPCSTR str, ...);
//!
bool LoadResource( HINSTANCE hInst, UINT ResID, UINT dwLength = 0xff );
//! 是否 float
bool IsFloat(void);
//! 转换 float
//float ToFloat(void);
//! 转换 float
int ToInt(void);
..... |
|