exceptions.h 838 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. // UTF-8 exceptions
  2. //
  3. // Platform: ISO C++ 98/11
  4. // $Id$
  5. //
  6. // (c) __vic 2013
  7. #ifndef __VIC_UTF8_EXCEPTIONS_H
  8. #define __VIC_UTF8_EXCEPTIONS_H
  9. #include<__vic/defs.h>
  10. #include<exception>
  11. namespace __vic { namespace utf8 {
  12. //////////////////////////////////////////////////////////////////////////////
  13. struct bad_encoding : public std::exception {};
  14. struct no_leading_byte : public bad_encoding
  15. {
  16. const char *what() const noexcept;
  17. };
  18. struct truncated_code_point : public bad_encoding
  19. {
  20. const char *what() const noexcept;
  21. };
  22. struct overlong_encoding : public bad_encoding
  23. {
  24. const char *what() const noexcept;
  25. };
  26. struct code_point_too_big : public bad_encoding
  27. {
  28. const char *what() const noexcept;
  29. };
  30. //////////////////////////////////////////////////////////////////////////////
  31. }} // namespace
  32. #endif // header guard