Libmagicxx v9.0.2
A C++ wrapper library over the Magic Number Recognition Library.
Loading...
Searching...
No Matches
recognition Namespace Reference

Namespaces

namespace  detail
 
namespace  utility
 

Classes

class  empty_path
 Exception thrown when a path is empty. More...
 
class  filesystem_error
 Exception thrown when the underlying std::filesystem OS API fails. More...
 
class  magic
 The magic class provides a C++ wrapper over the Magic Number Recognition Library. More...
 
class  magic_database_not_loaded
 Exception thrown when magic database is not loaded. More...
 
class  magic_exception
 The base class for all exceptions thrown by the magic class. More...
 
class  magic_identify_file_error
 Exception thrown when magic::identify_file(s) fails. More...
 
class  magic_is_closed
 Exception thrown when magic is closed. More...
 
class  magic_load_database_file_error
 Exception thrown when magic::load_database_file fails. More...
 
class  magic_open_error
 Exception thrown when magic::open fails. More...
 
class  magic_set_flags_error
 Exception thrown when magic::set_flags fails. More...
 
class  magic_set_parameter_error
 Exception thrown when magic::set_parameter(s) fails. More...
 
class  null_tracker
 Exception thrown when a shared progress_tracker is null. More...
 
class  path_does_not_exist
 Exception thrown when a path does not exist. More...
 
class  path_is_not_directory
 Exception thrown from magic::identify_files(directory) when the path is not a directory. More...
 
class  path_is_not_regular_file
 Exception thrown from magic::load_database_file when the database file path is not a regular file. More...
 

Functions

std::string to_string (const magic::type_of_a_file_t &type_of_a_file, const std::string &type_separator=" -> ")
 Convert the magic::type_of_a_file_t to string.
 
std::string to_string (const magic::types_of_files_t &types_of_files, const std::string &type_separator=" -> ", const std::string &file_separator="\n")
 Convert the magic::types_of_files_t to string.
 
std::string to_string (const magic::expected_file_type_t &expected_file_type)
 Convert the magic::expected_file_type_t to string.
 
std::string to_string (const magic::expected_type_of_a_file_t &expected_type_of_a_file, const std::string &type_separator=" -> ")
 Convert the magic::expected_type_of_a_file_t to string.
 
std::string to_string (const magic::expected_types_of_files_t &expected_types_of_files, const std::string &type_separator=" -> ", const std::string &file_separator="\n")
 Convert the magic::expected_types_of_files_t to string.
 
std::string to_string (magic::flags flag)
 Convert the magic::flags to string.
 
std::string to_string (const magic::flags_container_t &flags, const std::string &separator=", ")
 Convert the magic::flags_container_t to string.
 
std::string to_string (magic::parameters parameter)
 Convert the magic::parameters to string.
 
std::string to_string (const magic::parameter_value_t &parameter_value, const std::string &value_separator=": ")
 Convert the magic::parameter_value_t to string.
 
std::string to_string (const magic::parameter_value_map_t &parameters, const std::string &value_separator=": ", const std::string &parameter_separator=", ")
 Convert the magic::parameter_value_map_t to string.
 

Function Documentation

◆ to_string() [1/10]

std::string recognition::to_string ( const magic::expected_file_type_t & expected_file_type)
nodiscard

Convert the magic::expected_file_type_t to string.

Parameters
[in]expected_file_typeThe expected type of the file.
Returns
The expected_file_type as a string.

◆ to_string() [2/10]

std::string recognition::to_string ( const magic::expected_type_of_a_file_t & expected_type_of_a_file,
const std::string & type_separator = " -> " )
nodiscard

Convert the magic::expected_type_of_a_file_t to string.

Parameters
[in]expected_type_of_a_fileThe expected type of a file.
[in]type_separatorThe separator between the file and its expected type, default is " -> ".
Returns
The expected_type_of_a_file as a string.

◆ to_string() [3/10]

std::string recognition::to_string ( const magic::expected_types_of_files_t & expected_types_of_files,
const std::string & type_separator = " -> ",
const std::string & file_separator = "\n" )
nodiscard

Convert the magic::expected_types_of_files_t to string.

Parameters
[in]expected_types_of_filesThe expected types of each file.
[in]type_separatorThe separator between the file and its expected type, default is " -> ".
[in]file_separatorThe separator between the files, default is "\n".
Returns
The expected_types_of_files as a string.

◆ to_string() [4/10]

std::string recognition::to_string ( const magic::flags_container_t & flags,
const std::string & separator = ", " )
nodiscard

Convert the magic::flags_container_t to string.

Parameters
[in]flagsThe flags.
[in]separatorThe separator between the flags, default is ", ".
Returns
The flags as a string.

◆ to_string() [5/10]

std::string recognition::to_string ( const magic::parameter_value_map_t & parameters,
const std::string & value_separator = ": ",
const std::string & parameter_separator = ", " )
nodiscard

Convert the magic::parameter_value_map_t to string.

Parameters
[in]parametersThe parameters with corresponding values.
[in]value_separatorThe separator between the parameter and its value, default is ": ".
[in]parameter_separatorThe separator between the parameters, default is ", ".
Returns
The parameters as a string.

◆ to_string() [6/10]

std::string recognition::to_string ( const magic::parameter_value_t & parameter_value,
const std::string & value_separator = ": " )
nodiscard

Convert the magic::parameter_value_t to string.

Parameters
[in]parameter_valueThe parameter with corresponding value.
[in]value_separatorThe separator between the parameter and its value, default is ": ".
Returns
The parameter_value as a string.

◆ to_string() [7/10]

std::string recognition::to_string ( const magic::type_of_a_file_t & type_of_a_file,
const std::string & type_separator = " -> " )
nodiscard

Convert the magic::type_of_a_file_t to string.

Parameters
[in]type_of_a_fileThe type of a file.
[in]type_separatorThe separator between the file and its type, default is " -> ".
Returns
The type_of_a_file as a string.

◆ to_string() [8/10]

std::string recognition::to_string ( const magic::types_of_files_t & types_of_files,
const std::string & type_separator = " -> ",
const std::string & file_separator = "\n" )
nodiscard

Convert the magic::types_of_files_t to string.

Parameters
[in]types_of_filesThe types of each file.
[in]type_separatorThe separator between the file and its type, default is " -> ".
[in]file_separatorThe separator between the files, default is "\n".
Returns
The types_of_files as a string.

◆ to_string() [9/10]

std::string recognition::to_string ( magic::flags flag)
nodiscard

Convert the magic::flags to string.

Parameters
[in]flagThe flag.
Returns
The flag as a string.

◆ to_string() [10/10]

std::string recognition::to_string ( magic::parameters parameter)
nodiscard

Convert the magic::parameters to string.

Parameters
[in]parameterThe parameter.
Returns
The parameter as a string.