#include <image_load_error.hpp>
Definition at line 13 of file image_load_error.hpp.
◆ Type
| Enumerator |
|---|
| file_not_found | |
| unsupported_channel_count | |
| other_load_error | |
Definition at line 15 of file image_load_error.hpp.
◆ ImageLoadError()
◆ clone()
| std::unique_ptr< Error > porytiles2::ImageLoadError::clone |
( |
| ) |
const |
|
inlineoverridevirtual |
Creates a polymorphic copy of this error.
The clone pattern is necessary because ChainableResult stores errors as unique_ptr<Error>, and errors need to be copied when building error chains from const references. Each concrete error type must implement this method to return a new instance with the same state.
- Returns
- A unique_ptr to a newly allocated copy of this error
Implements porytiles2::Error.
Definition at line 83 of file image_load_error.hpp.
◆ details()
| std::vector< std::string > porytiles2::ImageLoadError::details |
( |
const TextFormatter & |
formatter | ) |
const |
|
inlineoverridevirtual |
Returns a formatted multi-line string representation of the error.
This method generates a human-readable description of the error, potentially including ANSI formatting codes if the provided TextFormatter indicates TTY output is enabled. Implementations should provide clear, actionable error messages that help users understand what went wrong and potentially how to fix it.
The return value is a vector of strings, where each element represents one line of the error message. Single-line errors return a vector with one element, while multi-line errors can return multiple lines for richer diagnostics.
- Parameters
-
| formatter | The TextFormatter to use for conditional formatting based on TTY status |
- Returns
- A vector of formatted strings describing the error, with each element representing one line
Implements porytiles2::Error.
Definition at line 59 of file image_load_error.hpp.
◆ file_not_found()
| static ImageLoadError porytiles2::ImageLoadError::file_not_found |
( |
const std::string & |
filename | ) |
|
|
inlinestatic |
◆ filename()
| const std::string & porytiles2::ImageLoadError::filename |
( |
| ) |
const |
|
inline |
◆ other_load_error()
| static ImageLoadError porytiles2::ImageLoadError::other_load_error |
( |
const std::string & |
filename, |
|
|
const std::string & |
error_msg |
|
) |
| |
|
inlinestatic |
◆ params()
◆ type()
| Type porytiles2::ImageLoadError::type |
( |
| ) |
const |
|
inline |
◆ unsupported_channel_count()
| static ImageLoadError porytiles2::ImageLoadError::unsupported_channel_count |
( |
const std::string & |
filename, |
|
|
int |
channel_count |
|
) |
| |
|
inlinestatic |
The documentation for this class was generated from the following file: