Rosetta  2020.37
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
fmt::Buffer< T > Class Template Referenceabstract

#include <format.h>

Inheritance diagram for fmt::Buffer< T >:
Inheritance graph
[legend]

Public Member Functions

virtual ~Buffer ()
 
std::size_t size () const
 
std::size_t capacity () const
 
void resize (std::size_t new_size)
 
void reserve (std::size_t capacity)
 
void clear () FMT_NOEXCEPT
 
void push_back (const T &value)
 
template<typename U >
void append (const U *begin, const U *end)
 
Toperator[] (std::size_t index)
 
const Toperator[] (std::size_t index) const
 

Protected Member Functions

 Buffer (T *ptr=FMT_NULL, std::size_t capacity=0)
 
virtual void grow (std::size_t size)=0
 

Protected Attributes

Tptr_
 
std::size_t size_
 
std::size_t capacity_
 

Private Member Functions

 FMT_DISALLOW_COPY_AND_ASSIGN (Buffer)
 

Detailed Description

template<typename T>
class fmt::Buffer< T >

A buffer supporting a subset of std::vector's operations.

Constructor & Destructor Documentation

template<typename T>
fmt::Buffer< T >::Buffer ( T ptr = FMT_NULL,
std::size_t  capacity = 0 
)
inlineprotected
template<typename T>
virtual fmt::Buffer< T >::~Buffer ( )
inlinevirtual

Member Function Documentation

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

Appends data to the end of the buffer.

References fmt::internal::make_ptr(), and fmt::internal::to_unsigned().

Referenced by fmt::BasicWriter< Char >::operator<<().

template<typename T>
std::size_t fmt::Buffer< T >::capacity ( ) const
inline

Returns the capacity of this buffer.

Referenced by fmt::BasicWriter< Char >::write_double().

template<typename T>
void fmt::Buffer< T >::clear ( )
inline
template<typename T>
fmt::Buffer< T >::FMT_DISALLOW_COPY_AND_ASSIGN ( Buffer< T )
private
template<typename T>
virtual void fmt::Buffer< T >::grow ( std::size_t  size)
protectedpure virtual

Increases the buffer capacity to hold at least size elements updating ptr_ and capacity_.

Implemented in fmt::internal::FixedBuffer< Char >, fmt::internal::MemoryBuffer< T, SIZE, Allocator >, and fmt::internal::MemoryBuffer< Char, internal::INLINE_BUFFER_SIZE, Allocator >.

template<typename T>
T& fmt::Buffer< T >::operator[] ( std::size_t  index)
inline
template<typename T>
const T& fmt::Buffer< T >::operator[] ( std::size_t  index) const
inline
template<typename T>
void fmt::Buffer< T >::push_back ( const T value)
inline
template<typename T>
void fmt::Buffer< T >::reserve ( std::size_t  capacity)
inline
template<typename T>
void fmt::Buffer< T >::resize ( std::size_t  new_size)
inline

Resizes the buffer. If T is a POD type new elements may not be initialized.

Referenced by fmt::format_system_error(), and fmt::BasicWriter< Char >::grow_buffer().

template<typename T>
std::size_t fmt::Buffer< T >::size ( ) const
inline

Member Data Documentation

template<typename T>
std::size_t fmt::Buffer< T >::capacity_
protected
template<typename T>
T* fmt::Buffer< T >::ptr_
protected
template<typename T>
std::size_t fmt::Buffer< T >::size_
protected

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