|
LibSWOC++ 1.5.14
Solid Wall of C++
|
#include <ArenaWriter.h>


Public Member Functions | |
| ArenaWriter (MemArena &arena) | |
| ArenaWriter & | write (void const *data, size_t n) override |
| ArenaWriter & | write (char c) override |
| Write a single character c to the buffer. | |
| bool | commit (size_t n) override |
Public Member Functions inherited from swoc::FixedBufferWriter | |
| FixedBufferWriter (char *buffer, size_t capacity) | |
| FixedBufferWriter (MemSpan< void > const &span) | |
| Construct using the memory span as the buffer. | |
| FixedBufferWriter (MemSpan< char > const &span) | |
| Construct using the memory span as the buffer. | |
| FixedBufferWriter (std::nullptr_t) | |
| FixedBufferWriter (const FixedBufferWriter &)=delete | |
| FixedBufferWriter & | operator= (const FixedBufferWriter &)=delete |
| FixedBufferWriter (FixedBufferWriter &&that) | |
| Move constructor. | |
| FixedBufferWriter & | operator= (FixedBufferWriter &&that) |
| Move assignment. | |
| self_type & | assign (MemSpan< char > const &span) |
| Reset buffer. | |
| FixedBufferWriter & | write (char c) override |
| Write a single character c to the buffer. | |
| FixedBufferWriter & | write (const void *data, size_t length) override |
| Write length bytes, starting at data, to the buffer. | |
| const char * | data () const override |
| Return the output buffer. | |
| bool | error () const override |
| char * | aux_data () override |
| size_t | capacity () const override |
| Get the total capacity of the output buffer. | |
| size_t | extent () const override |
| Get the total output sent to the writer. | |
| bool | commit (size_t n) override |
| Advance the used part of the output buffer. | |
| self_type & | discard (size_t n) override |
| Drop n characters from the end of the buffer. | |
| self_type & | restrict (size_t n) override |
| Reduce the capacity by n. | |
| self_type & | restore (size_t n) override |
| Restore n bytes of the capacity. | |
| FixedBufferWriter & | copy (size_t dst, size_t src, size_t n) override |
| Copy data in the buffer. | |
| self_type & | clear () |
| self_type & | detach () |
| swoc::TextView | view () const |
| operator std::string_view () const | |
Provide a string_view of all successfully written characters as a user conversion. | |
| operator swoc::TextView () const | |
Provide a string_view of all successfully written characters as a user conversion. | |
| std::ostream & | operator>> (std::ostream &stream) const override |
| Output the buffer contents to the stream. | |
| BufferWriter & | write (MemSpan< void const > span) |
Public Member Functions inherited from swoc::BufferWriter | |
| BufferWriter & | write (MemSpan< void const > span) |
| size_t | size () const |
| size_t | remaining () const |
| MemSpan< char > | aux_span () |
| template<typename... Args> | |
| BufferWriter & | print (const TextView &fmt, Args &&...args) |
| template<typename... Args> | |
| BufferWriter & | print_v (const TextView &fmt, const std::tuple< Args... > &args) |
| template<typename... Args> | |
| BufferWriter & | print (const bwf::Format &fmt, Args &&...args) |
| template<typename... Args> | |
| BufferWriter & | print_v (const bwf::Format &fmt, const std::tuple< Args... > &args) |
| template<typename Binding, typename Extractor> | |
| BufferWriter & | print_nfv (Binding &&names, Extractor &&ex, bwf::ArgPack const &args) |
| template<typename Binding, typename Extractor> | |
| BufferWriter & | print_nfv (Binding const &names, Extractor &&ex) |
| template<typename Binding> | |
| BufferWriter & | print_n (Binding const &names, TextView const &fmt) |
| template<typename T> | |
| BufferWriter & | format (bwf::Spec const &spec, T &&t) |
| template<typename T> | |
| BufferWriter & | format (bwf::Spec const &spec, T const &t) |
Protected Member Functions | |
| void | realloc (size_t n) |
Protected Member Functions inherited from swoc::FixedBufferWriter | |
| FixedBufferWriter (char *buffer, size_t capacity, bool noexcept_flag) noexcept | |
Protected Attributes | |
| MemArena & | _arena |
| Arena for the buffer. | |
Protected Attributes inherited from swoc::FixedBufferWriter | |
| char *const | _buffer |
| Output buffer. | |
| size_t | _capacity |
| Size of output buffer. | |
| size_t | _attempted = 0 |
| Number of characters written, including those discarded due error condition. | |
Buffer writer for a MemArena.
This provides formatted output to the remnant of a MemArena. The output resides in uncommitted arena memory and must be committed externally. This will resize the remnant as needed to contain the output without overflow. Because it uses the remnant, if there is an error or resizing, no arena memory will be lost.
Definition at line 21 of file ArenaWriter.h.
|
inline |
|
overridevirtual |
Mark bytes as in use.
| n | Number of bytes to include in the used buffer. |
true if successful, false if additional buffer space was required. Implements swoc::BufferWriter.
Definition at line 30 of file ArenaWriter.cc.
|
protected |
Reallocate the buffer to increase the capacity.
| n | Total size required. |
Definition at line 39 of file ArenaWriter.cc.
|
overridevirtual |
Write a single character c to the buffer.
Implements swoc::BufferWriter.
Definition at line 12 of file ArenaWriter.cc.
|
overridevirtual |
Write data to the buffer.
| data | Data to write. |
| n | Amount of data in bytes. |
Reimplemented from swoc::BufferWriter.
Definition at line 21 of file ArenaWriter.cc.
|
protected |
Arena for the buffer.
Definition at line 52 of file ArenaWriter.h.