Loading...
Searching...
No Matches
XrdPfc::SplitParser Struct Reference

`#include <XrdPfcPathParseTools.hh>`

Inheritance diagram for XrdPfc::SplitParser:
Collaboration diagram for XrdPfc::SplitParser:

## Public Member Functions

| SplitParser (const std::string &s, const char *d)
| ~SplitParser ()
const char * | get_reminder ()
const char * | get_reminder_with_delim ()
const char * | get_token ()
std::string | get_token_as_string ()
bool | has_reminder ()
bool | is_first () const
int | pre_count_n_tokens ()

## Public Attributes

const char * | f_delim
char * | f_state
char * | f_str

## Detailed Description

Definition at line 12 of file XrdPfcPathParseTools.hh.

## Constructor & Destructor Documentation

## SplitParser()

XrdPfc::SplitParser::SplitParser | ( | const std::string & | s,
|  | const char * | d )

inline

Definition at line 18 of file XrdPfcPathParseTools.hh.

:
f_str(strdup(s.c_str())), f_delim(d), f_state(f_str)
{}
XrdPfc::SplitParser::f_str
char * f_str
Definition XrdPfcPathParseTools.hh:14
XrdPfc::SplitParser::f_delim
const char * f_delim
Definition XrdPfcPathParseTools.hh:15
XrdPfc::SplitParser::f_state
char * f_state
Definition XrdPfcPathParseTools.hh:16

References f_delim, f_state, and f_str.

Referenced by XrdPfc::PathTokenizer::PathTokenizer().

Here is the caller graph for this function:

## ~SplitParser()

XrdPfc::SplitParser::~SplitParser | ( |  | ) |

inline

Definition at line 21 of file XrdPfcPathParseTools.hh.

{ free(f_str); }

References f_str.

## Member Function Documentation

## get_reminder()

const char * XrdPfc::SplitParser::get_reminder | ( |  | ) |

inline

Definition at line 52 of file XrdPfcPathParseTools.hh.

{
return f_state ? f_state : "";
}

References f_state.

Referenced by XrdPfc::Cache::ExecuteCommandUrl().

Here is the caller graph for this function:

## get_reminder_with_delim()

const char * XrdPfc::SplitParser::get_reminder_with_delim | ( |  | ) |

inline

Definition at line 46 of file XrdPfcPathParseTools.hh.

{
if (is_first()) { return f_str; }
else { *(f_state - 1) = f_delim[0]; return f_state - 1; }
}
XrdPfc::SplitParser::is_first
bool is_first() const
Definition XrdPfcPathParseTools.hh:23

References f_delim, f_state, f_str, and is_first().

Referenced by XrdPfc::Cache::ExecuteCommandUrl().

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

## get_token()

const char * XrdPfc::SplitParser::get_token | ( |  | ) |

inline

Definition at line 25 of file XrdPfcPathParseTools.hh.

{
if ( ! f_state) return 0;
// Skip leading delimiters, if any.
char *t = f_state + strspn(f_state, f_delim);
if (*t == (char) 0) { f_state = 0; return 0; }
// Advance state to the next delimeter, if any.
f_state = strpbrk(t, f_delim);
if (f_state) {
*f_state = (char) 0;
++f_state;
}
return t;
}

References f_delim, and f_state.

Referenced by XrdPfc::PathTokenizer::PathTokenizer(), XrdPfc::Cache::ExecuteCommandUrl(), and get_token_as_string().

Here is the caller graph for this function:

## get_token_as_string()

std::string XrdPfc::SplitParser::get_token_as_string | ( |  | ) |

inline

Definition at line 40 of file XrdPfcPathParseTools.hh.

{
const char *t = get_token();
return std::string(t ? t : "");
}
XrdPfc::SplitParser::get_token
const char * get_token()
Definition XrdPfcPathParseTools.hh:25

References get_token().

Referenced by XrdPfc::Cache::ExecuteCommandUrl().

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

## has_reminder()

bool XrdPfc::SplitParser::has_reminder | ( |  | ) |

inline

Definition at line 57 of file XrdPfcPathParseTools.hh.

{
return f_state && f_state[0] != 0;
}

References f_state.

Referenced by XrdPfc::PathTokenizer::PathTokenizer(), and XrdPfc::Cache::ExecuteCommandUrl().

Here is the caller graph for this function:

## is_first()

bool XrdPfc::SplitParser::is_first | ( |  | ) | const

inline

Definition at line 23 of file XrdPfcPathParseTools.hh.

{ return f_state == f_str; }

References f_state, and f_str.

Referenced by get_reminder_with_delim().

Here is the caller graph for this function:

## pre_count_n_tokens()

int XrdPfc::SplitParser::pre_count_n_tokens | ( |  | ) |

inline

Definition at line 62 of file XrdPfcPathParseTools.hh.

{
int n_tok = 0;
char *p = f_state;
while (*p) {
p += strspn(p, f_delim);
if (*p == (char) 0)
break;
++n_tok;
p = strpbrk(p, f_delim);
if ( ! p)
break;
++p;
}
return n_tok;
}

References f_delim, and f_state.

Referenced by XrdPfc::PathTokenizer::PathTokenizer().

Here is the caller graph for this function:

## Member Data Documentation

## f_delim

const char* XrdPfc::SplitParser::f_delim

Definition at line 15 of file XrdPfcPathParseTools.hh.

Referenced by SplitParser(), get_reminder_with_delim(), get_token(), and pre_count_n_tokens().

## f_state

char* XrdPfc::SplitParser::f_state

Definition at line 16 of file XrdPfcPathParseTools.hh.

Referenced by SplitParser(), get_reminder(), get_reminder_with_delim(), get_token(), has_reminder(), is_first(), and pre_count_n_tokens().

## f_str

char* XrdPfc::SplitParser::f_str

Definition at line 14 of file XrdPfcPathParseTools.hh.

Referenced by SplitParser(), ~SplitParser(), get_reminder_with_delim(), and is_first().

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

- XrdPfcPathParseTools.hh