diff options
Diffstat (limited to 'src/utf8.hh')
-rw-r--r-- | src/utf8.hh | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/utf8.hh b/src/utf8.hh index 8b90bd75..108ca824 100644 --- a/src/utf8.hh +++ b/src/utf8.hh @@ -67,6 +67,13 @@ public: m_codepoint = 0xfffdU; } + inline bool flush() noexcept { + auto state = m_state; + if (m_state != ACCEPT) + reset(); + return state != m_state; + } + private: uint32_t m_state{ACCEPT}; uint32_t m_codepoint{0}; |