home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2000 February
/
PCWorld_2000-02_cd.bin
/
Software
/
TemaCD
/
tcvpa
/
data1.cab
/
MyFileGroup
/
INCLUDE
/
String.hpp
< prev
next >
Wrap
C/C++ Source or Header
|
1999-06-03
|
3KB
|
82 lines
#ifndef _INC_STRING_HPP
#define _INC_STRING_HPP
#ifdef BUILD_TCCORE
#define TCCORELIB __declspec(dllexport)
#else
#ifdef BUILD_LOCAL
#define TCCORELIB
#else
#define TCCORELIB __declspec(dllimport)
#endif
#endif
// **********************************************************************
class TCCORELIB TC_CString
{
friend TCCORELIB BOOL operator == (const char *s1, const TC_CString & s2);
private:
union
{
char isAlloc;
char buffer[16];
struct
{
UINT dummy1;
UINT mem;
char * ptr;
}
a;
};
private: void _Init () ;
public: void _Free () ;
public: TC_CString () ;
public: TC_CString (const TC_CString & src) ;
public: TC_CString (const char * str) ;
public: TC_CString (int length) ;
public: ~TC_CString () ;
public: void Set (const char * str_) ;
public: void SetLen (int size) ;
public: char* Get () ;
public: int Len () ;
public: operator const char* () ;
public: TC_CString & operator += (const char * str_) ;
public: TC_CString & operator += ( const char chr ) ;
public: TC_CString & operator += (const TC_CString & str) ;
public: TC_CString & operator = (const TC_CString & str) ;
public: TC_CString & operator = (const char * str) ;
}; // end of class TC_CString
// **********************************************************************
TCCORELIB TC_CString operator + (const TC_CString & s1, const TC_CString & s2) ;
TCCORELIB TC_CString operator + (const TC_CString & s1, const char *s2) ;
TCCORELIB TC_CString operator + (const char *s1, const TC_CString & s2) ;
TCCORELIB BOOL operator == (const TC_CString &s1, const TC_CString &s2) ;
TCCORELIB BOOL operator == (const TC_CString &s1, const char *s2) ;
TCCORELIB BOOL operator == (const char *s1, const TC_CString & s2) ;
TCCORELIB BOOL operator != (const TC_CString & s1, const TC_CString & s2) ;
TCCORELIB BOOL operator != (const TC_CString & s1, const char *s2) ;
TCCORELIB BOOL operator != (const char *s1, const TC_CString & s2) ;
extern TCCORELIB char tc_sNull [];
TCCORELIB TC_CString tcStr (const char*str) ;
TCCORELIB TC_CString tcStr (long val,int radix=10) ;
TCCORELIB TC_CString tcStr (double val, int dec) ;
TCCORELIB void tcDtoa ( double doub_val, int dec, char * buffer ) ;
TCCORELIB char* tcStrTrimBegin (char* s) ;
TCCORELIB char* tcStrTrimEnd (char *s) ;
TCCORELIB char* tcStrTrim (char *s) ;
TCCORELIB TC_CString& tcStrTrim (TC_CString & str) ;
TCCORELIB TC_CString& tcStrInsert (TC_CString & src, LPCSTR str) ;
TCCORELIB int tcLastIndexOf (LPCSTR src, int chr) ;
TCCORELIB TC_CString tcSubString (LPCSTR src, int start, int end=-1) ;
TCCORELIB char* _tcVSprintf (const char * fmt, va_list arg_ptr) ;
TCCORELIB void _tcSprintfLock () ;
TCCORELIB void _tcSprintfUnlock () ;
TCCORELIB TC_CString tcSPrintf (LPCSTR fmt, ...) ;
TCCORELIB TC_CString tcVSPrintf (const char * fmt, va_list arg_ptr) ;
TCCORELIB TC_CString& tcCSPrintf (TC_CString &dst, LPCSTR fmt, ...) ;
TCCORELIB TC_CString& tcCVSPrintf (TC_CString &dst, const char * fmt, va_list arg_ptr) ;
TCCORELIB void winout (LPCSTR fmt, ... ) ;
#endif // _INC_STRING_HPP