Definition of the sub-class Token.
More...
#include <Tokenizer.h>
List of all members.
Detailed Description
Definition of the sub-class Token.
Definition at line 28 of file Tokenizer.h.
Constructor & Destructor Documentation
Tokenizer::Token::Token |
( |
const Token & |
copy ) |
[inline] |
Tokenizer::Token::Token |
( |
) |
[inline] |
virtual Tokenizer::Token::~Token |
( |
) |
[inline, virtual] |
Member Function Documentation
long Tokenizer::Token::length |
( |
) |
const [inline] |
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.
{
long lenTagBeg = ::strlen(tagBeg);
long lenTagEnd = ::strlen(tagEnd);
long lenValBeg = ::strlen(valBeg);
long lenValEnd = ::strlen(valEnd);
long lenDelim = ::strlen(delim);
long lenEq = ::strlen(eq);
long slen = s.length();
long start = st;
while(::strncmp(s.c_str()+start,delim,lenDelim)==0) start += lenDelim;
long posTag = (lenTagBeg>0) ? s.find(tagBeg, start) + lenTagBeg : start;
long posDelim = s.find(delim,posTag) > 0 ? s.find(delim,posTag) : slen;
long posEq = s.find(eq, posTag) > 0 ? s.find(eq, posTag) : posDelim-posTag;
long lenTag = (lenTagEnd>0) ? s.find(tagEnd, posTag)-posTag : (posEq>0) ? (posEq>posTag) ? posEq-posTag : posDelim-posTag : posDelim;
posEq = s.find(eq, posTag+lenTag+lenTagEnd)+lenEq;
long posVal = (lenValBeg>0) ? s.find(valBeg, posEq)+lenValBeg : posEq;
posDelim = (lenDelim>0) ? s.find(delim, posVal+lenValBeg) : slen;
long lenVal = (lenValEnd>0) ? s.find(valEnd, posVal)-posVal : ((posDelim>=0) ? posDelim : slen)-posVal;
m_tag = m_value = "";
if ( start >= 0 && posTag >= 0 ) {
m_tag = s.substr(posTag, lenTag);
m_length = posTag+m_tag.length()+lenTagEnd-st;
}
if ( posVal >= 0 && lenVal >= 0 ) {
m_value = s.substr(posVal, lenVal);
m_length = posVal+m_value.length()+lenValEnd-st;
}
while(::strncmp(s.c_str()+start+m_length,delim,lenDelim)==0) m_length += lenDelim;
}
bool Tokenizer::Token::operator== |
( |
const Token & |
copy ) |
const [inline] |
void Tokenizer::Token::resolveValue |
( |
) |
|
Resolve value from environment.
Definition at line 29 of file Tokenizer.cpp.
const std::string& Tokenizer::Token::tag |
( |
) |
const [inline] |
const std::string& Tokenizer::Token::value |
( |
) |
const [inline] |
Member Data Documentation
The documentation for this class was generated from the following files:
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v23r0/GaudiKernel/GaudiKernel/Tokenizer.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v23r0/GaudiKernel/src/Lib/Tokenizer.cpp