xrootd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
XrdCpWorkLst.hh
Go to the documentation of this file.
1 #ifndef XRDCPWORKLST_HH
2 #define XRDCPWORKLST_HH
3 /******************************************************************************/
4 /* */
5 /* X r d C p W o r k L s t . h h */
6 /* */
7 /* Author: Fabrizio Furano (INFN Padova, 2004) */
8 /* */
9 /* This file is part of the XRootD software suite. */
10 /* */
11 /* XRootD is free software: you can redistribute it and/or modify it under */
12 /* the terms of the GNU Lesser General Public License as published by the */
13 /* Free Software Foundation, either version 3 of the License, or (at your */
14 /* option) any later version. */
15 /* */
16 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */
17 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
18 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
19 /* License for more details. */
20 /* */
21 /* You should have received a copy of the GNU Lesser General Public License */
22 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
23 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
24 /* */
25 /* The copyright holder's institutional names and contributor's names may not */
26 /* be used to endorse or promote products derived from this software without */
27 /* specific prior written permission of the institution or contributor. */
28 /******************************************************************************/
29 
31 // //
32 // A class implementing a list of cp to do for XrdCp //
33 // //
35 
36 #include <sys/types.h>
38 #include "XrdClient/XrdClient.hh"
39 #include <stdint.h>
40 
41 class XrdSysDir;
42 const char *ServerError(XrdClient *cli);
44 bool PedanticOpen4Write(XrdClient *cli, kXR_unt16 mode, kXR_unt16 options);
45 
46 //------------------------------------------------------------------------------
47 // Check if the opaque data provides the file size information and add it
48 // if needed
49 //------------------------------------------------------------------------------
50 XrdOucString AddSizeHint( const char *dst, off_t size );
51 
52 class XrdCpWorkLst {
53 
55  uint64_t pSourceSize; // set if the source URL refers to a file
57  int fWorkIt;
58 
60 
63 
64  public:
65 
66  XrdCpWorkLst();
67  ~XrdCpWorkLst();
68 
69 
70  // Sets the source path for the file copy
71  int SetSrc(XrdClient **srccli, XrdOucString url,
72  XrdOucString urlopaquedata, bool do_recurse, int newCP=0);
73 
74  // Sets the destination of the file copy
75  int SetDest(XrdClient **xrddest, const char *url,
76  const char *urlopaquedata,
77  kXR_unt16 xrdopenflags, int newCP=0);
78 
79  inline void GetDest(XrdOucString &dest, bool& isdir) {
80  dest = fDest;
81  isdir = fDestIsDir;
82  }
83 
84  inline void GetSrc(XrdOucString &src, bool& isdir) {
85  src = fSrc;
86  isdir = fSrcIsDir;
87  }
88 
89 
90  // Actually builds the worklist
91  int BuildWorkList_xrd(XrdOucString url, XrdOucString opaquedata);
93 
94  bool GetCpJob(XrdOucString &src, XrdOucString &dest);
95 
96 };
97 #endif
void PrintLastServerError(XrdClient *cli)
Definition: XrdClient.hh:121
bool fSrcIsDir
Definition: XrdCpWorkLst.hh:62
XrdOucString AddSizeHint(const char *dst, off_t size)
int SetSrc(XrdClient **srccli, XrdOucString url, XrdOucString urlopaquedata, bool do_recurse, int newCP=0)
Definition: XrdCpWorkLst.hh:52
unsigned short kXR_unt16
Definition: XPtypes.hh:67
uint64_t pSourceSize
Definition: XrdCpWorkLst.hh:55
int srcPathLen
Definition: XrdCpWorkLst.hh:56
bool GetCpJob(XrdOucString &src, XrdOucString &dest)
XrdOucString fSrc
Definition: XrdCpWorkLst.hh:61
Definition: XrdClientAdmin.hh:63
void GetDest(XrdOucString &dest, bool &isdir)
Definition: XrdCpWorkLst.hh:79
int SetDest(XrdClient **xrddest, const char *url, const char *urlopaquedata, kXR_unt16 xrdopenflags, int newCP=0)
XrdClientAdmin * xrda_dst
Definition: XrdCpWorkLst.hh:59
int BuildWorkList_xrd(XrdOucString url, XrdOucString opaquedata)
void GetSrc(XrdOucString &src, bool &isdir)
Definition: XrdCpWorkLst.hh:84
bool PedanticOpen4Write(XrdClient *cli, kXR_unt16 mode, kXR_unt16 options)
int fWorkIt
Definition: XrdCpWorkLst.hh:57
const char * ServerError(XrdClient *cli)
int BuildWorkList_loc(XrdSysDir *dir, XrdOucString pat)
bool fDestIsDir
Definition: XrdCpWorkLst.hh:62
XrdOucString fDest
Definition: XrdCpWorkLst.hh:61
Definition: XrdSysDir.hh:48
XrdClientAdmin * xrda_src
Definition: XrdCpWorkLst.hh:59
vecString fWorkList
Definition: XrdCpWorkLst.hh:54
Definition: XrdOucString.hh:254