Parameter modification methods.
More...
Parameter modification methods.
Methods for changing libmagic parameter values.
◆ SetParameter() [1/2]
| void Recognition::Magic::MagicPrivate::SetParameter |
( |
Parameters | parameter, |
|
|
std::size_t | value ) |
|
inline |
Set a single parameter value (throwing version).
Changes the value of a libmagic parameter by calling magic_setparam(). Parameters control various internal limits and behaviors.
- Parameters
-
| [in] | parameter | The parameter to set. |
| [in] | value | The new value for the parameter. |
- Exceptions
-
| MagicIsClosed | If instance is not open. |
| MagicSetParameterError | If magic_setparam() fails. |
- libmagic Call
Detail::magic_setparam(
m_cookie.get(), param_constant, &value);
CookieT m_cookie
Definition magic.cpp:1920
- See also
- Magic::SetParameter()
-
GetParameter()
-
LIBMAGIC_PARAMETERS
◆ SetParameter() [2/2]
| bool Recognition::Magic::MagicPrivate::SetParameter |
( |
Parameters | parameter, |
|
|
std::size_t | value, |
|
|
const std::nothrow_t & | tag ) |
|
inlinenodiscardnoexcept |
Set a single parameter value (noexcept version).
Non-throwing variant that returns success/failure status.
- Parameters
-
| [in] | parameter | The parameter to set. |
| [in] | value | The new value for the parameter. |
| [in] | tag | Pass std::nothrow to select this overload. |
- Returns
- true on success, false if closed or setparam fails.
- See also
- Magic::SetParameter(Parameters, std::size_t, const std::nothrow_t&)
-
GetParameter()
◆ SetParameters() [1/2]
| void Recognition::Magic::MagicPrivate::SetParameters |
( |
const ParameterValueMapT & | parameters | ) |
|
|
inline |
Set multiple parameter values (throwing version).
Sets all parameters specified in the map by iterating and calling SetParameter() for each entry.
- Parameters
-
| [in] | parameters | Map from Parameters enum to new values. |
- Exceptions
-
| MagicIsClosed | If instance is not open. |
| MagicSetParameterError | If any magic_setparam() fails. |
- Note
- If an exception is thrown mid-iteration, some parameters may already have been set.
- See also
- Magic::SetParameters(const ParameterValueMapT&)
-
GetParameters()
◆ SetParameters() [2/2]
| bool Recognition::Magic::MagicPrivate::SetParameters |
( |
const ParameterValueMapT & | parameters, |
|
|
const std::nothrow_t & | tag ) |
|
inlinenodiscardnoexcept |
Set multiple parameter values (noexcept version).
Non-throwing variant that returns false on first failure. Uses std::ranges::find_if_not to stop on first error.
- Parameters
-
| [in] | parameters | Map from Parameters enum to new values. |
| [in] | tag | Pass std::nothrow to select this overload. |
- Returns
- true if all parameters set successfully, false if any failed (partial updates may have occurred).
- See also
- Magic::SetParameters(const ParameterValueMapT&, const std::nothrow_t&)
-
GetParameters()