Topics
:The MemoryBuffer class is a general-purpose data structure used to create variable length memory buffers.
MemoryBuffer::MemoryBuffer()
MemoryBuffer::~MemoryBuffer()
MemoryBuffer::Cat()
MemoryBuffer::ChgGrowByInc()
MemoryBuffer::Clear()
MemoryBuffer::Copy()
MemoryBuffer::DeleteAt()
MemoryBuffer::Find()
MemoryBuffer::FreeExtra()
MemoryBuffer::GetBuffer()
MemoryBuffer::GetBufferPtr()
MemoryBuffer::GetDimLen()
MemoryBuffer::GetLength()
MemoryBuffer::Grow()
MemoryBuffer::IsNull()
MemoryBuffer::Load()
MemoryBuffer::SetLength()
MemoryBuffer::is_null()
MemoryBuffer::length()
MemoryBuffer::m_buf()
MemoryBuffer::operator+=()
MemoryBuffer::operator=()
MemoryBuffer::operator[]()
MemoryBuffer::resize()
MemoryBuffer::MemoryBuffer(unsigned Bytes = DefSize, int GB = DefInc)
- Class constructor used to allocate a specified number of bytes in memory for a buffer, with a specified grow by increment. The "DefSize" and "DefInc" integer constants are defined within the MemoryBuffer class by an anonymous enumeration. The "grow by" value is used to grow the buffer in specified increments. If "GB" is set to zero the buffer will not be allowed to grow.MemoryBuffer::MemoryBuffer(const void *buf, unsigned Bytes, int GB = DefInc)
Class constructor used to allocate a specified number of bytes for buffer "buf" and load the memory buffer. The "DefInc" integer constant is defined within the MemoryBuffer class by an anonymous enumeration. The "grow by" value is used to grow the string in specified increments. If "GB" is set to zero the string will not be allowed to grow.MemoryBuffer::MemoryBuffer(const MemoryBuffer &buf)
- Class copy constructor used to copy construct an object using share semantics. This copy constructor does not actually copy the buffer data. Instead the new buffer is bound to the same data that object "buf" is bound to. - Class destructor responsible for unbinding the buffer from any shared data and deleting the data if necessary.void MemoryBuffer::Cat(const void *buf, unsigned Bytes)
- Public member function used to concatenate a specified number of bytes from a memory location to the end of the object that invoked the call.void MemoryBuffer::Cat(unsigned char byte)
- Public member function used to concatenate a single byte to the end of the object that invoked the call.void MemoryBuffer::Cat(char byte)
- Public member function used to concatenate a single byte to the end of the object that invoked the call.void MemoryBuffer::ChgGrowByInc(int GB)
- Public member function used to change the default grow by increment to a specified size. - Public member function used to clear the memory buffer.void MemoryBuffer::Copy(const MemoryBuffer &buf)
- Public member function used to copy data from object "buf" into this object.unsigned MemoryBuffer::DeleteAt(unsigned Pos, unsigned Bytes)
- Public member function used to delete a specified number of bytes, starting at position "Pos". Returns the number of bytes deleted.int MemoryBuffer::Find(void *buf, unsigned Offset = 0)
- Public member function that returns the index of first occurrence of pattern "buf." Returns -1 if pattern not found.int MemoryBuffer::Find(void *buf, unsigned Bytes, unsigned Offset)
- Public member function that returns the index of first occurrence of pattern "buf." Returns -1 if pattern not found.int MemoryBuffer::Find(const MemoryBuffer &buf, unsigned Offset = 0)
- Public member function that returns the index of first occurrence of pattern "buf." Returns -1 if pattern not found. - Public member function used to shrink the bytes allocated for this object's memory buffer by reallocating the number bytes used. This function uses the actual length of the buffer and not the dimensioned length to shrink the buffer.unsigned char *MemoryBuffer::GetBuffer()
- Public member function that returns a pointer to the memory buffer.const unsigned char *MemoryBuffer::GetBuffer()
- Public member function that returns a pointer to the memory buffer.unsigned char *MemoryBuffer::GetBufferPtr()
- Public member function that returns a pointer to the memory buffer.const unsigned char *MemoryBuffer::GetBufferPtr()
- Public member function that returns a pointer to the memory buffer.unsigned MemoryBuffer::GetDimLen()
- Public member function that returns the dimensioned length of this buffer. The dimensioned length refers to the total number of bytes that have been allocated and the logical length refers to the actual length of the buffer.unsigned MemoryBuffer::GetLength()
- Public member function that returns the logical length of this buffer. The logical length refers to the actual length of the buffer and the dimensioned length refers to the total number of bytes that have been allocated for this buffer. - Public member function used to grow this buffer by the "grow by" value set when this object was constructed or the current grow by value. - Public member function that returns true if this buffer is null.void MemoryBuffer::Load(const void *buf, unsigned Bytes)
- Public member function used to load the memory buffer.void MemoryBuffer::SetLength(unsigned Bytes)
- Public member function used to set the logical length of this buffer to a specified number of bytes. - Public member function that returns true if this buffer is null.unsigned MemoryBuffer::length()
- Public member function that returns the logical length of this buffer. The logical length refers to the actual length of the buffer and the dimensioned length refers to the total number of bytes that have been allocated for this buffer.unsigned char *MemoryBuffer::m_buf()
- Public member function that returns a pointer to the memory buffer.const unsigned char *MemoryBuffer::m_buf()
- Public member function that returns a pointer to the memory buffer.void MemoryBuffer::operator+=(const MemoryBuffer &buf)
- Overloaded member operator used to concatenate a memory buffer to the end of the object that invoked the call.void MemoryBuffer::operator+=(const unsigned char &byte)
- Overloaded member operator used to concatenate a single byte to the end of the object that invoked the call.void MemoryBuffer::operator+=(const char &byte)
- Overloaded member operator used to concatenate a single byte to the end of the object that invoked the call.MemoryBuffer &MemoryBuffer::operator=(const MemoryBuffer &buf)
- Class assignment operator used to assign one object to another using share semantics. This assignment operator unbinds the buffer from its data and binds it to the data shared by object "buf".unsigned char& MemoryBuffer::operator[](unsigned i)
- Overloaded subscript operator used to ensure that an index is in range before subscripting this object's data. If the index is out of range the index value will be set to the logical length.int MemoryBuffer::resize(unsigned bytes, int keep = 0)
- Public member function used to resize the logical length of the buffer. If the "keep" variable is true the old data will be copied into the new space. By default the old data will be deleted. Returns false if the buffer's logical length cannot be changed.
End Of Document |