12#include "MantidAPI/DllConfig.h"
99 : m_systemError(
""), m_userInfo(info), m_filepath(
"") {};
101 ScriptRepoException(
const std::string &info,
const std::string &system,
const std::string &file = std::string(),
105 const char *what() const noexcept override;
109 const
std::
string &systemError()
const {
return m_systemError; };
111 const std::string &
filePath()
const {
return m_filepath; };
298 virtual const std::string &
description(
const std::string &path) = 0;
362 virtual void download(
const std::string &file_path) = 0;
393 virtual void install(
const std::string &local_path) = 0;
405 virtual void connect(
const std::string &webserverurl =
"") = 0;
The ScriptRepository class is intended to be used mainly by users, who will want to share and downloa...
std::string m_systemError
Technical description of the error, returned by systemError().
const std::string & filePath() const
Returns the file and position where the error was caused.
std::string m_filepath
Path to the file where the error originated, returned by filePath().
std::string m_userInfo
User-facing message, returned by what().
ScriptRepoException(const std::string &info=std::string("Unknown Exception"))
default constructor
virtual void setIgnorePatterns(const std::string &patterns)=0
Define the file patterns that will not be listed by listFiles.
virtual bool isValid()=0
Check whether the local repository exists.
virtual int setAutoUpdate(const std::string &path, bool option=true)=0
Define the AutoUpdate option, which determines whether a file is updated as soon as new versions are ...
virtual void install(const std::string &local_path)=0
Install, at the given local_path, the resources that allow the ScriptRepository to operate locally.
virtual const std::string & description(const std::string &path)=0
Provide the description of the file at the given path.
virtual std::string ignorePatterns()=0
Return the ignore patterns that were defined through ScriptRepository::setIgnorePatterns.
virtual SCRIPTSTATUS fileStatus(const std::string &file_path)=0
Return the status of the file, according to the status defined in Mantid::API::SCRIPTSTATUS.
virtual ScriptInfo info(const std::string &path)=0
Return information about the script through the Mantid::API::ScriptInfo struct.
virtual std::vector< std::string > listFiles()=0
Return the list of files inside the repository.
virtual void download(const std::string &file_path)=0
Create a copy of the remote file/folder inside the local repository.
virtual void connect(const std::string &webserverurl="")=0
Allow the ScriptRepository to double-check the connection with the web server.
virtual std::vector< std::string > check4Update()=0
Connect to the remote repository and check for updates.
ScriptInfo fileInfo(const std::string &path)
virtual ~ScriptRepository()=default
Virtual destructor (always needed for abstract classes)
std::shared_ptr< ScriptRepository > ScriptRepository_sptr
shared pointer to the ScriptRepository base class
SCRIPTSTATUS
Represent the possible states for a given file:
Helper class which provides the Collimation Length for SANS instruments.
Information about the files inside the repository.
Types::Core::DateAndTime pub_date
Time of the last (remote) update of this file.
bool auto_update
Whether the file is marked for auto-update.
std::string author
Identification of the author of the script.
bool directory
Flag to indicate whether the entry is a directory.