From 93ddddcae44810052c3852c0d809ddbc01800301 Mon Sep 17 00:00:00 2001 From: Nathan Woods Date: Wed, 12 Oct 2016 21:07:02 -0400 Subject: [PATCH] [Imgtool] Changed a number of callbacks to be std::function instead of old fashioned function pointers --- src/tools/imgtool/imgtool.h | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/tools/imgtool/imgtool.h b/src/tools/imgtool/imgtool.h index db51ea75e16..809fdd5b187 100644 --- a/src/tools/imgtool/imgtool.h +++ b/src/tools/imgtool/imgtool.h @@ -14,6 +14,7 @@ #include #include #include +#include #include "corestr.h" #include "formats/flopimg.h" @@ -202,23 +203,23 @@ namespace imgtool unsigned int m_supports_lastmodified_time : 1; unsigned int m_supports_bootblock : 1; /* this module supports loading/storing the boot block */ - imgtoolerr_t(*m_begin_enum) (imgtool::directory *enumeration, const char *path); - imgtoolerr_t(*m_next_enum) (imgtool::directory *enumeration, imgtool_dirent *ent); - void(*m_close_enum) (imgtool::directory *enumeration); - imgtoolerr_t(*m_free_space) (imgtool::partition *partition, UINT64 *size); - imgtoolerr_t(*m_read_file) (imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &destf); - imgtoolerr_t(*m_write_file) (imgtool::partition *partition, const char *filename, const char *fork, imgtool::stream &sourcef, util::option_resolution *opts); - imgtoolerr_t(*m_delete_file) (imgtool::partition *partition, const char *filename); - imgtoolerr_t(*m_list_forks) (imgtool::partition *partition, const char *path, imgtool_forkent *ents, size_t len); - imgtoolerr_t(*m_create_dir) (imgtool::partition *partition, const char *path); - imgtoolerr_t(*m_delete_dir) (imgtool::partition *partition, const char *path); - imgtoolerr_t(*m_list_attrs) (imgtool::partition *partition, const char *path, UINT32 *attrs, size_t len); - imgtoolerr_t(*m_get_attrs) (imgtool::partition *partition, const char *path, const UINT32 *attrs, imgtool_attribute *values); - imgtoolerr_t(*m_set_attrs) (imgtool::partition *partition, const char *path, const UINT32 *attrs, const imgtool_attribute *values); - imgtoolerr_t(*m_attr_name) (UINT32 attribute, const imgtool_attribute *attr, char *buffer, size_t buffer_len); - imgtoolerr_t(*m_get_iconinfo) (imgtool::partition *partition, const char *path, imgtool_iconinfo *iconinfo); - imgtoolerr_t(*m_suggest_transfer)(imgtool::partition *partition, const char *path, imgtool_transfer_suggestion *suggestions, size_t suggestions_length); - imgtoolerr_t(*m_get_chain) (imgtool::partition *partition, const char *path, imgtool_chainent *chain, size_t chain_size); + std::function m_begin_enum; + std::function m_next_enum; + std::function m_close_enum; + std::function m_free_space; + std::function m_read_file; + std::function m_write_file; + std::function m_delete_file; + std::function m_list_forks; + std::function m_create_dir; + std::function m_delete_dir; + std::function m_list_attrs; + std::function m_get_attrs; + std::function m_set_attrs; + std::function m_attr_name; + std::function m_get_iconinfo; + std::function m_suggest_transfer; + std::function m_get_chain; const util::option_guide *m_writefile_optguide; std::string m_writefile_optspec;