41 const int status = system(command.
c_str());
53 if (fgets(buffer.
data(), BUFSIZ, cmdpipe.
get()) != NULL) {
61 return boost::filesystem::is_directory(localDir);
65 if (not localFile.has_parent_path()) {
68 const path dir = localFile.parent_path();
70 boost::filesystem::create_directories(dir);
79 const string codeenPrefix(
"WORKSPACE");
80 const string prefixEnvVariable(codeenPrefix);
93 string::size_type offset(0);
94 for (
auto substr : substrings) {
95 offset = input.
find(substr, offset);
96 if (offset == string::npos) {
provide functions to retrieve configuration files
This file is intended to iron out all the differences between systems (currently Linux and MacOSX)
ELEMENTS_API std::string environmentVariable(std::string name)
Get the value of an environment variable.
Elements::Path::Item path
ELEMENTS_API std::string lower(std::string text)
ELEMENTS_API path confFilePath(path filename)
ELEMENTS_API bool localDirExists(path localDir)
ELEMENTS_API bool containsInThisOrder(std::string input, std::vector< std::string > substrings)
ELEMENTS_API void createLocalDirOf(path localFile)
ELEMENTS_API bool checkCall(std::string command)
ELEMENTS_API path localWorkspacePrefix()
ELEMENTS_API std::pair< std::string, std::string > runCommandAndCaptureOutErr(std::string command)
ELEMENTS_API std::string getEnv(const std::string &var)
get a particular environment variable
ELEMENTS_API Path::Item getConfigurationPath(const T &file_name, bool raise_exception=true)