69 size_t newpos = size +
_pos;
72 ASSERT(newpos <= currentSize);
74 if (newpos > currentSize)
88 size_t newallocationsize=0;
90 if (size <= currentAllocated)
100 if (size > (currentAllocated*2))
102 newallocationsize = size;
106 newallocationsize = currentAllocated*2;
109 ASSERT(newallocationsize > 0);
114 if (spNewBuffer->IsValid() ==
false)
120 spNewBuffer->SetSize(currentSize);
141 size_t newposition = size +
_pos;
142 size_t currentSize =
GetSize();
145 if ((size == 0) || (data == NULL))
150 hr =
Grow(newposition);
160 if (newposition > currentSize)
173 size_t currentSize =
GetSize();
174 return (
_pos >= currentSize);
194 if (pos <= currentSize)
233 uint8_t* pRet = NULL;
CRefCountedBuffer _spBuffer
HRESULT SeekRelative(int nOffset)
HRESULT Read(void *data, size_t size)
HRESULT GetBuffer(CRefCountedBuffer *pRefCountedBuffer)
void SetNoGrow(bool fDisableGrow)
HRESULT Grow(size_t newsize)
HRESULT SetSize(size_t size)
uint8_t * GetDataPointerUnsafe()
size_t GetAllocatedSize()
HRESULT Write(const void *data, size_t size)
HRESULT SeekDirect(size_t pos)
HRESULT SetSizeHint(size_t size)
boost::shared_ptr< CBuffer > CRefCountedBuffer
void Attach(CRefCountedBuffer &buffer, bool fForWriting)