Parameter retrieval methods.
More...
Parameter retrieval methods.
Methods for querying libmagic parameter values.
◆ GetParameter() [1/2]
| std::size_t Recognition::Magic::MagicPrivate::GetParameter |
( |
Parameters | parameter | ) |
const |
|
inlinenodiscard |
Get a single parameter value (throwing version).
Retrieves the current value of the specified libmagic parameter by calling magic_getparam().
- Parameters
-
| [in] | parameter | The parameter to query. |
- Returns
- Current value of the parameter.
- Exceptions
-
| MagicIsClosed | If instance is not open. |
- libmagic Call
Detail::magic_getparam(
m_cookie.get(), param_constant, &value);
CookieT m_cookie
Definition magic.cpp:1920
- See also
- Magic::GetParameter()
-
SetParameter()
-
LIBMAGIC_PARAMETERS
◆ GetParameter() [2/2]
| std::optional< std::size_t > Recognition::Magic::MagicPrivate::GetParameter |
( |
Parameters | parameter, |
|
|
const std::nothrow_t & | tag ) const |
|
inlinenodiscardnoexcept |
Get a single parameter value (noexcept version).
Non-throwing variant that returns std::nullopt if the instance is not open.
- Parameters
-
| [in] | parameter | The parameter to query. |
| [in] | tag | Pass std::nothrow to select this overload. |
- Returns
- Current value of the parameter, or std::nullopt if closed.
- See also
- Magic::GetParameter(Parameters, const std::nothrow_t&)
-
SetParameter()
◆ GetParameters() [1/2]
Get all parameter values (throwing version).
Retrieves a map of all parameters and their current values by iterating over all Parameters enum values and calling GetParameter() for each.
- Returns
- Map from Parameters enum values to their current values.
- Exceptions
-
| MagicIsClosed | If instance is not open. |
- Implementation
}
static constexpr auto LIBMAGIC_PARAMETER_COUNT
Definition magic.cpp:1960
std::size_t GetParameter(Parameters parameter) const
Get a single parameter value (throwing version).
Definition magic.cpp:720
Parameters
Parameters for tuning Magic behavior limits.
Definition magic.hpp:381
- See also
- Magic::GetParameters()
-
SetParameters()
-
LIBMAGIC_PARAMETER_COUNT
◆ GetParameters() [2/2]
| std::optional< ParameterValueMapT > Recognition::Magic::MagicPrivate::GetParameters |
( |
const std::nothrow_t & | tag | ) |
const |
|
inlinenodiscardnoexcept |
Get all parameter values (noexcept version).
Non-throwing variant that returns std::nullopt if the instance is not open.
- Parameters
-
| [in] | tag | Pass std::nothrow to select this overload. |
- Returns
- Map from Parameters to values, or std::nullopt if closed.
- See also
- Magic::GetParameters(const std::nothrow_t&)
-
SetParameters()