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

Root namespace for the libmagicxx library. More...

Namespaces

namespace  Detail
 Internal namespace for libmagic C library integration.
namespace  Utility
 Utility components for the libmagicxx library.

Classes

class  EmptyPath
 Exception thrown when a path argument is empty. More...
class  FilesystemError
 Exception thrown when a filesystem operation fails. More...
class  Magic
 A modern C++23 wrapper for libmagic — the library that powers the Unix file command. More...
class  MagicDatabaseNotLoaded
 Exception thrown when file identification is attempted without a loaded database. More...
class  MagicException
 Base exception class for all Magic-related errors. More...
class  MagicIdentifyFileError
 Exception thrown when file type identification fails. More...
class  MagicIsClosed
 Exception thrown when an operation is attempted on a closed Magic instance. More...
class  MagicLoadDatabaseFileError
 Exception thrown when Magic::LoadDatabaseFile() fails. More...
class  MagicOpenError
 Exception thrown when Magic::Open() fails. More...
class  MagicSetFlagsError
 Exception thrown when Magic::SetFlags() fails. More...
class  MagicSetParameterError
 Exception thrown when Magic::SetParameter() fails. More...
class  NullTracker
 Exception thrown when a shared ProgressTracker is null. More...
class  PathDoesNotExist
 Exception thrown when a specified path does not exist. More...
class  PathIsNotDirectory
 Exception thrown when a path is expected to be a directory but is not. More...
class  PathIsNotRegularFile
 Exception thrown when a path is expected to be a regular file but is not. More...

Functions

std::string ToString (const Magic::FileTypeEntryT &file_type_entry, const std::string &type_separator=" -> ")
 Convert a file type entry to a string.
std::string ToString (const Magic::FileTypeMapT &file_type_map, const std::string &type_separator=" -> ", const std::string &file_separator="\n")
 Convert a file type map to a string.
std::string ToString (const Magic::ExpectedFileTypeT &expected_file_type)
 Convert an expected file type result to a string.
std::string ToString (const Magic::ExpectedFileTypeEntryT &expected_file_type_entry, const std::string &type_separator=" -> ")
 Convert an expected file type entry to a string.
std::string ToString (const Magic::ExpectedFileTypeMapT &expected_file_type_map, const std::string &type_separator=" -> ", const std::string &file_separator="\n")
 Convert an expected file type map to a string.
std::string ToString (Magic::Flags flag)
 Convert a Magic flag to its string name.
std::string ToString (const Magic::FlagsContainerT &flags, const std::string &separator=", ")
 Convert a container of flags to a string.
std::string ToString (Magic::Parameters parameter)
 Convert a Magic parameter to its string name.
std::string ToString (const Magic::ParameterValueT &parameter_value, const std::string &value_separator=": ")
 Convert a parameter-value pair to a string.
std::string ToString (const Magic::ParameterValueMapT &parameters, const std::string &value_separator=": ", const std::string &parameter_separator=", ")
 Convert a parameter-value map to a string.

Detailed Description

Root namespace for the libmagicxx library.

The Recognition namespace contains all public types and functions provided by the libmagicxx library for file type identification.

Main Components

  • Magic: The primary class for file type identification
  • MagicException: Base exception class and derived exception types
  • Utility: Helper types and functions (ProgressTracker, Percentage, etc.)
Since
10.0.0