32#include <boost/filesystem/operations.hpp>
48 return Configuration::getPath(filename);
52 string silent_command = command +
" > /dev/null";
65 if (fgets(buffer.
data(), BUFSIZ, cmdpipe.
get()) !=
nullptr) {
73 return boost::filesystem::is_directory(local_dir);
77 if (not local_file.has_parent_path()) {
80 const path dir = local_file.parent_path();
82 boost::filesystem::create_directories(dir);
99 return workdir_variable;
104 const string codeen_prefix(workdir_variable);
105 const string prefix_env_variable(codeen_prefix);
110 string uncased(text);
116 string::size_type offset(0);
117 for (
auto substr : substrings) {
118 offset = input.
find(substr, offset);
119 if (offset == string::npos) {
provide functions to retrieve configuration files
Defines a class to handle the Environment.
Python dictionary-like Environment interface.
std::string get(const std::string &index, const std::string &default_value="") const
ELEMENTS_API std::string environmentVariable(std::string name)
Get the value of an environment variable.
ELEMENTS_API std::string getWorkdirVariable()
Get the datasync workdir variable.
ELEMENTS_API const std::string WORKDIR_VAR_VAR
Name of the variable containing the name of the workspace. It that variable is not set or empty,...
ELEMENTS_API const std::string DEFAULT_WORKDIR_VAR
Name of the default variable that contains the path to the work dir.
ELEMENTS_API path confFilePath(path filename)
ELEMENTS_API path localWorkspacePrefix()
ELEMENTS_API std::pair< std::string, std::string > runCommandAndCaptureOutErr(std::string command)
ELEMENTS_API std::string lower(std::string text)
Path::Item path
importing the path item from ElementsKernel
ELEMENTS_API bool checkCall(const std::string &command)
ELEMENTS_API void createLocalDirOf(path localFile)
ELEMENTS_API bool containsInThisOrder(std::string input, std::vector< std::string > substrings)
ELEMENTS_API bool localDirExists(path localDir)