19 typedef enum : uint32_t {
20 INDENT_FLOW_ML = 1u << 0u,
21 FORCE_FLOW_SPC = 1u << 1u,
22 EMIT_NONROOT_KEY = 1u << 2u,
23 EMIT_NONROOT_DASH = 1u << 3u,
24 EMIT_NONROOT_MARKUP = EMIT_NONROOT_KEY|EMIT_NONROOT_DASH,
25 JSON_ERR_ON_STREAM = 1u << 4u,
26 JSON_ERR_ON_TAG = 1u << 5u,
27 JSON_ERR_ON_ANCHOR = 1u << 6u,
28 _JSON_ERR_MASK = JSON_ERR_ON_TAG|JSON_ERR_ON_ANCHOR,
29 DEFAULT_FLAGS = EMIT_NONROOT_KEY|INDENT_FLOW_ML,
54 C4_ALWAYS_INLINE
bool indent_flow_ml() const noexcept {
return (m_flags & INDENT_FLOW_ML) != 0; }
62 C4_ALWAYS_INLINE
bool force_flow_spc() const noexcept {
return (m_flags & FORCE_FLOW_SPC) != 0; }
86 C4_ALWAYS_INLINE
bool emit_nonroot_key() const noexcept {
return (m_flags & EMIT_NONROOT_KEY) != 0; }
92 C4_ALWAYS_INLINE
bool emit_nonroot_dash() const noexcept {
return (m_flags & EMIT_NONROOT_DASH) != 0; }
106 C4_ALWAYS_INLINE
bool json_err_on_stream() const noexcept {
return (m_flags & JSON_ERR_ON_STREAM) != 0; }
111 C4_ALWAYS_INLINE
bool json_err_on_tag() const noexcept {
return (m_flags & JSON_ERR_ON_TAG) != 0; }
116 C4_ALWAYS_INLINE
bool json_err_on_anchor() const noexcept {
return (m_flags & JSON_ERR_ON_ANCHOR) != 0; }
137 return m_max_depth == that.m_max_depth
138 && m_max_cols == that.m_max_cols
139 && m_flags == that.m_flags;
145 id_type m_max_depth{max_depth_default};
146 id_type m_max_cols{max_cols_default};
147 uint32_t m_flags{DEFAULT_FLAGS};
153 RYML_DEPRECATED(
"use .json_err_on_{tag,anchor}()") C4_ALWAYS_INLINE Flags_e json_error_flags() const noexcept {
return static_cast<Flags_e
>(m_flags & _JSON_ERR_MASK); }
154 RYML_DEPRECATED(
"use .json_err_on_{tag,anchor}()") EmitOptions& json_error_flags(Flags_e d) noexcept { m_flags = (d & _JSON_ERR_MASK);
return *
this; }