Run testcases from next changes.
Change-Id: I143cfc1955b478e2eff3c80eb949cc580e01f046
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";
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;
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,
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_;
};
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),
#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>
/** 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();
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);