 |
ewmscp
..
|
Go to the documentation of this file.
9 "follow command-line symbolic links in SOURCE",
false);
11 "treat directories recursively",
false);
19 std::string& destination,
30 std::string& destination) {
33 if (dstStat ==
nullptr) {
40 if (dstStat->isDir()) {
47 if (!dstdir.empty()) {
48 if (sources.size() == 1) {
50 if (srcStat && srcStat->isDir()) {
51 pathMap.emplace(sources.front(), dstdir);
62 if (dstdir.empty() &&
pathMap.empty() &&
64 throw std::runtime_error(
"multiple sources and destination is not a directory");
70 stream <<
"no special singleDestination (used for cmdLineRequestProvider only)\n";
82 source,
"stat",
"not found");
86 throw std::runtime_error(
"can't stat " + source);
88 if (sourceStat->isDir()) {
94 throw std::runtime_error(source +
" is a directory");
102 false, copyRequest::clock_type::now()));
107 const std::string& dstpath,
115 std::unique_ptr<const genericStat> dirStat;
116 subdirType(
const std::string& aSrcPath,
117 const std::string& aDstPath,
118 std::unique_ptr<const genericStat>& aDirStat) :
121 dirStat(std::move(aDirStat)) {};
123 std::list<subdirType> subdirs;
127 std::string subpath(srcpath);
129 subpath += entry->getName();
130 std::string destpath(dstpath);
132 destpath += entry->getName();
133 auto entryStat = entry->getStat();
134 if (entryStat->isDir() &&
135 entryStat->device == dirStat.
device &&
137 subdirs.emplace_back(subpath, destpath, entryStat);
143 false, copyRequest::clock_type::now()));
149 for (
auto& subdir : subdirs) {
150 addDirContent(subdir.srcPath, subdir.dstPath, mapEntry, *(subdir.dirStat));
155 false, copyRequest::clock_type::now()));
static options::single< bool > ignoreMissing
options::single< bool > noCopy
options::single< std::string > workDir
class for defining the location of a error message in the source code.
generic stat abstraction class Used to abstract the variants of the stat structure.
virtual bool fIsSet() const
check if this option was set, regardless of from command line or config file
void processSource(const std::string &source) override
const singleMap & getDstPath(const std::string &source, std::string &destination, bool baseNameOnly=false) override
get detstination papth for a given source path
static options::single< bool > recursive
virtual void addDirContent(const std::string &srcpath, const std::string &dstpath, const singleMap &mapEntry, const genericStat &dirStat)
virtual copyRequest::base * newRequest(inputHandler::base *InputHandler, const std::string &aSource, const std::string &aDestination, std::unique_ptr< const genericStat > &aStat, const singleMap &aMapEntry, bool remove, copyRequest::clock_type::time_point timestamp)
outputHandler::base * OutputHandler
#define defineStaticNoArg(var)
defines a static variable that needs no arguments to it's constructor
void prepareMappings(std::vector< std::string > &sources, std::string &destination) override
void printMappings(std::ostream &stream) override
static options::map< std::string, pathMapType > pathMap
virtual std::unique_ptr< const genericStat > getStat(const std::string &path, bool followLink=true)=0
void emit(level aLogLevel, const location &loc, const std::string &aObject, const std::string &aAction, const Args &... args)
function to create and enqueue a message, this is the only way that messages should be created!
#define timerInst(subfunc)
std::pair< std::string, std::string > singleMap
inputHandler::base * InputHandler
virtual void printMappings(std::ostream &stream)
static factoryTemplate< cmdLineRequestProvider > factory
static std::multiset< copyRequest::base *, copyRequest::base::pointerCompare > requestSet
virtual const singleMap & getDstPath(const std::string &source, std::string &destination, bool baseNameOnly=false)
get detstination papth for a given source path
static options::single< bool > quiet('q', "quiet", "be quiet, no prefix to output lines")
static std::string singleDestination
static options::single< bool > dereferenceCmdLine
#define defineStatic(var,...)
defines a static variable and instatitates the constructor with the variable number of arguments.