ewmscp  ..
noFollowRequestProvider.cpp
Go to the documentation of this file.
2 #include "scoped.h"
3 #include "throwcall.h"
4 #include "escapism.h"
5 #include "timer.h"
6 
9  "method to decode source file names", "None"));
11  "ignore missing files in source file list");
12 
13 
14 
16  const std::string& aSource,
17  const std::string& aDestination,
18  std::unique_ptr<const genericStat>& aStat,
19  const singleMap& aMapEntry,
20  bool remove,
21  copyRequest::clock_type::time_point timestamp) {
22  return new copyRequest::base(aInputHandler, aSource, aDestination, aStat, aMapEntry, remove, timestamp);
23 }
24 void noFollowRequestProvider::processSources(const std::vector<std::string>& sources) {
25 
26  for (auto& source : sources) {
27  static auto escaper = escapism::newEscaper(sourceDecodeMethod);
28  if (escaper) {
29  std::string srcbuf;
30  escaper->deEscape(source, srcbuf);
31  processSource(srcbuf);
32  } else {
33  processSource(source);
34  }
35  }
36  timerInst(requestEnqueue);
37  for (auto request : requestSet) {
38  std::unique_ptr<copyRequest::base> item(request);
39  requests.enqueue(item);
40  }
41  requestSet.clear();
42 }
noFollowRequestProvider.h
noFollowRequestProvider::ignoreMissing
static options::single< bool > ignoreMissing
Definition: noFollowRequestProvider.h:11
noFollowRequestProvider::processSources
void processSources(const std::vector< std::string > &sources) override
Definition: noFollowRequestProvider.cpp:24
noFollowRequestProvider::sourceDecodeMethod
static options::single< std::string > & sourceDecodeMethod
Definition: noFollowRequestProvider.h:10
copyRequest::base
class for copy requests.
Definition: copyRequest.h:99
scoped.h
escapism.h
timer.h
throwcall.h
escapism::newEscaperOption
static options::single< std::string > * newEscaperOption(const std::string &name, const std::string &description, const std::string &defaultValue="Url")
Definition: escapism.cpp:36
noFollowRequestProvider::newRequest
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)
Definition: noFollowRequestProvider.cpp:15
defineStaticNoArg
#define defineStaticNoArg(var)
defines a static variable that needs no arguments to it's constructor
Definition: ewmscp.h:44
waitQueues::simple::enqueue
void enqueue(std::unique_ptr< T > &item)
Definition: waitQueues.h:37
requestProvider::requests
copyRequest::simpleQueue & requests
Definition: requestProvider.h:31
escapism::newEscaper
static const escapism * newEscaper(const std::string &name)
Definition: escapism.cpp:25
inputHandler::base
class for handling input This is the (abstract) base class for handling input, both reading a file vi...
Definition: inputHandler.h:35
noFollowRequestProvider::processSource
virtual void processSource(const std::string &source)=0
timerInst
#define timerInst(subfunc)
Definition: timer.h:157
singleMap
std::pair< std::string, std::string > singleMap
Definition: copyRequest.h:52
noFollowRequestProvider::requestSet
static std::multiset< copyRequest::base *, copyRequest::base::pointerCompare > requestSet
Definition: noFollowRequestProvider.h:13
defineStatic
#define defineStatic(var,...)
defines a static variable and instatitates the constructor with the variable number of arguments.
Definition: ewmscp.h:42