资源ID固定

Signed-off-by: fangyunzhong <fangyunzhong2@huawei.com>
This commit is contained in:
fangyunzhong
2023-02-02 07:51:07 +00:00
parent a0927f9610
commit fe3382c27f
12 changed files with 309 additions and 51 deletions
+32 -5
View File
@@ -14,11 +14,12 @@
*/
#include "resource_util.h"
#include<algorithm>
#include<fstream>
#include<iostream>
#include<regex>
#include<cstdlib>
#include <algorithm>
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <iomanip>
#include <regex>
#include "file_entry.h"
namespace OHOS {
@@ -369,6 +370,32 @@ string ResourceUtil::PaserKeyParam(const vector<KeyParam> &keyParams)
return result;
}
string ResourceUtil::DecToHexStr(const int32_t i)
{
stringstream ot;
string result;
ot << setiosflags(ios::uppercase) << "0x" << hex << setw(8) << setfill('0') << i;// 0x expadding 8 bit
ot >> result;
return result;
}
bool ResourceUtil::CheckHexStr(const string &hex)
{
if (regex_match(hex, regex("^0[xX][0-9a-fA-F]{8}"))) {
return true;
}
return false;
}
string ResourceUtil::GetAllRestypeString()
{
string result;
for (auto iter = g_contentClusterMap.begin(); iter != g_contentClusterMap.end(); ++iter) {
result = result + "," + iter->first;
}
return result;
}
}
}
}