buffer.h
上传用户:hkcoast
上传日期:2007-01-12
资源大小:979k
文件大小:2k
源码类别:

手机短信编程

开发平台:

Visual C++

  1. // Buffer.h: interface for the CBuffer class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_BUFFER_H__829F6693_AC4D_11D2_8C37_00600877E420__INCLUDED_)
  5. #define AFX_BUFFER_H__829F6693_AC4D_11D2_8C37_00600877E420__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. #include "common.h"
  10. //##ModelId=3B70A76902BD
  11. class /*CLASS_DECLSPEC*/ CBuffer  
  12. {
  13. // Attributes
  14. protected:
  15. //##ModelId=3B70A76902C7
  16. PBYTE m_pBase;
  17. //##ModelId=3B70A76902DB
  18. PBYTE m_pPtr;
  19. //##ModelId=3B70A76902E5
  20. UINT m_nSize;
  21. // Methods
  22. protected:
  23. //##ModelId=3B70A76902EF
  24. UINT ReAllocateBuffer(UINT nRequestedSize);
  25. //##ModelId=3B70A7690303
  26. UINT DeAllocateBuffer(UINT nRequestedSize);
  27. //##ModelId=3B70A7690317
  28. UINT GetMemSize();
  29. //##ModelId=3B70A7690321
  30. CRITICAL_SECTION m_cs;
  31. public:
  32. //##ModelId=3B70A7690335
  33. void ClearBuffer();
  34. //##ModelId=3B70A7690336
  35. UINT Delete(UINT nSize);
  36. //##ModelId=3B70A7690349
  37. UINT Read(PBYTE pData, UINT nSize);
  38. //##ModelId=3B70A769035D
  39. BOOL Write(PBYTE pData, UINT nSize);
  40. //##ModelId=3B70A7690371
  41. BOOL Write(CString& strData);
  42. BOOL WriteNULL();
  43. //##ModelId=3B70A769037C
  44. UINT GetBufferLen();
  45. //##ModelId=3B70A769038F
  46. int Scan(PBYTE pScan,UINT nPos);
  47. //##ModelId=3B70A769039A
  48. BOOL Insert(PBYTE pData, UINT nSize);
  49. //##ModelId=3B70A76903B7
  50. BOOL Insert(CString& strData);
  51. //##ModelId=3B70A76903C1
  52. void Copy(CBuffer& buffer);
  53. //##ModelId=3B70A76903CB
  54. PBYTE GetBuffer(UINT nPos=0);
  55. //##ModelId=3B70A76903D5
  56. CBuffer();
  57. //##ModelId=3B70A76903DF
  58. virtual ~CBuffer();
  59. //##ModelId=3B70A76A000B
  60. void FileWrite(const CString& strFileName);
  61. };
  62. #endif // !defined(AFX_BUFFER_H__829F6693_AC4D_11D2_8C37_00600877E420__INCLUDED_)