XRootD
XrdOucNSWalk Class Reference

#include <XrdOucNSWalk.hh>

+ Collaboration diagram for XrdOucNSWalk:

Classes

class  CallBack
 
struct  NSEnt
 

Public Member Functions

 XrdOucNSWalk (XrdSysError *erp, const char *dname, const char *LKfn=0, int opts=retAll, XrdOucTList *xP=0)
 
 ~XrdOucNSWalk ()
 
NSEntIndex (int &rc, const char **dPath=0)
 
void setCallBack (CallBack *cbP=0)
 
void setMsgOn (const char *pfx)
 

Static Public Attributes

static const int noPath = 0x0100
 
static const int Recurse = 0x0080
 
static const int retAll = 0x000f
 
static const int retDir = 0x0001
 
static const int retFile = 0x0002
 
static const int retIDLO = 0x0020
 
static const int retIILO = 0x0040
 
static const int retLink = 0x0004
 
static const int retMisc = 0x0008
 
static const int retStat = 0x0010
 
static const int skpErrs = 0x8000
 

Detailed Description

Definition at line 42 of file XrdOucNSWalk.hh.

Constructor & Destructor Documentation

◆ XrdOucNSWalk()

XrdOucNSWalk::XrdOucNSWalk ( XrdSysError erp,
const char *  dname,
const char *  LKfn = 0,
int  opts = retAll,
XrdOucTList xP = 0 
)

Definition at line 48 of file XrdOucNSWalk.cc.

51 {
52 // Set the required fields
53 //
54  eDest = erp;
55  mPfx = 0;
56  DList = new XrdOucTList(dpath);
57  if (lkfn) LKFn = strdup(lkfn);
58  else LKFn = 0;
59  Opts = opts;
60  DPfd = LKfd = -1;
61  errOK= opts & skpErrs;
62  DEnts= 0;
63  edCB = 0;
64 
65 // Copy the exclude list if one exists
66 //
67  if (!xlist) XList = 0;
68  else while(xlist)
69  {XList = new XrdOucTList(xlist->text,xlist->ival,XList);
70  xlist = xlist->next;
71  }
72 }
struct myOpts opts
static const int skpErrs

References XrdOucTList::next, opts, skpErrs, and XrdOucTList::text.

◆ ~XrdOucNSWalk()

XrdOucNSWalk::~XrdOucNSWalk ( )

Definition at line 78 of file XrdOucNSWalk.cc.

79 {
80  XrdOucTList *tP;
81 
82  if (LKFn) free(LKFn);
83 
84  while((tP = DList)) {DList = tP->next; delete tP;}
85 
86  while((tP = XList)) {XList = tP->next; delete tP;}
87 }
XrdOucTList * next
Definition: XrdOucTList.hh:45

References XrdOucTList::next.

Member Function Documentation

◆ Index()

XrdOucNSWalk::NSEnt * XrdOucNSWalk::Index ( int &  rc,
const char **  dPath = 0 
)

Definition at line 93 of file XrdOucNSWalk.cc.

94 {
95  XrdOucTList *tP;
96  NSEnt *eP;
97 
98 // Sequence the directory
99 //
100  rc = 0; *DPath = '\0';
101  while((tP = DList))
102  {setPath(tP->text);
103  DList = tP->next; delete tP;
104  if (LKFn && (rc = LockFile())) break;
105  rc = Build();
106  if (LKfd >= 0) close(LKfd);
107  if (DEnts || (rc && !errOK)) break;
108  if (edCB && isEmpty) edCB->isEmpty(&dStat, DPath, LKFn);
109  }
110 
111 // Return the result
112 //
113  eP = DEnts; DEnts = 0;
114  if (dPath) *dPath = DPath;
115  return eP;
116 }
#define close(a)
Definition: XrdPosix.hh:43
virtual void isEmpty(struct stat *dStat, const char *dPath, const char *lkFn)=0
char * text
Definition: XrdOucTList.hh:46

References close, XrdOucNSWalk::CallBack::isEmpty(), XrdOucTList::next, and XrdOucTList::text.

Referenced by XrdCpFile::Extend(), XrdFrmFiles::Get(), and XrdOfsConfigCP::Init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCallBack()

void XrdOucNSWalk::setCallBack ( CallBack cbP = 0)
inline

Definition at line 96 of file XrdOucNSWalk.hh.

96 {edCB = cbP;}

Referenced by XrdFrmFiles::XrdFrmFiles().

+ Here is the caller graph for this function:

◆ setMsgOn()

void XrdOucNSWalk::setMsgOn ( const char *  pfx)
inline

Definition at line 102 of file XrdOucNSWalk.hh.

102 {mPfx = pfx;}

Referenced by XrdCpFile::Extend().

+ Here is the caller graph for this function:

Member Data Documentation

◆ noPath

const int XrdOucNSWalk::noPath = 0x0100
static

Definition at line 116 of file XrdOucNSWalk.hh.

◆ Recurse

const int XrdOucNSWalk::Recurse = 0x0080
static

Definition at line 115 of file XrdOucNSWalk.hh.

Referenced by XrdCpFile::Extend().

◆ retAll

const int XrdOucNSWalk::retAll = 0x000f
static

Definition at line 110 of file XrdOucNSWalk.hh.

◆ retDir

const int XrdOucNSWalk::retDir = 0x0001
static

Definition at line 106 of file XrdOucNSWalk.hh.

◆ retFile

const int XrdOucNSWalk::retFile = 0x0002
static

Definition at line 107 of file XrdOucNSWalk.hh.

Referenced by XrdCpFile::Extend(), and XrdOfsConfigCP::Init().

◆ retIDLO

const int XrdOucNSWalk::retIDLO = 0x0020
static

Definition at line 113 of file XrdOucNSWalk.hh.

◆ retIILO

const int XrdOucNSWalk::retIILO = 0x0040
static

Definition at line 114 of file XrdOucNSWalk.hh.

◆ retLink

const int XrdOucNSWalk::retLink = 0x0004
static

Definition at line 108 of file XrdOucNSWalk.hh.

◆ retMisc

const int XrdOucNSWalk::retMisc = 0x0008
static

Definition at line 109 of file XrdOucNSWalk.hh.

◆ retStat

const int XrdOucNSWalk::retStat = 0x0010
static

Definition at line 112 of file XrdOucNSWalk.hh.

◆ skpErrs

const int XrdOucNSWalk::skpErrs = 0x8000
static

Definition at line 117 of file XrdOucNSWalk.hh.

Referenced by XrdOucNSWalk().


The documentation for this class was generated from the following files: