Agora
1.2.0
Agora project
|
#include <format.h>
Public Types | |
using | value_type = T |
using | const_reference = const T & |
Public Types inherited from fmt::v8::detail::buffer< T > | |
using | value_type = T |
using | const_reference = const T & |
Public Member Functions | |
basic_memory_buffer (const Allocator &alloc=Allocator()) | |
~basic_memory_buffer () | |
basic_memory_buffer (basic_memory_buffer &&other) throw () | |
auto | operator= (basic_memory_buffer &&other) -> basic_memory_buffer & throw () |
auto | get_allocator () const -> Allocator |
void | resize (size_t count) |
void | reserve (size_t new_capacity) |
template<typename ContiguousRange > | |
void | append (const ContiguousRange &range) |
Public Member Functions inherited from fmt::v8::detail::buffer< T > | |
buffer (const buffer &)=delete | |
void | operator= (const buffer &)=delete |
auto | begin () -> T * throw () |
auto | end () -> T * throw () |
auto | begin () const -> const T * throw () |
auto | end () const -> const T * throw () |
constexpr auto | size () const -> size_t throw () |
constexpr auto | capacity () const -> size_t throw () |
auto | data () -> T * throw () |
auto | data () const -> const T * throw () |
void | clear () |
void | try_resize (size_t count) |
void | try_reserve (size_t new_capacity) |
void | push_back (const T &value) |
template<typename U > | |
void | append (const U *begin, const U *end) |
template<typename I > | |
auto | operator[] (I index) -> T & |
template<typename I > | |
auto | operator[] (I index) const -> const T & |
Protected Member Functions | |
void | grow (size_t size) override |
Protected Member Functions inherited from fmt::v8::detail::buffer< T > | |
buffer (size_t sz) throw () | |
buffer (T *p=nullptr, size_t sz=0, size_t cap=0) throw () | |
~buffer ()=default | |
buffer (buffer &&)=default | |
void | set (T *buf_data, size_t buf_capacity) throw () |
Private Member Functions | |
void | deallocate () |
void | move (basic_memory_buffer &other) |
Private Attributes | |
T | store_ [SIZE] |
Allocator | alloc_ |
\rst A dynamically growing memory buffer for trivially copyable/constructible types with the first SIZE
elements stored in the object itself.
You can use the memory_buffer
type alias for char
instead.
Example**::
auto out = fmt::memory_buffer(); format_to(std::back_inserter(out), "The answer is {}.", 42);
This will append the following output to the out
object:
.. code-block:: none
The answer is 42.
The output can be converted to an std::string
with to_string(out)
. \endrst
using fmt::v8::basic_memory_buffer< T, SIZE, Allocator >::const_reference = const T& |
using fmt::v8::basic_memory_buffer< T, SIZE, Allocator >::value_type = T |
|
inlineexplicit |
|
inline |
|
inline |
\rst Constructs a :class:fmt::basic_memory_buffer
object moving the content of the other object to it. \endrst
|
inline |
|
inlineprivate |
|
inline |
|
overrideprotectedvirtual |
Increases the buffer capacity to hold at least capacity elements.
Implements fmt::v8::detail::buffer< T >.
|
inlineprivate |
|
inline |
\rst Moves the content of the other basic_memory_buffer
object to this one. \endrst
|
inline |
Increases the buffer capacity to new_capacity.
|
inline |
Resizes the buffer to contain count elements. If T is a POD type new elements may not be initialized.
|
private |
|
private |