Libmagicxx v10.0.3
A modern C++23 wrapper for libmagic — the library that powers the Unix file command.
Loading...
Searching...
No Matches
Recognition::MagicIsClosed Class Referencefinal

Exception thrown when an operation is attempted on a closed Magic instance. More...

#include <magic_exception.hpp>

Inheritance diagram for Recognition::MagicIsClosed:
Collaboration diagram for Recognition::MagicIsClosed:

Public Member Functions

 MagicIsClosed ()
 Construct MagicIsClosed exception.
Public Member Functions inherited from Recognition::MagicException
 MagicException (const std::string &function, const std::string &error_message)
 Construct MagicException with function name and error message.

Detailed Description

Exception thrown when an operation is attempted on a closed Magic instance.

This exception is thrown when methods like IdentifyFile(), SetFlags(), or LoadDatabaseFile() are called on a Magic instance that has been closed.

Magic magic;
magic.Close();
magic.IdentifyFile("file.txt"); // Throws MagicIsClosed
A modern C++23 wrapper for libmagic — the library that powers the Unix file command.
Definition magic.hpp:216
FileTypeT IdentifyFile(const std::filesystem::path &path) const
Identify the type of a single file.
Definition magic.cpp:2530
void Close() noexcept
Close the Magic instance.
Definition magic.cpp:2476
See also
Magic::Close()
Magic::IsOpen()
Since
10.0.0

Constructor & Destructor Documentation

◆ MagicIsClosed()

Recognition::MagicIsClosed::MagicIsClosed ( )
inline

Construct MagicIsClosed exception.

Since
10.0.0

The documentation for this class was generated from the following file: