|
Libmagicxx v10.0.3
A modern C++23 wrapper for libmagic — the library that powers the Unix file command.
|
Centralized exception throwing utilities. More...

Functions | |
| template<std::derived_from< MagicException > ExceptionT, typename ResultT, typename... ExceptionArgsT> requires std::same_as<ResultT, int> || std::same_as<ResultT, bool> | |
| static void | Recognition::Magic::MagicPrivate::ThrowExceptionOnFailure (ResultT result, ExceptionArgsT &&... args) |
| Centralized error handling template. | |
Centralized exception throwing utilities.
Template-based error handling for consistent exception throwing across all MagicPrivate methods.
|
inlinestatic |
Centralized error handling template.
Throws an exception of type ExceptionT if the result indicates failure. Works with both boolean and integer result types.
| ExceptionT | Exception type derived from MagicException. |
| ResultT | Either int or bool. |
| ExceptionArgsT | Types of exception constructor arguments. |
| [in] | result | Result to check (false or LIBMAGIC_ERROR = failure). |
| [in] | args | Arguments forwarded to ExceptionT constructor. |
| ExceptionT | If result is false (bool) or -1 (int). |