XRootD
XrdOucSiteName Class Reference

#include <XrdOucSiteName.hh>

+ Collaboration diagram for XrdOucSiteName:

Public Member Functions

 XrdOucSiteName ()
 
 ~XrdOucSiteName ()
 

Static Public Member Functions

static const char * Set (const char *name, int maxlen=15)
 

Detailed Description

Definition at line 33 of file XrdOucSiteName.hh.

Constructor & Destructor Documentation

◆ XrdOucSiteName()

XrdOucSiteName::XrdOucSiteName ( )
inline

Definition at line 39 of file XrdOucSiteName.hh.

39 {}

◆ ~XrdOucSiteName()

XrdOucSiteName::~XrdOucSiteName ( )
inline

Definition at line 40 of file XrdOucSiteName.hh.

40 {}

Member Function Documentation

◆ Set()

const char * XrdOucSiteName::Set ( const char *  name,
int  maxlen = 15 
)
static

Definition at line 37 of file XrdOucSiteName.cc.

38 {
39  char *site;
40  int i, n;
41 
42 // Validate the name
43 //
44  if (name)
45  {site = strdup(name);
46  n = strlen(site);
47  if (n > maxlen) {site[maxlen] = 0; n = maxlen;}
48  for (i = 0; i < n; i++)
49  if (!isalnum(site[i]) && !strspn(&(site[i]), "_-:")) site[i] = '.';
50  } else site = strdup("");
51 
52 // Export the name
53 //
54  XrdOucEnv::Export("XRDSITE", site);
55 
56 // Return the string, it cannot be deleted now
57 //
58  return site;
59 }
static int Export(const char *Var, const char *Val)
Definition: XrdOucEnv.cc:188

References XrdOucEnv::Export().

Referenced by XrdConfig::Configure(), and XrdFrmConfig::Configure().

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

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