home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2000 February
/
PCWorld_2000-02_cd.bin
/
Software
/
TemaCD
/
tcvpa
/
data1.cab
/
MyFileGroup
/
INCLUDE
/
Buffer.hpp
< prev
next >
Wrap
C/C++ Source or Header
|
1999-06-03
|
3KB
|
80 lines
#ifndef _INC_BUFFER_HPP
#define _INC_BUFFER_HPP
TC_COREEX_EXPORT void tcBinToStr (const unsigned char* bin, size_t size, TC_CString & dest) ;
TC_COREEX_EXPORT BOOL tcStrToBin (const char * src, unsigned char * dest, size_t size) ;
#define TC_SZ_AUTOARR (sizeof(double))
typedef union TC_bufData {
char _arr[TC_SZ_AUTOARR];
void * _ptr;
} TC_UBufData;
// **********************************************************************
class TC_COREEX_EXPORT TC_CBinArray
{
protected: ULONG m_size ;
protected: TC_UBufData m_data ;
protected: ULONG m_maxsize ;
public: TC_CBinArray (ULONG size = 0) ;
public: TC_CBinArray (const unsigned char * arr, ULONG size) ;
public: TC_CBinArray (const TC_CBinArray & ba) ;
public: ~TC_CBinArray () ;
protected: void Init (ULONG size) ;
protected: BOOL IsAuto () const ;
public: void Release () ;
public: void Clear () ;
public: void Assign (const unsigned char * arr, ULONG size) ;
public: void Assign (const TC_CBinArray & ba) ;
public: TC_CBinArray & operator = (const TC_CBinArray & ba) ;
public: int Compare (const TC_CBinArray & ba) ;
public: static BOOL IsStringValid (const char * str) ;
public: BOOL FromString (const char * src) ;
public: void ToString (TC_CString & dest) ;
public: BOOL IsNull () ;
public: const unsigned char * Array () const ;
public: ULONG Size () const ;
}; // end of class TC_CBinArray
// **********************************************************************
// **********************************************************************
class TC_COREEX_EXPORT TC_CBuffer
{
protected: TC_UBufData m_data ;
protected: long m_type ;
protected: int m_size ;
public: TC_CBuffer () ;
public: TC_CBuffer (short val) ;
public: TC_CBuffer (unsigned short val) ;
public: TC_CBuffer (int val) ;
public: TC_CBuffer (unsigned int val) ;
public: TC_CBuffer (long val) ;
public: TC_CBuffer (unsigned long val) ;
public: TC_CBuffer (TC_CDate & dt) ;
public: TC_CBuffer (TC_CTime & tm) ;
public: TC_CBuffer (char val) ;
public: TC_CBuffer (unsigned char val) ;
public: TC_CBuffer (float val) ;
public: TC_CBuffer (double val) ;
public: TC_CBuffer (const char * val) ;
public: TC_CBuffer (TC_CString &val) ;
public: TC_CBuffer (TC_CBCD & bcd) ;
public: TC_CBuffer (TC_CBuffer &val) ;
public: TC_CBuffer (const unsigned char * val, int size) ;
public: virtual ~TC_CBuffer () ;
protected: void Init () ;
public: TC_CBuffer & operator = (const TC_CBuffer & psbuf) ;
public: void Set (const TC_CBuffer & psbuf) ;
public: void Set (const TC_CBuffer * psbuf) ;
public: TC_CString Str () ;
public: virtual void GetStr (TC_CString & str) ;
public: virtual long GetType () ;
public: const char * GetBuffer () ;
public: int Size () ;
}; // end of class TC_CBuffer
// **********************************************************************
#endif // _INC_BUFFER_HPP