restool新需求,优化编码规范

Signed-off-by: HanSY <hansiyuan1@huawei.com>
This commit is contained in:
HanSY
2025-06-18 19:27:36 +08:00
parent 36ede02e80
commit 32004c48f3
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -17,6 +17,7 @@
#define OHOS_RESTOOL_RESOURCE_TABLE_H
#include <fstream>
#include <map>
#include <memory>
#include <sstream>
#include <unordered_map>
@@ -115,7 +116,7 @@ private:
uint32_t resId = 0;
uint32_t length = 0;
uint32_t valueCount = 0;
std::unordered_map<uint32_t, uint32_t> dataOffset; // <resConfigId, offset>
std::map<uint32_t, uint32_t> dataOffset; // <resConfigId, offset>
};
struct DataHeader {
+1 -1
View File
@@ -315,7 +315,7 @@ void ResourceTable::PrepareResIndex(IdSetHeader &idSetHeader, const TableData &t
ResIndex resIndex;
resIndex.resId = tableData.id;
resIndex.name = tableData.resourceItem.GetName();
resIndex.name = ResourceUtil::GetIdName(tableData.resourceItem.GetName(), resType);
resIndex.length = resIndex.name.length();
idSetHeader.resTypes[resType].resIndexs[tableData.id] = resIndex;
idSetHeader.resTypes[resType].length += ResIndex::RES_INDEX_LEN + resIndex.length;