xrootd
XrdCpWorkLst.hh
Go to the documentation of this file.
1 
2 // //
3 // XrdCpWorkLst //
4 // //
5 // Author: Fabrizio Furano (INFN Padova, 2004) //
6 // //
7 // A class implementing a list of cp to do for XrdCp //
8 // //
10 
11 // $Id$
12 
13 #include <sys/types.h>
15 #include "XrdClient/XrdClient.hh"
16 #include <stdint.h>
17 
18 class XrdSysDir;
20 bool PedanticOpen4Write(XrdClient *cli, kXR_unt16 mode, kXR_unt16 options);
21 
22 //------------------------------------------------------------------------------
23 // Check if the opaque data provides the file size information and add it
24 // if needed
25 //------------------------------------------------------------------------------
26 XrdOucString AddSizeHint( const char *dst, off_t size );
27 
28 class XrdCpWorkLst {
29 
31  int fWorkIt;
32  uint64_t pSourceSize; // set if the source URL refers to a file
33 
35 
38 
39  public:
40 
41  XrdCpWorkLst();
42  ~XrdCpWorkLst();
43 
44 
45  // Sets the source path for the file copy
46  int SetSrc(XrdClient **srccli, XrdOucString url,
47  XrdOucString urlopaquedata, bool do_recurse);
48 
49  // Sets the destination of the file copy
50  int SetDest(XrdClient **xrddest, const char *url,
51  const char *urlopaquedata,
52  kXR_unt16 xrdopenflags);
53 
54  inline void GetDest(XrdOucString &dest, bool& isdir) {
55  dest = fDest;
56  isdir = fDestIsDir;
57  }
58 
59  inline void GetSrc(XrdOucString &src, bool& isdir) {
60  src = fSrc;
61  isdir = fSrcIsDir;
62  }
63 
64 
65  // Actually builds the worklist
66  int BuildWorkList_xrd(XrdOucString url, XrdOucString opaquedata);
68 
69  bool GetCpJob(XrdOucString &src, XrdOucString &dest);
70 
71 };