Definition of the sub-class Token.
More...
#include </scratch/z5/marcocle/GaudiDocs/lhcb-release/825/GAUDI/GAUDI_v26r3/InstallArea/x86_64-slc6-gcc48-opt/include/GaudiKernel/Tokenizer.h>
|
| Token (const Token ©) |
| Copy constructor. More...
|
|
| Token () |
| Standard constructor. More...
|
|
void | make (const std::string &s, long st, const char *delim, const char *tagBegin, const char *tagEnd, const char *eq, const char *valBegin, const char *valEnd) |
| Create token from string. More...
|
|
virtual | ~Token () |
| Standard Destructor. More...
|
|
Token & | operator= (const Token ©) |
| Assignment operator. More...
|
|
bool | operator== (const Token ©) const |
|
long | length () const |
| Total token length. More...
|
|
const std::string & | tag () const |
| Acces tag value. More...
|
|
const std::string & | value () const |
| Access value. More...
|
|
void | resolveValue () |
| Resolve value from environment. More...
|
|
| Token (const Token ©) |
| Copy constructor. More...
|
|
| Token () |
| Standard constructor. More...
|
|
void | make (const std::string &s, long st, const char *delim, const char *tagBegin, const char *tagEnd, const char *eq, const char *valBegin, const char *valEnd) |
| Create token from string. More...
|
|
virtual | ~Token () |
| Standard Destructor. More...
|
|
Token & | operator= (const Token ©) |
| Assignment operator. More...
|
|
bool | operator== (const Token ©) const |
|
long | length () const |
| Total token length. More...
|
|
const std::string & | tag () const |
| Acces tag value. More...
|
|
const std::string & | value () const |
| Access value. More...
|
|
void | resolveValue () |
| Resolve value from environment. More...
|
|
Definition of the sub-class Token.
Definition at line 34 of file Tokenizer.h.
Tokenizer::Token::Token |
( |
const Token & |
copy | ) |
|
|
inline |
Copy constructor.
Definition at line 43 of file Tokenizer.h.
std::string m_value
Value variable.
long m_length
Toke length.
std::string m_tag
Tag variable.
Tokenizer::Token::Token |
( |
| ) |
|
|
inline |
Standard constructor.
Definition at line 46 of file Tokenizer.h.
long m_length
Toke length.
virtual Tokenizer::Token::~Token |
( |
| ) |
|
|
inlinevirtual |
Tokenizer::Token::Token |
( |
const Token & |
copy | ) |
|
|
inline |
Copy constructor.
Definition at line 43 of file Tokenizer.h.
std::string m_value
Value variable.
long m_length
Toke length.
std::string m_tag
Tag variable.
Tokenizer::Token::Token |
( |
| ) |
|
|
inline |
Standard constructor.
Definition at line 46 of file Tokenizer.h.
long m_length
Toke length.
virtual Tokenizer::Token::~Token |
( |
| ) |
|
|
inlinevirtual |
long Tokenizer::Token::length |
( |
| ) |
const |
|
inline |
Total token length.
Definition at line 60 of file Tokenizer.h.
long m_length
Toke length.
long Tokenizer::Token::length |
( |
| ) |
const |
|
inline |
Total token length.
Definition at line 60 of file Tokenizer.h.
long m_length
Toke length.
void Tokenizer::Token::make |
( |
const std::string & |
s, |
|
|
long |
st, |
|
|
const char * |
delim, |
|
|
const char * |
tagBegin, |
|
|
const char * |
tagEnd, |
|
|
const char * |
eq, |
|
|
const char * |
valBegin, |
|
|
const char * |
valEnd |
|
) |
| |
Create token from string.
void Tokenizer::Token::make |
( |
const std::string & |
s, |
|
|
long |
st, |
|
|
const char * |
delim, |
|
|
const char * |
tagBegin, |
|
|
const char * |
tagEnd, |
|
|
const char * |
eq, |
|
|
const char * |
valBegin, |
|
|
const char * |
valEnd |
|
) |
| |
Create token from string.
Definition at line 59 of file Tokenizer.cpp.
60 long lenTagBeg = ::strlen(tagBeg);
61 long lenTagEnd = ::strlen(tagEnd);
62 long lenValBeg = ::strlen(valBeg);
63 long lenValEnd = ::strlen(valEnd);
64 long lenDelim = ::strlen(delim);
65 long lenEq = ::strlen(eq);
66 long slen =
s.length();
68 while(::strncmp(
s.c_str()+
start,delim,lenDelim)==0) start += lenDelim;
69 long posTag = (lenTagBeg>0) ?
s.find(tagBeg, start) + lenTagBeg :
start;
70 long posDelim =
s.find(delim,posTag) > 0 ?
s.find(delim,posTag) : slen;
71 long posEq =
s.find(eq, posTag) > 0 ?
s.find(eq, posTag) : posDelim-posTag;
72 long lenTag = (lenTagEnd>0) ?
s.find(tagEnd, posTag)-posTag : (posEq>0) ? (posEq>posTag) ? posEq-posTag : posDelim-posTag : posDelim;
73 posEq =
s.find(eq, posTag+lenTag+lenTagEnd)+lenEq;
74 long posVal = (lenValBeg>0) ?
s.find(valBeg, posEq)+lenValBeg : posEq;
75 posDelim = (lenDelim>0) ?
s.find(delim, posVal+lenValBeg) : slen;
76 long lenVal = (lenValEnd>0) ?
s.find(valEnd, posVal)-posVal : ((posDelim>=0) ? posDelim : slen)-posVal;
80 if ( start >= 0 && posTag >= 0 ) {
81 m_tag =
s.substr(posTag, lenTag);
85 if ( posVal >= 0 && lenVal >= 0 ) {
94 while(::strncmp(
s.c_str()+start+
m_length,delim,lenDelim)==0) {
96 if (start + m_length >=
long(
s.size())) {
std::string m_value
Value variable.
long m_length
Toke length.
std::string m_tag
Tag variable.
Assignment operator.
Definition at line 20 of file Tokenizer.cpp.
std::string m_value
Value variable.
long m_length
Toke length.
std::string m_tag
Tag variable.
Token& Tokenizer::Token::operator= |
( |
const Token & |
copy | ) |
|
bool Tokenizer::Token::operator== |
( |
const Token & |
copy | ) |
const |
|
inline |
Definition at line 56 of file Tokenizer.h.
std::string m_value
Value variable.
long m_length
Toke length.
std::string m_tag
Tag variable.
bool Tokenizer::Token::operator== |
( |
const Token & |
copy | ) |
const |
|
inline |
Definition at line 56 of file Tokenizer.h.
std::string m_value
Value variable.
long m_length
Toke length.
std::string m_tag
Tag variable.
void Tokenizer::Token::resolveValue |
( |
| ) |
|
Resolve value from environment.
void Tokenizer::Token::resolveValue |
( |
| ) |
|
Resolve value from environment.
Definition at line 28 of file Tokenizer.cpp.
std::string m_value
Value variable.
GAUDI_API StatusCode resolveEnv(const std::string &var, std::string &res, int recusions=124)
const std::string& Tokenizer::Token::tag |
( |
| ) |
const |
|
inline |
Acces tag value.
Definition at line 64 of file Tokenizer.h.
std::string m_tag
Tag variable.
const std::string& Tokenizer::Token::tag |
( |
| ) |
const |
|
inline |
Acces tag value.
Definition at line 64 of file Tokenizer.h.
std::string m_tag
Tag variable.
const std::string& Tokenizer::Token::value |
( |
| ) |
const |
|
inline |
Access value.
Definition at line 68 of file Tokenizer.h.
std::string m_value
Value variable.
const std::string& Tokenizer::Token::value |
( |
void |
| ) |
const |
|
inline |
Access value.
Definition at line 68 of file Tokenizer.h.
std::string m_value
Value variable.
long Tokenizer::Token::m_length |
|
private |
std::string Tokenizer::Token::m_tag |
|
private |
std::string Tokenizer::Token::m_value |
|
private |
The documentation for this class was generated from the following files: