1 #ifndef C4_YML_WRITER_FILE_HPP_
2 #define C4_YML_WRITER_FILE_HPP_
6 #ifndef C4_YML_ERROR_HPP_
25 WriterFile(FILE *f =
nullptr) noexcept : m_file(f ? f : stdout) {}
28 C4_ALWAYS_INLINE
void append(
const char (&a)[N]) noexcept
30 static_assert(N > 1,
"empty string");
31 (void)fwrite(a,
sizeof(
char), N - 1, m_file);
38 C4_SUPPRESS_WARNING_GCC_CLANG_WITH_PUSH(
"-Wsign-conversion")
40 C4_SUPPRESS_WARNING_GCC_CLANG_POP
44 C4_ALWAYS_INLINE
void append(
const char c) noexcept
46 (void)fputc(c, m_file);
49 C4_ALWAYS_INLINE
void append(
const char c,
size_t num_times) noexcept
51 for(
size_t i = 0; i < num_times; ++i)
52 (
void)fputc(c, m_file);
void append(const char(&a)[N]) noexcept
void append(const char c) noexcept
WriterFile(FILE *f=nullptr) noexcept
Error utilities used by ryml.
A writer that outputs to a C file handle, defaulting to stdout.
void append(const char c, size_t num_times) noexcept
void append(csubstr s) noexcept