Rosetta
|
#include <format.h>
Public Types | |
using | value_type = T |
using | const_reference = const 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) FMT_NOEXCEPT | |
basic_memory_buffer & | operator= (basic_memory_buffer &&other) FMT_NOEXCEPT |
Allocator | get_allocator () const |
void | resize (size_t count) |
void | reserve (size_t new_capacity) |
template<typename ContiguousRange > | |
void | append (const ContiguousRange &range) |
![]() | |
buffer (const buffer &)=delete | |
void | operator= (const buffer &)=delete |
T * | begin () FMT_NOEXCEPT |
T * | end () FMT_NOEXCEPT |
const T * | begin () const FMT_NOEXCEPT |
const T * | end () const FMT_NOEXCEPT |
size_t | size () const FMT_NOEXCEPT |
size_t | capacity () const FMT_NOEXCEPT |
T * | data () FMT_NOEXCEPT |
const T * | data () const FMT_NOEXCEPT |
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 > | |
T & | operator[] (I index) |
template<typename I > | |
const T & | operator[] (I index) const |
Protected Member Functions | |
void | grow (size_t size) final FMT_OVERRIDE |
![]() | |
buffer (size_t sz) FMT_NOEXCEPT | |
buffer (T *p=nullptr, size_t sz=0, size_t cap=0) FMT_NOEXCEPT | |
~buffer ()=default | |
void | set (T *buf_data, size_t buf_capacity) FMT_NOEXCEPT |
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 one of the following type aliases for common character types:
+-------------—+---------------------------—+ | Type | Definition | +================+==============================+ | memory_buffer | basic_memory_buffer<char> | +-------------—+---------------------------—+ | wmemory_buffer | basic_memory_buffer<wchar_t> | +-------------—+---------------------------—+
Example**::
fmt::memory_buffer out; format_to(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 basic_memory_buffer< T, SIZE, Allocator >::const_reference = const T& |
using basic_memory_buffer< T, SIZE, Allocator >::value_type = T |
|
inlineexplicit |
References detail::buffer< T >::set().
|
inline |
|
inline |
\rst Constructs a :class:fmt::basic_memory_buffer
object moving the content of the other object to it. \endrst
References basic_memory_buffer< T, SIZE, Allocator >::move().
|
inline |
References range.
|
inlineprivate |
References basic_memory_buffer< T, SIZE, Allocator >::alloc_, detail::buffer< T >::capacity(), detail::buffer< T >::data(), and basic_memory_buffer< T, SIZE, Allocator >::store_.
Referenced by basic_memory_buffer< T, SIZE, Allocator >::operator=(), and basic_memory_buffer< T, SIZE, Allocator >::~basic_memory_buffer().
|
inline |
|
finalprotectedvirtual |
Increases the buffer capacity to hold at least capacity elements.
Implements detail::buffer< T >.
|
inlineprivate |
References basic_memory_buffer< T, SIZE, Allocator >::alloc_, detail::buffer< T >::capacity(), detail::buffer< T >::data(), detail::make_checked(), basic::options::OptionKeys::stepwise::move, basic_memory_buffer< T, SIZE, Allocator >::resize(), detail::buffer< T >::set(), detail::buffer< T >::size(), and basic_memory_buffer< T, SIZE, Allocator >::store_.
Referenced by basic_memory_buffer< T, SIZE, Allocator >::basic_memory_buffer(), and basic_memory_buffer< T, SIZE, Allocator >::operator=().
|
inline |
\rst Moves the content of the other basic_memory_buffer
object to this one. \endrst
References basic_memory_buffer< T, SIZE, Allocator >::deallocate(), FMT_ASSERT, and basic_memory_buffer< T, SIZE, Allocator >::move().
|
inline |
Increases the buffer capacity to new_capacity.
References detail::buffer< T >::try_reserve().
|
inline |
Resizes the buffer to contain count elements. If T is a POD type new elements may not be initialized.
References detail::buffer< T >::try_resize().
Referenced by PyMOL-Rosetta-relay-client.SecretInputDialog::__init__(), detail::bigint::align(), detail::bigint::assign(), basic_memory_buffer< T, SIZE, Allocator >::move(), detail::bigint::remove_leading_zeros(), and detail::bigint::square().
|
private |
|
private |