From 509a4fa6a95125b99b6e86aacd8151822aa0214c Mon Sep 17 00:00:00 2001 From: fangyunzhong Date: Sat, 20 May 2023 08:11:16 +0000 Subject: [PATCH] =?UTF-8?q?id=5Fdefined.json=E5=8A=9F=E8=83=BD=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=96=87=E4=BB=B6=E5=91=BD=E4=BB=A4=E8=A7=A3=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: fangyunzhong --- include/cmd_list.h | 5 ++++- include/resource_data.h | 2 +- src/cmd_list.cpp | 50 ++++++++++++++++++++++++----------------- 3 files changed, 34 insertions(+), 23 deletions(-) diff --git a/include/cmd_list.h b/include/cmd_list.h index 51892d7..2fbd116 100644 --- a/include/cmd_list.h +++ b/include/cmd_list.h @@ -30,9 +30,12 @@ public: using HandleBack = std::function; uint32_t Init(const std::string &filePath, HandleBack callback); private: + void InitFileListCommand(Json::Value &root, HandleBack callback); + using HandleFileListValue = std::function; + std::vector fileListHandles_; uint32_t GetString(const Json::Value &node, int c, HandleBack callback); uint32_t GetArray(const Json::Value &node, int c, HandleBack callback); - uint32_t GetModuleNames(const Json::Value &node, HandleBack callback); + uint32_t GetModuleNames(const Json::Value &node, int c, HandleBack callback); }; } } diff --git a/include/resource_data.h b/include/resource_data.h index b04f4f3..fe5bc9c 100644 --- a/include/resource_data.h +++ b/include/resource_data.h @@ -38,7 +38,7 @@ const static std::string LONG_PATH_HEAD = "\\\\?\\"; const static std::string ID_DEFINED_INDENTATION = " "; const static int32_t VERSION_MAX_LEN = 128; const static int32_t INT_TO_BYTES = sizeof(uint32_t); -static const int8_t RESTOOL_VERSION[VERSION_MAX_LEN] = { "Restool 4.002" }; +static const int8_t RESTOOL_VERSION[VERSION_MAX_LEN] = { "Restool 4.003" }; const static int32_t TAG_LEN = 4; enum class KeyType { diff --git a/src/cmd_list.cpp b/src/cmd_list.cpp index d12a17e..7afeb44 100644 --- a/src/cmd_list.cpp +++ b/src/cmd_list.cpp @@ -20,7 +20,7 @@ namespace OHOS { namespace Global { namespace Restool { using namespace std; -uint32_t CmdList::Init(const string &filePath, function callback) +uint32_t CmdList::Init(const string &filePath, HandleBack callback) { Json::Value root; if (!ResourceUtil::OpenJsonFile(filePath, root)) { @@ -31,23 +31,12 @@ uint32_t CmdList::Init(const string &filePath, function