A writer to a memory buffer, in the form of a substr .
More...
#include <writer_buf.hpp>
|
| | WriterBuf (substr sp) noexcept |
| substr | get_result (bool error_on_excess) const |
| | Return the buffer written so far, or optionally throw an error if the buffer was too small.
|
| template<size_t N> |
| void | append (const char(&a)[N]) noexcept |
| void | append (csubstr s) noexcept |
| void | append (const char c) noexcept |
| void | append (const char c, size_t num_times) noexcept |
A writer to a memory buffer, in the form of a substr .
No overflow occurs; the buffer size is strictly respected.
Definition at line 20 of file writer_buf.hpp.
◆ WriterBuf()
| c4::yml::WriterBuf::WriterBuf |
( |
substr | sp | ) |
|
|
inlinenoexcept |
◆ get_result()
| substr c4::yml::WriterBuf::get_result |
( |
bool | error_on_excess | ) |
const |
|
inline |
Return the buffer written so far, or optionally throw an error if the buffer was too small.
Definition at line 31 of file writer_buf.hpp.
32 {
34 {
36 }
37 else if(!error_on_excess)
38 {
42 return sp;
43 }
44 else
45 {
46 _RYML_ERR_BASIC("not enough space in the given buffer");
47 }
48 }
basic_substring< char > substr
a mutable string view
C * str
a restricted pointer to the first character of the substring
◆ append() [1/4]
template<size_t N>
| void c4::yml::WriterBuf::append |
( |
const char(&) | a[N] | ) |
|
|
inlinenoexcept |
Definition at line 53 of file writer_buf.hpp.
54 {
55 static_assert(N > 1, "empty string");
56 _RYML_ASSERT_BASIC( !
m_buf.overlaps(a));
60 }
◆ append() [2/4]
| void c4::yml::WriterBuf::append |
( |
csubstr | s | ) |
|
|
inlinenoexcept |
◆ append() [3/4]
| void c4::yml::WriterBuf::append |
( |
const char | c | ) |
|
|
inlinenoexcept |
◆ append() [4/4]
| void c4::yml::WriterBuf::append |
( |
const char | c, |
|
|
size_t | num_times ) |
|
inlinenoexcept |
◆ m_buf
| substr c4::yml::WriterBuf::m_buf |
◆ m_pos
| size_t c4::yml::WriterBuf::m_pos |
The documentation for this struct was generated from the following file:
- /home/docs/checkouts/readthedocs.org/user_builds/rapidyaml/checkouts/latest/src/c4/yml/writer_buf.hpp