A writer that outputs to a C file handle, defaulting to stdout.
More...
#include <writer_file.hpp>
|
| | WriterFile (FILE *f=nullptr) noexcept |
| 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 that outputs to a C file handle, defaulting to stdout.
This writer is much faster than WriterOStream and should be preferred to it.
Definition at line 21 of file writer_file.hpp.
◆ WriterFile()
| c4::yml::WriterFile::WriterFile |
( |
FILE * | f = nullptr | ) |
|
|
inlinenoexcept |
◆ append() [1/4]
template<size_t N>
| void c4::yml::WriterFile::append |
( |
const char(&) | a[N] | ) |
|
|
inlinenoexcept |
Definition at line 28 of file writer_file.hpp.
29 {
30 static_assert(N > 1, "empty string");
31 (void)fwrite(a,
sizeof(
char), N - 1,
m_file);
32 }
◆ append() [2/4]
| void c4::yml::WriterFile::append |
( |
csubstr | s | ) |
|
|
inlinenoexcept |
Definition at line 34 of file writer_file.hpp.
35 {
36 if(s.len)
37 {
38 C4_SUPPRESS_WARNING_GCC_CLANG_WITH_PUSH("-Wsign-conversion")
40 C4_SUPPRESS_WARNING_GCC_CLANG_POP
41 }
42 }
◆ append() [3/4]
| void c4::yml::WriterFile::append |
( |
const char | c | ) |
|
|
inlinenoexcept |
◆ append() [4/4]
| void c4::yml::WriterFile::append |
( |
const char | c, |
|
|
size_t | num_times ) |
|
inlinenoexcept |
Definition at line 49 of file writer_file.hpp.
50 {
51 for(size_t i = 0; i < num_times; ++i)
53 }
◆ m_file
| FILE* c4::yml::WriterFile::m_file |
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_file.hpp