exceptions.h 753 B

1234567891011121314151617181920212223242526272829303132333435
  1. // UTF-16 exceptions
  2. //
  3. // Platform: ISO C++ 98/11
  4. // $Id$
  5. //
  6. // (c) __vic 2017
  7. #ifndef __VIC_UTF16_EXCEPTIONS_H
  8. #define __VIC_UTF16_EXCEPTIONS_H
  9. #include<__vic/defs.h>
  10. #include<exception>
  11. namespace __vic { namespace utf16 {
  12. //////////////////////////////////////////////////////////////////////////////
  13. struct bad_encoding : public std::exception {};
  14. struct truncated_code_unit : 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 invalid_sequence : public bad_encoding
  23. {
  24. const char *what() const noexcept;
  25. };
  26. //////////////////////////////////////////////////////////////////////////////
  27. }} // namespace
  28. #endif // header guard