1 // Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
2 // Use of this source code is governed by a apache 2.0 license that can be
3 // found in the LICENSE file.
5 #ifndef WGT_EXTENSION_CONFIG_PARSER_H_
6 #define WGT_EXTENSION_CONFIG_PARSER_H_
8 #include <libxml2/libxml/tree.h>
9 #include <manifest_parser/utils/logging.h>
10 #include <manifest_parser/values.h>
11 #include <manifest_parser/manifest_util.h>
18 class ExtensionConfigParser {
20 explicit ExtensionConfigParser(std::string config_xml);
21 std::vector<std::string> GetExtensionPrivilegeList();
23 std::unique_ptr<parser::DictionaryValue> LoadExtensionConfig(
24 const std::string& config_xml);
25 std::string GetNodeDir(xmlNode* node, const std::string& inherit_dir);
26 std::string GetNodeText(xmlNode* root, const std::string& inherit_dir);
27 bool IsPropSupportDir(xmlNode* root, xmlAttr* prop);
28 bool IsTrimRequiredForElement(xmlNode* root);
29 bool IsTrimRequiredForProp(xmlNode* root, xmlAttr* prop);
30 std::unique_ptr<parser::DictionaryValue> LoadXMLNode(
31 xmlNode* root, const std::string& inherit_dir = "");
32 std::string config_xml_;
36 #endif // WGT_EXTENSION_CONFIG_PARSER_H_