Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

183 lines
2.0 KiB

  1. /*++
  2. Copyright (c) 1990 Microsoft Corporation
  3. Module Name:
  4. buffer.hxx
  5. Abstract:
  6. This contains all buffer class definition.
  7. No reallocing of buffers is done. A buffer must be big enough
  8. to hold both buffer for a cat.
  9. Author:
  10. Steve Rowe 27-Nov-90
  11. Environment:
  12. ULIB, User Mode
  13. Notes:
  14. Revision History:
  15. --*/
  16. //
  17. // This class is no longer supported.
  18. //
  19. #define _BUFFER_
  20. #if !defined (_BUFFER_)
  21. #define _BUFFER_
  22. #include "error.hxx"
  23. DECLARE_CLASS( BUFFER );
  24. class BUFFER : public OBJECT {
  25. friend WSTRING;
  26. public:
  27. VIRTUAL
  28. ~BUFFER (
  29. );
  30. NONVIRTUAL
  31. BOOLEAN
  32. BuffCat (
  33. IN PCBUFFER BufferToCat
  34. );
  35. NONVIRTUAL
  36. PCVOID
  37. GetBufferPtr (
  38. ) CONST;
  39. NONVIRTUAL
  40. BOOLEAN
  41. PutBuffer (
  42. IN PCBUFFER BufferToCopy
  43. );
  44. NONVIRTUAL
  45. ULONG
  46. QueryBytesInBuffer (
  47. ) CONST;
  48. NONVIRTUAL
  49. BOOLEAN
  50. SetBuffer (
  51. IN PVOID InitialBuffer,
  52. IN ULONG SizeOfBuffer
  53. );
  54. protected:
  55. DECLARE_CONSTRUCTOR( BUFFER );
  56. NONVIRTUAL
  57. BOOLEAN
  58. BufferCopyAt (
  59. IN PCVOID BufferToCopy,
  60. IN ULONG BytesToCopy,
  61. IN ULONG StartingByte DEFAULT 0
  62. );
  63. NONVIRTUAL
  64. BOOLEAN
  65. DeleteAt (
  66. IN ULONG cbToDelete,
  67. IN ULONG oStartDelete
  68. );
  69. NONVIRTUAL
  70. BOOLEAN
  71. InsertAt (
  72. IN PCVOID BufferToCopy,
  73. IN ULONG cbToCopy,
  74. IN ULONG oStartCopy
  75. );
  76. NONVIRTUAL
  77. PVOID
  78. ReAllocate (
  79. IN ULONG NewCount
  80. );
  81. private:
  82. NONVIRTUAL
  83. VOID
  84. Construct (
  85. );
  86. PVOID pBuffer; // pointer to the data byffer
  87. ULONG cb; // count of bytes used
  88. ULONG _BufSize; // count of bytes in buffer
  89. STATIC
  90. ULONG _ThresHold;
  91. };
  92. INLINE
  93. PCVOID
  94. BUFFER::GetBufferPtr (
  95. ) CONST
  96. /*++
  97. Routine Description:
  98. Fetch pointer to internal buffer
  99. Arguments:
  100. None
  101. Return Value:
  102. PCVOID - pointer to internal buffer
  103. --*/
  104. {
  105. return ( pBuffer );
  106. }
  107. INLINE
  108. ULONG
  109. BUFFER::QueryBytesInBuffer (
  110. ) CONST
  111. /*++
  112. Routine Description:
  113. Fetch size in bytes of internal buffer
  114. Arguments:
  115. None
  116. Return Value:
  117. ULONG - size of internal buffer in bytes
  118. --*/
  119. {
  120. return ( cb );
  121. }
  122. #endif // _BUFFER_