XRootD
XrdOucNList Class Reference

#include <XrdOucNList.hh>

+ Inheritance diagram for XrdOucNList:
+ Collaboration diagram for XrdOucNList:

Public Member Functions

 XrdOucNList (const char *name="", int nvals=0)
 
 ~XrdOucNList ()
 
int Flag ()
 
int NameKO (const char *pd)
 
int NameKO (const char *pd, const int pl)
 
int NameOK (const char *pd)
 
int NameOK (const char *pd, const int pl)
 
XrdOucNListNext ()
 
void Set (int fval)
 

Friends

class XrdOucNList_Anchor
 

Detailed Description

Definition at line 40 of file XrdOucNList.hh.

Constructor & Destructor Documentation

◆ XrdOucNList()

XrdOucNList::XrdOucNList ( const char *  name = "",
int  nvals = 0 
)

Definition at line 37 of file XrdOucNList.cc.

38 {
39  char *ast;
40 
41 // Do the default assignments
42 //
43  nameL = strdup(name);
44  next = 0;
45  flags = nval;
46 
47 // First find the asterisk, if any in the name
48 //
49  if ((ast = index(nameL, '*')))
50  {namelenL = ast - nameL;
51  *ast = 0;
52  nameR = ast+1;
53  namelenR = strlen(nameR);
54  } else {
55  namelenL = strlen(nameL);
56  namelenR = -1;
57  }
58 }

Referenced by XrdOucNList_Anchor::Replace().

+ Here is the caller graph for this function:

◆ ~XrdOucNList()

XrdOucNList::~XrdOucNList ( )
inline

Definition at line 59 of file XrdOucNList.hh.

60  {if (nameL) free(nameL);}

Member Function Documentation

◆ Flag()

int XrdOucNList::Flag ( )
inline

Definition at line 44 of file XrdOucNList.hh.

44 {return flags;}

◆ NameKO() [1/2]

int XrdOucNList::NameKO ( const char *  pd)
inline

Definition at line 48 of file XrdOucNList.hh.

49  {return NameKO(pd, strlen(pd));}
int NameKO(const char *pd, const int pl)
Definition: XrdOucNList.cc:64

References NameKO().

+ Here is the call graph for this function:

◆ NameKO() [2/2]

int XrdOucNList::NameKO ( const char *  pd,
const int  pl 
)

Definition at line 64 of file XrdOucNList.cc.

65 {
66 
67 // Check if exact match wanted
68 //
69  if (namelenR < 0) return !strcasecmp(pd, nameL);
70 
71 // Make sure the prefix matches
72 //
73  if (namelenL && namelenL <= pl && strncasecmp(pd,nameL,namelenL))
74  return 0;
75 
76 // Make sure suffix matches
77 //
78  if (!namelenR) return 1;
79  if (namelenR > pl) return 0;
80  return !strcasecmp((pd + pl - namelenR), nameR);
81 }

Referenced by NameKO().

+ Here is the caller graph for this function:

◆ NameOK() [1/2]

int XrdOucNList::NameOK ( const char *  pd)
inline

Definition at line 52 of file XrdOucNList.hh.

53  {return NameOK(pd, strlen(pd));}
int NameOK(const char *pd, const int pl)
Definition: XrdOucNList.cc:87

References NameOK().

+ Here is the call graph for this function:

◆ NameOK() [2/2]

int XrdOucNList::NameOK ( const char *  pd,
const int  pl 
)

Definition at line 87 of file XrdOucNList.cc.

88 {
89 
90 // Check if exact match wanted
91 //
92  if (namelenR < 0) return !strcmp(pd, nameL);
93 
94 // Make sure the prefix matches
95 //
96  if (namelenL && namelenL <= pl && strncmp(pd,nameL,namelenL))
97  return 0;
98 
99 // Make sure suffix matches
100 //
101  if (!namelenR) return 1;
102  if (namelenR > pl) return 0;
103  return !strcmp((pd + pl - namelenR), nameR);
104 }

Referenced by XrdOucNList_Anchor::Find(), and NameOK().

+ Here is the caller graph for this function:

◆ Next()

XrdOucNList* XrdOucNList::Next ( )
inline

Definition at line 45 of file XrdOucNList.hh.

45 {return next;}

◆ Set()

void XrdOucNList::Set ( int  fval)
inline

Definition at line 55 of file XrdOucNList.hh.

55 {flags = fval;}

Referenced by XrdOucNList_Anchor::Replace().

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ XrdOucNList_Anchor

friend class XrdOucNList_Anchor
friend

Definition at line 62 of file XrdOucNList.hh.


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