Shaka Player Embedded
Classes | Public Member Functions | Friends | List of all members
shaka::util::DynamicBuffer Class Reference

#include <dynamic_buffer.h>

Public Member Functions

 DynamicBuffer ()
 
 ~DynamicBuffer ()
 
 DynamicBuffer (const DynamicBuffer &)=delete
 
 DynamicBuffer (DynamicBuffer &&)
 
DynamicBufferoperator= (const DynamicBuffer &)=delete
 
DynamicBufferoperator= (DynamicBuffer &&)
 
size_t Size () const
 
void Clear ()
 
void AppendCopy (const void *buffer, size_t size)
 
std::string CreateString () const
 
void CopyDataTo (uint8_t *dest, size_t size) const
 

Friends

class DynamicBufferTest
 

Detailed Description

Represents a buffer of bytes that can be appended to without unnecessary copies. This does so by storing an array of the sub-buffers it stores. This means that you cannot get a singular data pointer. There are helper methods that can copy this to a contiguous buffer (e.g. std::string).

Definition at line 31 of file dynamic_buffer.h.

Constructor & Destructor Documentation

§ DynamicBuffer() [1/3]

shaka::util::DynamicBuffer::DynamicBuffer ( )

Definition at line 27 of file dynamic_buffer.cc.

§ ~DynamicBuffer()

shaka::util::DynamicBuffer::~DynamicBuffer ( )

Definition at line 28 of file dynamic_buffer.cc.

§ DynamicBuffer() [2/3]

shaka::util::DynamicBuffer::DynamicBuffer ( const DynamicBuffer )
delete

§ DynamicBuffer() [3/3]

shaka::util::DynamicBuffer::DynamicBuffer ( DynamicBuffer &&  )
default

Member Function Documentation

§ AppendCopy()

void shaka::util::DynamicBuffer::AppendCopy ( const void *  buffer,
size_t  size 
)

Appends to the buffer by copying the given data.

Definition at line 40 of file dynamic_buffer.cc.

§ Clear()

void shaka::util::DynamicBuffer::Clear ( )
inline

Clears the contents of the buffer.

Definition at line 45 of file dynamic_buffer.h.

§ CopyDataTo()

void shaka::util::DynamicBuffer::CopyDataTo ( uint8_t *  dest,
size_t  size 
) const

Copies the contents of this buffer to the given buffer.

Definition at line 64 of file dynamic_buffer.cc.

§ CreateString()

std::string shaka::util::DynamicBuffer::CreateString ( ) const
Returns
A new string that contains the data in the buffer.

Definition at line 58 of file dynamic_buffer.cc.

§ operator=() [1/2]

DynamicBuffer& shaka::util::DynamicBuffer::operator= ( const DynamicBuffer )
delete

§ operator=() [2/2]

DynamicBuffer & shaka::util::DynamicBuffer::operator= ( DynamicBuffer &&  )
default

§ Size()

size_t shaka::util::DynamicBuffer::Size ( ) const
Returns
The total size of the buffer, in bytes.

Definition at line 33 of file dynamic_buffer.cc.

Friends And Related Function Documentation

§ DynamicBufferTest

friend class DynamicBufferTest
friend

Definition at line 60 of file dynamic_buffer.h.


The documentation for this class was generated from the following files: