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  nameR = nullptr;
58  }
59 }

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:65

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 65 of file XrdOucNList.cc.

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

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:88

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 88 of file XrdOucNList.cc.

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

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: