|
DocWire SDK
DocWire SDK: Award-winning modern data processing in C++20. SourceForge Community Choice & Microsoft support. AI-driven processing. Supports nearly 100 data formats, including email boxes and OCR. Boost efficiency in text extraction, web data extraction, data mining, document analysis. Offline processing possible for security and confidentiality
|
Implementation of the error class for a variadic number of context items. More...
#include <error.h>
Public Member Functions | |
| impl (const std::tuple< T... > &context_tuple, const source_location &location=source_location::current()) | |
| Constructs an error object from a tuple of context items. More... | |
| std::type_info const & | context_type (size_t index) const noexcept override |
| Get the type information of the context. More... | |
| std::string | context_string (size_t index) const override |
| Get the string representation of the context. More... | |
| size_t | context_count () const noexcept override |
| Get the number of context items. More... | |
Public Member Functions inherited from docwire::errors::base | |
| base (const source_location &location=source_location::current()) | |
| Constructs a base object with the current source location. More... | |
| virtual const char * | what () const noexcept override |
| Get the exception type. More... | |
Public Attributes | |
| std::tuple< T... > | context |
| A tuple holding all context items provided when the error was created. | |
Public Attributes inherited from docwire::errors::base | |
| source_location | location |
| The source location where the exception was thrown. | |
Implementation of the error class for a variadic number of context items.
This class is used to throw exceptions with additional context information. It can store multiple context items of different types.
While the errors::impl template can be used directly, it is strongly recommended to use the make_error macro, which correctly handles context creation and source location capture.
The class stores the context items in a tuple and provides methods to access them by index.
| T | The types of the context items. |
|
inlineexplicit |
|
inlineoverridevirtualnoexcept |
Get the number of context items.
Implements docwire::errors::base.
|
inlineoverridevirtual |
Get the string representation of the context.
| index | The index of the context item. |
Implements docwire::errors::base.
|
inlineoverridevirtualnoexcept |
Get the type information of the context.
| index | The index of the context item. |
Implements docwire::errors::base.