10#include "../macros.hpp"
18hi_export_module(hikogui.utility.exception : intf);
20hi_export
namespace hi {
inline namespace v1 {
60 template<
typename It,
typename... Args>
61 [[nodiscard]]
constexpr parse_error(It first, It last,
int tab_size,
char const *msg, Args
const&...args) noexcept :
73 template<
typename It,
typename... Args>
74 [[nodiscard]]
constexpr parse_error(It first, It last,
char const *msg, Args
const&...args) noexcept :
90 auto column_nr = 0_uz;
92 auto c32 =
char32_t{};
93 auto continue_count =
int{};
94 while (first != last) {
95 auto const c8 = char_cast<char8_t>(*first++);
97 if ((c8 & 0xc0) == 0x80) {
102 }
else if (c8 & 0x80) {
103 continue_count = std::countl_one(c8) - 1;
104 c32 = c8 & (0b00'111'111 >> continue_count);
111 if (not continue_count) {
126 column_nr /= tab_size;
127 column_nr *= tab_size;
134 return {line_nr, column_nr};
138 template<
typename It,
typename... Args>
140 make_what(It first, It last,
size_t tab_size,
char const *msg, Args
const&...args)
noexcept
143 return {std::format(
"{}:{}: {}", line_nr + 1, column_nr + 1, std::format(msg, args...))};
The HikoGUI namespace.
Definition array_generic.hpp:20
hi_export std::string get_last_error_message()
Get the OS error message from the last error received on this thread.
Definition exception_win32_impl.hpp:30
DOXYGEN BUG.
Definition algorithm_misc.hpp:20
Exception thrown during parsing on an error.
Definition exception_intf.hpp:48
constexpr parse_error(It first, It last, char const *msg, Args const &...args) noexcept
Create a parse error at a specific point in UTF-8 encoded text.
Definition exception_intf.hpp:74
static constexpr std::pair< size_t, size_t > get_line_position(It first, It last, size_t tab_size) noexcept
Get the line and column position of an iterator in a UTF-8 string.
Definition exception_intf.hpp:87
constexpr parse_error(It first, It last, int tab_size, char const *msg, Args const &...args) noexcept
Create a parse error at a specific point in UTF-8 encoded text.
Definition exception_intf.hpp:61
Exception thrown when an item was not found.
Definition exception_intf.hpp:149
Exception thrown during execution of a dynamic operation.
Definition exception_intf.hpp:161
Exception thrown during I/O on an error.
Definition exception_intf.hpp:173
Exception thrown during an operating system call.
Definition exception_intf.hpp:184
Definition exception_intf.hpp:189
Definition exception_intf.hpp:194
Definition exception_intf.hpp:199
Definition exception_intf.hpp:204
Definition exception_intf.hpp:209
Cancel error is caused by user pressing cancel.
Definition exception_intf.hpp:218