Libmagicxx v5.1.1
A C++ wrapper library over the Magic Number Recognition Library.
Loading...
Searching...
No Matches
Namespaces | Classes | Functions
recognition Namespace Reference

Namespaces

namespace  detail
 

Classes

class  empty_path
 
class  invalid_path
 
class  magic
 The magic class provides a C++ wrapper over the Magic Number Recognition Library. The magic class is used to identify the type of a file, if the following steps have been completed;. More...
 
class  magic_exception
 The base class for all exceptions thrown by the magic class. More...
 
class  magic_file_error
 
class  magic_is_closed
 
class  magic_load_error
 
class  magic_open_error
 
class  magic_set_flags_error
 
class  magic_set_param_error
 

Functions

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_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_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/7]

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

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/7]

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" )

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() [3/7]

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

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() [4/7]

std::string recognition::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.

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() [5/7]

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" )

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() [6/7]

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

Convert the magic::flags to string.

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

◆ to_string() [7/7]

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

Convert the magic::parameters to string.

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