utf8.status.h.xml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <chapter xml:id="utf8.status.h">
  2. <title><tt>__vic/utf8/status.h</tt></title>
  3. <chapter xml:id="utf8--status">
  4. <title><tt>utf8::status</tt></title>
  5. <code-block lang="C++">
  6. enum class utf8::status
  7. {
  8. ok = 0,
  9. eof,
  10. // Errors
  11. no_leading_byte,
  12. truncated_code_point,
  13. overlong_encoding,
  14. code_point_too_big
  15. };
  16. using utf8::status_t = utf8::status; // for C++98
  17. </code-block>
  18. <p>Values returned by <xref to="utf8--reader"/> <tt>parse()</tt> function.</p>
  19. <list style="bulleted">
  20. <item><tt>ok</tt> - code point successfully read</item>
  21. <item><tt>eof</tt> - no more code points to read</item>
  22. <item><tt>no_leading_byte</tt> - continuation byte w/o leading</item>
  23. <item><tt>truncated_code_point</tt> - incomplete multibyte sequence</item>
  24. <item><tt>overlong_encoding</tt> - overlong encoded code point</item>
  25. <item><tt>code_point_too_big</tt> - code point value is too big</item>
  26. </list>
  27. </chapter>
  28. <chapter xml:id="utf8--is_error">
  29. <title><tt>utf8::is_error()</tt></title>
  30. <code-block lang="C++">
  31. constexpr bool utf8::is_error(utf8::status s);
  32. </code-block>
  33. <p>Returns <tt>false</tt> for <tt>utf8::status::ok</tt> and
  34. <tt>utf8::status::eof</tt> values. <tt>true</tt> is returned otherwise.</p>
  35. </chapter>
  36. <chapter xml:id="utf8--throw_if_error">
  37. <title><tt>utf8::throw_if_error()</tt></title>
  38. <code-block lang="C++">
  39. bool utf8::throw_if_error(utf8::status s);
  40. </code-block>
  41. <p>Throws exception from <xref to="utf8.exceptions.h"/> if
  42. <tt>is_error(s)</tt>. Returns <tt>true</tt> for <tt>utf8::status::ok</tt>
  43. or <tt>false</tt> for <tt>utf8::status::eof</tt>.</p>
  44. </chapter>
  45. </chapter>