 |
ewmscp
..
|
#include <moveRequestProvider.h>
|
| moveRequestProvider (decltype(requests) aRequests, decltype(delayedRequests) aDelayedRequests, decltype(parents) aParents, decltype(InputHandler) aInputHandler, decltype(OutputHandler) aOutputHandler) |
|
| ~moveRequestProvider () override=default |
|
void | processSources (const std::vector< std::string > &sources) override |
|
| cmdLineRequestProvider (decltype(requests) aRequests, decltype(delayedRequests) aDelayedRequests, decltype(parents) aParents, decltype(InputHandler) aInputHandler, decltype(OutputHandler) aOutputHandler) |
|
| ~cmdLineRequestProvider () override=default |
|
bool | isFollowMode () const override |
|
void | prepareMappings (std::vector< std::string > &sources, std::string &destination) override |
|
void | printMappings (std::ostream &stream) override |
|
| noFollowRequestProvider (decltype(requests) aRequests, decltype(delayedRequests) aDelayedRequests, decltype(parents) aParents, decltype(InputHandler) aInputHandler, decltype(OutputHandler) aOutputHandler) |
|
| ~noFollowRequestProvider () override=default |
|
bool | isFollowMode () const override |
|
void | processSources (const std::vector< std::string > &sources) override |
|
| requestProvider (decltype(requests) aRequests, decltype(delayedRequests) aDelayedRequests, decltype(parents) aParents, decltype(InputHandler) aInputHandler, decltype(OutputHandler) aOutputHandler) |
| ! use only the file name part in the destination More...
|
|
virtual | ~requestProvider ()=default |
|
|
static requestProvider * | newProvider (const std::string &choice, decltype(requests) aRequests, decltype(delayedRequests) aDelayedRequests, decltype(parents) aParents, decltype(InputHandler) aInputHandler, decltype(OutputHandler) aOutputHandler) |
|
static void | addAllowedNamesToOption (options::single< std::string > &option) |
|
const singleMap & | getDstPath (const std::string &source, std::string &destination, bool baseNameOnly=false) override |
| get detstination papth for a given source path More...
|
|
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) |
|
static std::map< std::string, factoryClass * > & | getFactoryMap () |
|
bool | processCmdLineDirs |
|
copyRequest::simpleQueue & | requests |
|
copyRequest::timedQueue & | delayedRequests |
|
bool | parents |
|
inputHandler::base * | InputHandler |
|
outputHandler::base * | OutputHandler |
|
static options::single< bool > | recursive |
|
static options::single< bool > | dereferenceCmdLine |
|
static std::string | singleDestination |
|
static options::single< std::string > & | sourceDecodeMethod |
|
static options::single< bool > | ignoreMissing |
|
static std::multiset< copyRequest::base *, copyRequest::base::pointerCompare > | requestSet |
|
static options::map< std::string, pathMapType > | pathMap |
|
static singleMap | badMapEntry |
|
Definition at line 5 of file moveRequestProvider.h.
◆ moveRequestProvider()
◆ ~moveRequestProvider()
moveRequestProvider::~moveRequestProvider |
( |
| ) |
|
|
overridedefault |
◆ addDirContent()
void moveRequestProvider::addDirContent |
( |
const std::string & |
srcpath, |
|
|
const std::string & |
dstpath, |
|
|
const singleMap & |
mapEntry, |
|
|
const genericStat & |
dirStat |
|
) |
| |
|
overrideprivatevirtual |
Reimplemented from cmdLineRequestProvider.
Definition at line 56 of file moveRequestProvider.cpp.
65 std::unique_ptr<const genericStat> dirStat;
66 subdirType(
const std::string& aSrcPath,
67 const std::string& aDstPath,
68 std::unique_ptr<const genericStat>& aDirStat) :
71 dirStat(std::move(aDirStat)) {};
73 std::list<subdirType> subdirs;
77 std::string subpath(srcpath);
79 subpath += entry->getName();
80 std::string destpath(dstpath);
82 destpath += entry->getName();
83 auto entryStat = entry->getStat();
85 if (entryStat->isDir() &&
86 entryStat->device == dirStat.
device) {
87 subdirs.emplace_back(subpath, destpath, entryStat);
88 }
else if (entryStat->isRegularFile() || entryStat->isLink()) {
90 subpath, subpath, mapEntry,
91 copyRequest::clock_type::now()));
96 for (
auto& subdir : subdirs) {
97 addDirContent(subdir.srcPath, subdir.dstPath, mapEntry, *(subdir.dirStat));
References genericStat::device, inputHandler::base::getDirectory(), noFollowRequestProvider::ignoreMissing, requestProvider::InputHandler, and requestList.
Referenced by processSource().
◆ processSource()
void moveRequestProvider::processSource |
( |
const std::string & |
source | ) |
|
|
overrideprivatevirtual |
Reimplemented from cmdLineRequestProvider.
Definition at line 8 of file moveRequestProvider.cpp.
14 source,
"stat",
"not found");
18 throw std::runtime_error(
"can't stat " + source);
20 if (sourceStat->isDir()) {
23 auto mapEntry =
getDstPath(source, dstPath,
true);
26 throw std::runtime_error(source +
" is a directory");
32 source, source, mapEntry,
33 copyRequest::clock_type::now()));
References addDirContent(), cmdLineRequestProvider::dereferenceCmdLine, errMsg::emit(), cmdLineRequestProvider::getDstPath(), pathHandler::getStat(), noFollowRequestProvider::ignoreMissing, requestProvider::InputHandler, quiet, cmdLineRequestProvider::recursive, requestList, and errMsg::warning.
Referenced by processSources().
◆ processSources()
void moveRequestProvider::processSources |
( |
const std::vector< std::string > & |
sources | ) |
|
|
overridevirtual |
◆ factory
◆ requestList
The documentation for this class was generated from the following files:
static options::single< bool > ignoreMissing
class for defining the location of a error message in the source code.
static options::single< std::string > & sourceDecodeMethod
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
std::list< copyRequest::base * > requestList
void enqueue(std::unique_ptr< T > &item)
copyRequest::simpleQueue & requests
static const escapism * newEscaper(const std::string &name)
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!
inputHandler::base * InputHandler
cmdLineRequestProvider(decltype(requests) aRequests, decltype(delayedRequests) aDelayedRequests, decltype(parents) aParents, decltype(InputHandler) aInputHandler, decltype(OutputHandler) aOutputHandler)
void addDirContent(const std::string &srcpath, const std::string &dstpath, const singleMap &mapEntry, const genericStat &dirStat) override
void processSource(const std::string &source) override
static options::single< bool > quiet('q', "quiet", "be quiet, no prefix to output lines")
static options::single< bool > dereferenceCmdLine