mirror of
https://github.com/openharmony/developtools_global_resource_tool.git
synced 2026-07-21 06:55:24 -04:00
删除libxml2和sqlites相关依赖
Signed-off-by: fangyunzhong <fangyunzhong2@huawei.com>
This commit is contained in:
@@ -14,11 +14,10 @@
|
||||
*/
|
||||
|
||||
#include "reference_parser.h"
|
||||
#include<iostream>
|
||||
#include<regex>
|
||||
#include <iostream>
|
||||
#include <regex>
|
||||
#include "file_entry.h"
|
||||
#include "restool_errors.h"
|
||||
#include "xml_key_node.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace Global {
|
||||
@@ -33,10 +32,8 @@ const map<string, ResType> ReferenceParser::ID_REFS = {
|
||||
{ "^\\$profile:", ResType::PROF },
|
||||
{ "^\\$integer:", ResType::INTEGER },
|
||||
{ "^\\$string:", ResType::STRING },
|
||||
{ "^\\$layout:", ResType::LAYOUT },
|
||||
{ "^\\$pattern:", ResType::PATTERN },
|
||||
{ "^\\$plural:", ResType::PLURAL },
|
||||
{ "^\\$graphic:", ResType::GRAPHIC },
|
||||
{ "^\\$theme:", ResType::THEME }
|
||||
};
|
||||
|
||||
@@ -49,10 +46,8 @@ const map<string, ResType> ReferenceParser::ID_OHOS_REFS = {
|
||||
{ "^\\$ohos:profile:", ResType::PROF },
|
||||
{ "^\\$ohos:integer:", ResType::INTEGER },
|
||||
{ "^\\$ohos:string:", ResType::STRING },
|
||||
{ "^\\$ohos:layout:", ResType::LAYOUT },
|
||||
{ "^\\$ohos:pattern:", ResType::PATTERN },
|
||||
{ "^\\$ohos:plural:", ResType::PLURAL },
|
||||
{ "^\\$ohos:graphic:", ResType::GRAPHIC },
|
||||
{ "^\\$ohos:theme:", ResType::THEME }
|
||||
};
|
||||
|
||||
@@ -64,29 +59,6 @@ ReferenceParser::~ReferenceParser()
|
||||
{
|
||||
}
|
||||
|
||||
uint32_t ReferenceParser::ParseRefInSolidXml(const vector<string> &solidXmlFolders) const
|
||||
{
|
||||
for (const auto &solidXmlFolder : solidXmlFolders) {
|
||||
string filePath = FileEntry::FilePath(solidXmlFolder)
|
||||
.Append(XmlKeyNode::KEY_TO_FILE_NAME.at(XmlKeyNode::KeyType::CONSTANT)).GetPath();
|
||||
if (!ResourceUtil::FileExist(filePath)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
XmlKeyNode xmlKeyNode;
|
||||
if (!xmlKeyNode.LoadFromFile(filePath, [this](auto &key) -> bool {
|
||||
return ParseRefString(key);
|
||||
})) {
|
||||
return RESTOOL_ERROR;
|
||||
}
|
||||
|
||||
if (!xmlKeyNode.SaveToFile(filePath)) {
|
||||
return RESTOOL_ERROR;
|
||||
}
|
||||
}
|
||||
return RESTOOL_SUCCESS;
|
||||
}
|
||||
|
||||
uint32_t ReferenceParser::ParseRefInResources(map<int32_t, vector<ResourceItem>> &items, const string &output)
|
||||
{
|
||||
for (auto &iter : items) {
|
||||
|
||||
Reference in New Issue
Block a user