#include <core.h>
Public Types | |
using | value_type = T |
using | const_reference = const T & |
Public Member Functions | |
buffer (const buffer &)=delete | |
void | operator= (const buffer &)=delete |
virtual | ~buffer ()=default |
T * | begin () FMT_NOEXCEPT |
T * | end () FMT_NOEXCEPT |
std::size_t | size () const FMT_NOEXCEPT |
std::size_t | capacity () const FMT_NOEXCEPT |
T * | data () FMT_NOEXCEPT |
const T * | data () const FMT_NOEXCEPT |
void | resize (std::size_t new_size) |
void | clear () |
void | reserve (std::size_t new_capacity) |
void | push_back (const T &value) |
template<typename U > | |
void | append (const U *begin, const U *end) |
T & | operator[] (std::size_t index) |
const T & | operator[] (std::size_t index) const |
Protected Member Functions | |
buffer (std::size_t sz) FMT_NOEXCEPT | |
buffer (T *p=nullptr, std::size_t sz=0, std::size_t cap=0) FMT_NOEXCEPT | |
void | set (T *buf_data, std::size_t buf_capacity) FMT_NOEXCEPT |
virtual void | grow (std::size_t capacity)=0 |
Private Attributes | |
T * | ptr_ |
std::size_t | size_ |
std::size_t | capacity_ |
A contiguous memory buffer with an optional growing ability.
using const_reference = const T& |
using value_type = T |
|
protected |
|
virtualdefault |
void append | ( | const U * | begin, |
const U * | end | ||
) |
Appends data to the end of the buffer.
Definition at line 527 of file format.h.
Referenced by internal::reset_color(), internal::vformat_to(), and formatbuf< Char >::xsputn().
T* begin | ( | ) |
Definition at line 603 of file core.h.
Referenced by formatter< std::tm, Char >::format().
std::size_t capacity | ( | ) | const |
Returns the capacity of this buffer.
Definition at line 610 of file core.h.
Referenced by formatter< std::tm, Char >::format(), basic_memory_buffer< Char >::move(), internal::snprintf_float(), and bigint::~bigint().
T* data | ( | ) |
Returns a pointer to the buffer data.
Definition at line 613 of file core.h.
Referenced by bigint::assign(), bigint::divmod_assign(), internal::fallback_format(), fallback_formatter< T, Char, enable_if_t< is_streamable< T, Char >::value > >::format(), formatter< std::chrono::duration< Rep, Period >, Char >::format(), internal::format_float(), basic_memory_buffer< Char >::move(), internal::report_error(), internal::snprintf_float(), to_string(), vfprintf(), vprint(), internal::write(), and basic_writer< Range >::write().
const T* data | ( | ) | const |
T* end | ( | ) |
Definition at line 604 of file core.h.
Referenced by formatter< std::tm, Char >::format().
|
protectedpure virtual |
Increases the buffer capacity to hold at least capacity elements.
Implemented in container_buffer< Container >, basic_memory_buffer< T, SIZE, Allocator >, basic_memory_buffer< bigit, bigits_capacity >, and basic_memory_buffer< Char >.
|
delete |
void push_back | ( | const T & | value | ) |
Definition at line 634 of file core.h.
Referenced by internal::format_float(), bigint::multiply(), bigint::operator<<=(), formatbuf< Char >::overflow(), vprint(), and basic_writer< Range >::write().
void reserve | ( | std::size_t | new_capacity | ) |
Reserves space to store at least capacity elements.
Definition at line 630 of file core.h.
Referenced by formatter< std::tm, Char >::format(), and internal::snprintf_float().
void resize | ( | std::size_t | new_size | ) |
Resizes the buffer. If T is a POD type new elements may not be initialized.
Definition at line 621 of file core.h.
Referenced by bigint::assign(), bigint::divmod_assign(), internal::fallback_format(), formatter< std::tm, Char >::format(), formatter< internal::bigint >::format(), internal::format_float(), format_system_error(), internal::format_value(), bigint::remove_leading_zeros(), internal::snprintf_float(), and bigint::square().
|
protected |
Sets the buffer data and capacity.
Definition at line 587 of file core.h.
Referenced by basic_memory_buffer< Char >::move().
std::size_t size | ( | ) | const |
Returns the size of this buffer.
Definition at line 607 of file core.h.
Referenced by bigint::assign(), bigint::divmod_assign(), fallback_formatter< T, Char, enable_if_t< is_streamable< T, Char >::value > >::format(), formatter< std::tm, Char >::format(), formatter< std::chrono::duration< Rep, Period >, Char >::format(), formatter< internal::bigint >::format(), format_system_error(), internal::format_value(), basic_memory_buffer< Char >::move(), bigint::multiply(), bigint::num_bigits(), basic_writer< Range >::int_writer< Int, Specs >::num_writer::operator()(), bigint::operator<<=(), bigint::remove_leading_zeros(), internal::report_error(), internal::snprintf_float(), bigint::square(), bigint::subtract_aligned(), to_string(), vfprintf(), vprint(), internal::write(), and basic_writer< Range >::write().