Add methods to UpdateScript to retrieve the path which the script was parsed from

This commit is contained in:
Robert Knight 2011-08-21 21:48:13 +01:00
parent 3548f36e8c
commit 2e285f11a8
2 changed files with 8 additions and 0 deletions

View file

@ -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<std::string>& UpdateScript::filesToUninstall() const
return m_filesToUninstall;
}
const std::string UpdateScript::path() const
{
return m_path;
}

View file

@ -38,6 +38,7 @@ class UpdateScript
void parse(const std::string& path);
const std::string path() const;
const std::vector<std::string>& dependencies() const;
const std::vector<UpdateScriptPackage>& packages() const;
const std::vector<UpdateScriptFile>& filesToInstall() const;
@ -47,6 +48,7 @@ class UpdateScript
UpdateScriptFile parseFile(const TiXmlElement* element);
UpdateScriptPackage parsePackage(const TiXmlElement* element);
std::string m_path;
std::vector<std::string> m_dependencies;
std::vector<UpdateScriptPackage> m_packages;
std::vector<UpdateScriptFile> m_filesToInstall;