Elements 6.3.3
A C++ base framework for the Euclid Software.
Loading...
Searching...
No Matches
DataSyncUtils.h
Go to the documentation of this file.
1
18
23
24#ifndef ELEMENTSSERVICES_ELEMENTSSERVICES_DATASYNC_DATASYNCUTILS_H_
25#define ELEMENTSSERVICES_ELEMENTSSERVICES_DATASYNC_DATASYNCUTILS_H_
26
27#include <string> // for string
28#include <utility> // for pair
29#include <vector> // for vector
30
31#include "ElementsKernel/Export.h" // for ELEMENTS_API
32#include "ElementsKernel/Path.h" // for Item
33
34namespace Elements {
35inline namespace Services {
36namespace DataSync {
37
39using path = Path::Item;
40
47
55
57
58ELEMENTS_API bool checkCall(const std::string& command);
59
61
62ELEMENTS_API bool localDirExists(path localDir);
63
64ELEMENTS_API void createLocalDirOf(path localFile);
65
72
79
81
83
84template <typename T>
85ELEMENTS_API bool valueIsListed(const T& value, const std::vector<T>& list) {
86 const auto& begin = list.begin();
87 const auto& end = list.end();
88 return std::find(begin, end, value) != end;
89}
90
92
93} // namespace DataSync
94} // namespace Services
95} // namespace Elements
96
98
99#endif // ELEMENTSSERVICES_ELEMENTSSERVICES_DATASYNC_DATASYNCUTILS_H_
100
defines the macros to be used for explicit export of the symbols
provide functions to retrieve resources pointed by environment variables
T begin(T... args)
T end(T... args)
T find(T... args)
#define ELEMENTS_API
Dummy definitions for the backward compatibility mode.
Definition Export.h:74
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 valueIsListed(const T &value, const std::vector< T > &list)
ELEMENTS_API bool localDirExists(path localDir)