mirror of
https://github.com/openharmony/developtools_global_resource_tool.git
synced 2026-07-19 19:33:46 -04:00
fix dump script failed
Signed-off-by: sunjie <sunjie69@huawei.com> Change-Id: I9973f2097281175656acba83faac4456b8fe88f7
This commit is contained in:
+12
-3
@@ -288,9 +288,17 @@ void ResourceUtil::StringReplace(string &sourceStr, const string &oldStr, const
|
||||
|
||||
string ResourceUtil::GetLocaleLimitkey(const KeyParam &KeyParam)
|
||||
{
|
||||
string str(reinterpret_cast<const char *>(&KeyParam.value));
|
||||
reverse(str.begin(), str.end());
|
||||
return str;
|
||||
const char *rawValue = reinterpret_cast<const char *>(&KeyParam.value);
|
||||
size_t len = sizeof(KeyParam.value);
|
||||
char tmp[len + 1];
|
||||
int j = 0;
|
||||
for (size_t i = 1; i <= len; i++) {
|
||||
if (*(rawValue + len - i)) {
|
||||
tmp[j++] = *(rawValue + len - i);
|
||||
}
|
||||
}
|
||||
tmp[j] = '\0';
|
||||
return string(tmp);
|
||||
}
|
||||
|
||||
string ResourceUtil::GetDeviceTypeLimitkey(const KeyParam &KeyParam)
|
||||
@@ -332,6 +340,7 @@ string ResourceUtil::GetKeyParamValue(const KeyParam &KeyParam)
|
||||
val = GetResolutionLimitkey(KeyParam);
|
||||
break;
|
||||
case KeyType::LANGUAGE:
|
||||
case KeyType::SCRIPT:
|
||||
case KeyType::REGION:
|
||||
val = GetLocaleLimitkey(KeyParam);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user