Exceptions that may be thrown from the library functions.
| 39 | |
| 40 | // Exceptions that may be thrown from the library functions. |
| 41 | class invalid_code_point : public exception { |
| 42 | uint32_t cp; |
| 43 | public: |
| 44 | invalid_code_point(uint32_t codepoint) : cp(codepoint) {} |
| 45 | virtual const char* what() const UTF_CPP_NOEXCEPT UTF_CPP_OVERRIDE { return "Invalid code point"; } |
| 46 | uint32_t code_point() const {return cp;} |
| 47 | }; |
| 48 | |
| 49 | class invalid_utf8 : public exception { |
| 50 | uint8_t u8; |