|
Libmagicxx v10.0.3
A modern C++23 wrapper for libmagic — the library that powers the Unix file command.
|
Instance lifecycle management. More...

Functions | |
| void | Recognition::Magic::Close () noexcept |
| Close the Magic instance. | |
| static bool | Recognition::Magic::Compile (const std::filesystem::path &database_file=DEFAULT_DATABASE_FILE) noexcept |
| Compile a magic database file. | |
Instance lifecycle management.
Methods for closing instances and compiling databases.
|
noexcept |
Close the Magic instance.
Releases all libmagic resources and transitions the instance to the Closed state. After calling Close(), the instance is no longer valid for file identification until Open() and LoadDatabaseFile() are called again.
|
staticnodiscardnoexcept |
Compile a magic database file.
Static utility method that compiles magic source files into binary format. The compiled file is named with ".mgc" appended to the source filename.
| [in] | database_file | Path to database file to compile (default: DEFAULT_DATABASE_FILE). |