HikoGUI
A low latency retained GUI
|
#include <hikogui/utility/exception_intf.hpp>
Public Member Functions | |
template<typename It , typename... Args> | |
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. | |
template<typename It , typename... Args> | |
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. | |
Public Member Functions inherited from std::runtime_error | |
T | runtime_error (T... args) |
T | what (T... args) |
Public Member Functions inherited from std::exception | |
T | what (T... args) |
T | ~exception (T... args) |
T | operator= (T... args) |
T | exception (T... args) |
Static Public Member Functions | |
template<typename It > | |
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. | |
Exception thrown during parsing on an error.
This exception is often thrown due to an error in the syntax in both text and binary files.
The what-string should start with the location of the error in the file followed with ": " and the error message. The what-string may be shown to the user, when the parser was working on user supplied files.
The location for a text file will be: a path followed by line_nr (starting at line 1) and column_nr (starting at column 1). The location for a binary: a path followed by an optional chunk names, followed by a byte number within the chunk.
If there are nested errors, such as an error in an included file, then the what-string may be multiple-lines, where the nested error appears later in the what-string.
|
inlineconstexprnoexcept |
Create a parse error at a specific point in UTF-8 encoded text.
first | An iterator to the start of the text. |
last | An iterator to the position of the character where the error occurred. |
tab_size | The number of spaces a tab character indents. |
msg | A std::format msg. |
args | The arguments for std::format. |
|
inlineconstexprnoexcept |
Create a parse error at a specific point in UTF-8 encoded text.
first | An iterator to the start of the text. |
last | An iterator to the position of the character where the error occurred. |
msg | A std::format msg. |
args | The arguments for std::format. |
|
inlinestaticconstexprnoexcept |
Get the line and column position of an iterator in a UTF-8 string.
first | An iterator to the first character of the text. |
last | An iterator to the character for which the position need to be found. |
tab_size | The number of spaces of indentation for a tab-character. |