4#ifndef MAGIC_EXCEPTION_HPP
5#define MAGIC_EXCEPTION_HPP
19 using std::runtime_error::runtime_error;
29 const std::string& function,
30 const std::string& error_message
34 ? function +
" failed."
35 : function +
" failed with " + error_message +
"."
190 const std::string& error_message,
191 const std::string& database_file_path
194 std::format(
"magic_load_database_file({})", database_file_path),
230 const std::string& error_message,
231 const std::string& file_path
234 std::format(
"magic_identify_file({})", file_path),
255 const std::string& error_message,
256 const std::string& flag_names
259 std::format(
"magic_set_flags({})", flag_names),
281 const std::string& error_message,
282 const std::string& parameter_name,
286 std::format(
"magic_set_parameter({}, {})", parameter_name, value),
empty_path()
Construct empty_path.
Definition magic_exception.hpp:65
filesystem_error(const std::string &path, const std::string &error_message)
Construct filesystem_error with a path and an error message.
Definition magic_exception.hpp:138
magic_database_not_loaded()
Construct magic_database_not_loaded.
Definition magic_exception.hpp:210
magic_exception(const std::string &function, const std::string &error_message)
Construct magic_exception with an error message and the name of the funtion where the error occurred.
Definition magic_exception.hpp:28
magic_identify_file_error(const std::string &error_message, const std::string &file_path)
Construct magic_identify_file_error with an error message, and the path of the file.
Definition magic_exception.hpp:229
magic_is_closed()
Construct magic_is_closed.
Definition magic_exception.hpp:153
magic_load_database_file_error(const std::string &error_message, const std::string &database_file_path)
Construct magic_load_database_file_error with an error message and the path of the database file.
Definition magic_exception.hpp:189
magic_open_error(const std::string &error_message)
Construct magic_open_error with an error message.
Definition magic_exception.hpp:170
magic_set_flags_error(const std::string &error_message, const std::string &flag_names)
Construct magic_set_flags_error with an error message and the names of the flags.
Definition magic_exception.hpp:254
magic_set_parameter_error(const std::string &error_message, const std::string ¶meter_name, std::size_t value)
Construct magic_set_parameter_error with an error message, the name of the parameter and its value.
Definition magic_exception.hpp:280
null_tracker()
Construct null_tracker.
Definition magic_exception.hpp:50
path_does_not_exist(const std::string &path)
Construct path_does_not_exist with the path that does not exist.
Definition magic_exception.hpp:120
path_is_not_directory(const std::string &path)
Construct path_is_not_directory with the path that is not a directory.
Definition magic_exception.hpp:103
path_is_not_regular_file(const std::string &path)
Construct path_is_not_regular_file with the database file path that is not a regular file.
Definition magic_exception.hpp:84