pdfmm 0.9.20
Public Member Functions | Protected Member Functions | List of all members
buffer< T > Class Template Referenceabstract

#include <core.h>

Inherited by iterator_buffer< OutputIt, T, Traits >, and iterator_buffer< T *, T >.

Public Member Functions

auto size () const FMT_NOEXCEPT -> size_t
 
auto capacity () const FMT_NOEXCEPT -> size_t
 
auto data () FMT_NOEXCEPT -> T *
 
auto data () const FMT_NOEXCEPT -> const T *
 
void clear ()
 
template<typename U >
void append (const U *begin, const U *end)
 

Protected Member Functions

void set (T *buf_data, size_t buf_capacity) FMT_NOEXCEPT
 
virtual void grow (size_t capacity)=0
 

Detailed Description

template<typename T>
class buffer< T >

\rst A contiguous memory buffer with an optional growing ability. It is an internal class and shouldn't be used directly, only via ~fmtbasic_memory_buffer. \endrst

Member Function Documentation

◆ append()

template<typename T >
template<typename U >
void buffer< T >::append ( const U *  begin,
const U *  end 
)

Appends data to the end of the buffer.

◆ capacity()

template<typename T >
auto buffer< T >::capacity ( ) const -> size_t
inline

Returns the capacity of this buffer.

◆ clear()

template<typename T >
void buffer< T >::clear ( )
inline

Clears this buffer.

◆ data() [1/2]

template<typename T >
auto buffer< T >::data ( ) const -> const T*
inline

Returns a pointer to the buffer data.

◆ data() [2/2]

template<typename T >
auto buffer< T >::data ( ) -> T*
inline

Returns a pointer to the buffer data.

◆ grow()

template<typename T >
virtual void buffer< T >::grow ( size_t  capacity)
protectedpure virtual

Increases the buffer capacity to hold at least capacity elements.

◆ set()

template<typename T >
void buffer< T >::set ( T *  buf_data,
size_t  buf_capacity 
)
inlineprotected

Sets the buffer data and capacity.

◆ size()

template<typename T >
auto buffer< T >::size ( ) const -> size_t
inline

Returns the size of this buffer.