From 2e285f11a8b16dcff563bd21addfdfd20861437b Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Sun, 21 Aug 2011 21:48:13 +0100 Subject: [PATCH] Add methods to UpdateScript to retrieve the path which the script was parsed from --- src/UpdateScript.cpp | 6 ++++++ src/UpdateScript.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/UpdateScript.cpp b/src/UpdateScript.cpp index 3fc8bb6..3c47891 100644 --- a/src/UpdateScript.cpp +++ b/src/UpdateScript.cpp @@ -14,6 +14,8 @@ void UpdateScript::parse(const std::string& path) TiXmlDocument document(path); if (document.LoadFile()) { + m_path = path; + LOG(Info,"Loaded script from " + path); const TiXmlElement* updateNode = document.RootElement(); @@ -118,4 +120,8 @@ const std::vector& UpdateScript::filesToUninstall() const return m_filesToUninstall; } +const std::string UpdateScript::path() const +{ + return m_path; +} diff --git a/src/UpdateScript.h b/src/UpdateScript.h index ef606aa..bf39878 100644 --- a/src/UpdateScript.h +++ b/src/UpdateScript.h @@ -38,6 +38,7 @@ class UpdateScript void parse(const std::string& path); + const std::string path() const; const std::vector& dependencies() const; const std::vector& packages() const; const std::vector& filesToInstall() const; @@ -47,6 +48,7 @@ class UpdateScript UpdateScriptFile parseFile(const TiXmlElement* element); UpdateScriptPackage parsePackage(const TiXmlElement* element); + std::string m_path; std::vector m_dependencies; std::vector m_packages; std::vector m_filesToInstall;