1#ifndef _C4_YML_WRITER_HPP_
2#define _C4_YML_WRITER_HPP_
4#ifndef _C4_YML_ERROR_HPP_
47 (void)fwrite(a,
sizeof(
char), N - 1,
m_file);
53 C4_SUPPRESS_WARNING_GCC_CLANG_WITH_PUSH(
"-Wsign-conversion")
58 C4_SUPPRESS_WARNING_GCC_CLANG_POP
69 for(
size_t i = 0; i < num_times; ++i)
80template<
class OStream>
105 C4_SUPPRESS_WARNING_GCC_CLANG_WITH_PUSH(
"-Wsign-conversion")
110 C4_SUPPRESS_WARNING_GCC_CLANG_POP
121 for(
size_t i = 0; i < num_times; ++i)
143 else if(error_on_excess)
154 _RYML_ASSERT_BASIC( !
m_buf.overlaps(a));
180 for(
size_t i = 0; i < num_times; ++i)
Error utilities used by ryml.
void err_basic(ErrorDataBasic const &errdata, const char *msg)
trigger a basic error to its respective handler, with a non-formatted error message.
basic_substring< char > substr
a mutable string view
basic_substring< const char > csubstr
an immutable string view
void _do_write(csubstr sp)
WriterOStream(OStream &s)
void _do_write(const char(&a)[N])
void _do_write(const char c)
WriterFile(FILE *f=nullptr)
substr _get(bool error_on_excess) const
void _do_write(csubstr sp)
void _do_write(const char c, size_t num_times)
void _do_write(const char c, size_t num_times)
void _do_write(const char(&a)[N])
void _do_write(const char c)
void _do_write(const char(&a)[N])
void _do_write(csubstr sp)
void _do_write(const char c, size_t num_times)
void _do_write(const char c)
(Undefined by default) Use shorter error message from checks/asserts: do not show the check condition...
size_t len
the length of the substring
bool overlaps(ro_substr const that) const noexcept
true if there is overlap of at least one element between that and *this
bool empty() const noexcept
C * str
a restricted pointer to the first character of the substring