21 #include <boost/program_options.hpp>
26 namespace ElementsServices {
42 namespace po = boost::program_options;
45 po::options_description options { };
47 (
"host", po::value<string>(),
48 "Hosting solution: iRODS or WebDAV (case insensitive)")
49 (
"host-url", po::value<string>()->default_value(
""),
51 (
"user", po::value<string>()->default_value(
""),
52 "User name if needed")
53 (
"password", po::value<string>()->default_value(
""),
55 (
"overwrite", po::value<string>()->default_value(
"no"),
56 "Allow overwriting local files if they already exist")
57 (
"distant-workspace", po::value<string>(),
58 "Path to distant repository workspace")
59 (
"local-workspace", po::value<string>(),
60 "Path to local repository workspace")
61 (
"tries", po::value<int>()->default_value(4),
62 "Number of download tries");
70 po::store(po::parse_config_file<char>(abs_path.c_str(), options), vm);
78 hostUrl = vm[
"host-url"].as<
string>();
79 user = vm[
"user"].as<
string>();
80 password = vm[
"password"].as<
string>();
84 tries = vm[
"tries"].as<
int>();
89 const string uncased =
lower(name);
90 if (uncased ==
"irods") {
92 }
else if (uncased ==
"webdav") {
102 string uncased =
lower(policy);
105 }
else if (
valueIsListed(uncased, overwriteForbiddenOptions)) {
void parseConfigurationFile(path filename)
ELEMENTS_API bool valueIsListed(const T &value, const std::vector< T > &list)
bool overwritingAllowed() const
Check whether existing local files can be overwritten.
constexpr double e
The base of the natural logarithm .
boost::filesystem::path path
void parseOverwritingPolicy(std::string policy)
Exception raised when a hosting solution is not supported by the tool.
ELEMENTS_API std::string lower(std::string text)
void parseHost(std::string name)
OverwritingPolicy overwritingPolicy
ConnectionConfiguration(path configFile)
Create a dependency configuration by reading a configuration file.
ELEMENTS_API path localWorkspacePrefix()
ELEMENTS_API path confFilePath(path filename)