Adjustment in pkgmgr plugin code 52/87852/2
authorTomasz Iwanek <t.iwanek@samsung.com>
Fri, 9 Sep 2016 12:35:02 +0000 (14:35 +0200)
committerTomasz Iwanek <t.iwanek@samsung.com>
Mon, 12 Sep 2016 10:21:40 +0000 (12:21 +0200)
Run testcases from next changes.

Change-Id: I143cfc1955b478e2eff3c80eb949cc580e01f046

src/common/plugins/plugin_list_parser.cc
src/common/plugins/plugin_list_parser.h
src/common/plugins/plugin_manager.h
src/common/plugins/plugin_xml_parser.h

index b0b05c2..58c4a74 100644 (file)
@@ -132,7 +132,7 @@ const PluginsListParser::PluginList& PluginsListParser::PluginInfoList() const {
 bool PluginsListParser::ReadLinesFromFile(std::vector<std::string>* lines) {
   std::ifstream plugins_file;
 
-  plugins_file.open(path_);
+  plugins_file.open(path_.string());
 
   if (!plugins_file.is_open()) {
     LOG(ERROR) << "File " << path_ << " no open";
index a18f7cf..949b367 100644 (file)
@@ -46,7 +46,8 @@ class PluginInfo {
 class PluginsListParser {
  public:
   using PluginList = std::vector<std::shared_ptr<PluginInfo>>;
-  explicit PluginsListParser(const std::string& path) : path_(path) {}
+  explicit PluginsListParser(const boost::filesystem::path& path)
+      : path_(path) {}
 
   bool Parse();
   const PluginList& PluginInfoList() const;
@@ -54,8 +55,6 @@ class PluginsListParser {
  private:
   enum Column { Flag, Type, Name, Path };
 
-  PluginsListParser() {}
-
   bool ReadLinesFromFile(std::vector<std::string>* lines);
   bool ParsePluginsRawData(const std::vector<std::string>& lines);
   bool SplitPluginLine(const std::string& line,
@@ -71,7 +70,7 @@ class PluginsListParser {
   bool ValidName(const std::string& name);
   bool ValidPath(const std::string& path);
 
-  const std::string path_;
+  const boost::filesystem::path path_;
   std::vector<std::shared_ptr<PluginInfo>> plugin_info_list_;
 };
 
index c3717c8..8e4c4c8 100644 (file)
@@ -24,8 +24,8 @@ class PluginManager {
  public:
   using PluginInfoList = std::vector<std::shared_ptr<PluginInfo>>;
 
-  PluginManager(const std::string& xml_path,
-                const std::string& list_path,
+  PluginManager(const boost::filesystem::path& xml_path,
+                const boost::filesystem::path& list_path,
                 manifest_x* manifest)
       : xml_parser_(xml_path),
         list_parser_(list_path),
index d5cde8a..36a734e 100644 (file)
@@ -5,6 +5,8 @@
 #ifndef COMMON_PLUGINS_PLUGIN_XML_PARSER_H_
 #define COMMON_PLUGINS_PLUGIN_XML_PARSER_H_
 
+#include <boost/filesystem/path.hpp>
+
 #include <libxml2/libxml/xmlreader.h>
 
 #include <string>
@@ -16,7 +18,7 @@ namespace common_installer {
 /** this class parse xml file*/
 class PluginsXmlParser {
  public:
-  explicit PluginsXmlParser(const std::string& path)
+  explicit PluginsXmlParser(const boost::filesystem::path& path)
       : path_(path), doc_ptr_(nullptr) {}
   ~PluginsXmlParser();
   bool Parse();
@@ -24,7 +26,7 @@ class PluginsXmlParser {
   xmlDocPtr doc_ptr();
 
  private:
-  const std::string path_;
+  const boost::filesystem::path path_;
   xmlDocPtr doc_ptr_;
   std::vector<std::string> tags_;
   int NextChildElement(xmlTextReaderPtr reader, int depth);