1 // Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
2 // Use of this source code is governed by an apache-2.0 license that can be
3 // found in the LICENSE file.
5 #ifndef HYBRID_STEP_PKGMGR_STEP_GENERATE_XML_H_
6 #define HYBRID_STEP_PKGMGR_STEP_GENERATE_XML_H_
8 #include <boost/filesystem.hpp>
10 #include <common/step/step.h>
11 #include <manifest_parser/utils/logging.h>
12 #include <libxml/tree.h>
19 class StepGenerateXml : public common_installer::Step {
22 explicit StepGenerateXml(common_installer::InstallerContext* context)
23 : Step(context), wgt_doc_(nullptr), tpk_doc_(nullptr) {}
24 Status process() override;
25 Status clean() override { return Status::OK; }
26 Status undo() override { return Status::OK; }
27 Status precheck() override;
30 bool LoadXmlDocument(const boost::filesystem::path& wgt_xml_path,
31 const boost::filesystem::path& tpk_xml_path);
32 xmlNodePtr GetXmlNode(const xmlDocPtr doc, const std::string& name,
33 const std::string& attr = {}, const std::string& attr_val = {});
34 void MergeXmlNode(xmlNodePtr node1, xmlNodePtr node2);
35 void SetXmlNodeAttribute(xmlNodePtr node, const std::string& attr,
36 const std::string& attr_val);
41 STEP_NAME(GenerateXml2);
47 #endif // HYBRID_STEP_PKGMGR_STEP_GENERATE_XML_H_