xrootd
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes | List of all members
XrdOucGatherConf Class Reference

#include <XrdOucGatherConf.hh>

Inheritance diagram for XrdOucGatherConf:
Inheritance graph
[legend]
Collaboration diagram for XrdOucGatherConf:
Collaboration graph
[legend]

Public Types

enum  Level { full_lines = 0 , trim_lines , only_body , trim_body }
 

Public Member Functions

int Gather (const char *cfname, Level lvl, const char *parms=0)
 
bool hasData ()
 
bool useData (const char *data)
 
 XrdOucGatherConf (const char *want, XrdSysError *errP=0)
 
 XrdOucGatherConf (const char **&want, XrdSysError *errP=0)
 
 ~XrdOucGatherConf ()
 
- Public Member Functions inherited from XrdOucTokenizer
 XrdOucTokenizer (char *bp)
 
 ~XrdOucTokenizer ()
 
void Attach (char *bp)
 
char * GetLine ()
 
char * GetToken (char **rest=0, int lowcase=0)
 
void RetToken ()
 
void Tabs (int x=1)
 

Private Attributes

XrdSysErroreDest
 
XrdOucTListMatch
 
char * gBuff
 

Member Enumeration Documentation

◆ Level

Gather information from a config file.

Note
You must call this method or a successful useData() before calling any XrdOucTokenizer methods.
Parameters
cfnamePath to the configuration file.
lvlIndicates how the gathered directives are to be saved: full_lines - the full directive line, including newline. trim_lines - Like full_lines but the prefix (i.e.characters the dot) are discarded. Useful only when gathering a single prefix. only_body Saves the body of each wanted directive as a space separated string blob. trim_body Like only_body but also includes the directive characters after the dot. Useful only when gathering a single prefix.
parmsOptional pointer to initial configuration parameters. These may be present for plugins.
Returns
> 0 Success, configuration data has been gathered.
= 0 Nothing was gathered.
< 0 Problem reading the config file, returned value is -errno.
Enumerator
full_lines 

Complete lines.

trim_lines 

Prefix trimmed lines.

only_body 

Only directive bodies as a string blob.

trim_body 

Prefix trimmed lines as a string blob.

Constructor & Destructor Documentation

◆ XrdOucGatherConf() [1/2]

XrdOucGatherConf::XrdOucGatherConf ( const char *  want,
XrdSysError errP = 0 
)

Constructor #1

Note
This object collects relevant configuration directives ready to be processed by the inherited XrdOucTokenizer methods. All if-fi, set, and variable substitutions are performed.
Parameters
wantA space separated list of directive prefixes (i.e. end with a dot) and actual directives that should be gathered.
errPOptional pointer to an error object. When supplied, gathered lines are echoed. Additionally, error messages are issued. supplied XrdSysError object or using std::cerr using a

◆ XrdOucGatherConf() [2/2]

XrdOucGatherConf::XrdOucGatherConf ( const char **&  want,
XrdSysError errP = 0 
)

Constructor #2

Note
This is the same as constructor #1 but uses vector to hold the wanted directives or directive prefixes.
Parameters
wantA vector of strings of directive prefixes (i.e. end with a dot) and actual directives that should be gathered. The end of the vector is indicated by a nil pointer (e,g, const char *want[] = {"x.c", "y.", 0};
errPOptional pointer to an error object. When supplied, gathered lines are echoed. Additionally, error messages are issued. supplied XrdSysError object or using std::cerr using a

◆ ~XrdOucGatherConf()

XrdOucGatherConf::~XrdOucGatherConf ( )

Member Function Documentation

◆ Gather()

int XrdOucGatherConf::Gather ( const char *  cfname,
Level  lvl,
const char *  parms = 0 
)

◆ hasData()

bool XrdOucGatherConf::hasData ( )

Check if data is present.

Returns
True if data is present and false, otherwise.

◆ useData()

bool XrdOucGatherConf::useData ( const char *  data)

Attempt to use pre-existing data.

Parameters
dataPointer to null terminated pre-existing data.
Returns
False if the pointer is nil or points to a null string; true o/w.

Member Data Documentation

◆ eDest

XrdSysError* XrdOucGatherConf::eDest
private

◆ gBuff

char* XrdOucGatherConf::gBuff
private

◆ Match

XrdOucTList* XrdOucGatherConf::Match
private

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