Add new steps for trust anchor
[platform/core/appfw/wgt-backend.git] / src / wgt / extension_config_parser.h
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.
4
5 #ifndef WGT_EXTENSION_CONFIG_PARSER_H_
6 #define WGT_EXTENSION_CONFIG_PARSER_H_
7
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>
12
13 #include <memory>
14 #include <string>
15 #include <map>
16 #include <vector>
17
18 namespace wgt {
19 class ExtensionConfigParser {
20  public:
21   explicit ExtensionConfigParser(std::string config_xml);
22   std::vector<std::string> GetExtensionPrivilegeList();
23  private:
24   std::unique_ptr<parser::DictionaryValue> LoadExtensionConfig(
25       const std::string& config_xml);
26   std::string GetNodeDir(xmlNode* node, const std::string& inherit_dir);
27   std::string GetNodeText(xmlNode* root, const std::string& inherit_dir);
28   bool IsPropSupportDir(xmlNode* root, xmlAttr* prop);
29   bool IsTrimRequiredForElement(xmlNode* root);
30   bool IsTrimRequiredForProp(xmlNode* root, xmlAttr* prop);
31   std::unique_ptr<parser::DictionaryValue> LoadXMLNode(
32       xmlNode* root, const std::string& inherit_dir = "");
33   std::string config_xml_;
34 };
35
36 }  // namespace wgt
37
38 #endif  // WGT_EXTENSION_CONFIG_PARSER_H_