Definition of the sub-class Token.
More...
#include <GaudiKernel/Tokenizer.h>
Definition of the sub-class Token.
Definition at line 28 of file Tokenizer.h.
Tokenizer::Token::Token |
( |
const Token & |
copy | ) |
|
|
inline |
Copy constructor.
Definition at line 37 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 40 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 54 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.
Definition at line 60 of file Tokenizer.cpp.
61 long lenTagBeg = ::strlen(tagBeg);
62 long lenTagEnd = ::strlen(tagEnd);
63 long lenValBeg = ::strlen(valBeg);
64 long lenValEnd = ::strlen(valEnd);
65 long lenDelim = ::strlen(delim);
66 long lenEq = ::strlen(eq);
67 long slen =
s.length();
69 while(::strncmp(
s.c_str()+
start,delim,lenDelim)==0) start += lenDelim;
70 long posTag = (lenTagBeg>0) ?
s.find(tagBeg, start) + lenTagBeg :
start;
71 long posDelim =
s.find(delim,posTag) > 0 ?
s.find(delim,posTag) : slen;
72 long posEq =
s.find(eq, posTag) > 0 ?
s.find(eq, posTag) : posDelim-posTag;
73 long lenTag = (lenTagEnd>0) ?
s.find(tagEnd, posTag)-posTag : (posEq>0) ? (posEq>posTag) ? posEq-posTag : posDelim-posTag : posDelim;
74 posEq =
s.find(eq, posTag+lenTag+lenTagEnd)+lenEq;
75 long posVal = (lenValBeg>0) ?
s.find(valBeg, posEq)+lenValBeg : posEq;
76 posDelim = (lenDelim>0) ?
s.find(delim, posVal+lenValBeg) : slen;
77 long lenVal = (lenValEnd>0) ?
s.find(valEnd, posVal)-posVal : ((posDelim>=0) ? posDelim : slen)-posVal;
81 if ( start >= 0 && posTag >= 0 ) {
82 m_tag =
s.substr(posTag, lenTag);
86 if ( posVal >= 0 && lenVal >= 0 ) {
90 while(::strncmp(
s.c_str()+start+
m_length,delim,lenDelim)==0) m_length += lenDelim;
std::string m_value
Value variable.
long m_length
Toke length.
std::string m_tag
Tag variable.
Assignment operator.
Definition at line 21 of file Tokenizer.cpp.
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 50 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.
Definition at line 29 of file Tokenizer.cpp.
GAUDI_API StatusCode resolveEnv(const std::string &var, std::string &res, int recusions=124)
std::string m_value
Value variable.
const std::string& Tokenizer::Token::tag |
( |
| ) |
const |
|
inline |
Acces tag value.
Definition at line 58 of file Tokenizer.h.
std::string m_tag
Tag variable.
const std::string& Tokenizer::Token::value |
( |
| ) |
const |
|
inline |
Access value.
Definition at line 62 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: