Tokenizer Class Reference

STL Include files. More...

#include </scratch/z5/marcocle/GaudiDocs/lhcb-release/825/GAUDI/GAUDI_v26r3/InstallArea/x86_64-slc6-gcc48-opt/include/GaudiKernel/Tokenizer.h>

Collaboration diagram for Tokenizer:

Classes

class  Token
 Definition of the sub-class Token. More...
 

Public Types

typedef Token Item
 
typedef std::vector< TokenItems
 
typedef Token Item
 
typedef std::vector< TokenItems
 

Public Member Functions

 Tokenizer ()
 Standard (dummy) constructor. More...
 
 Tokenizer (bool resolve)
 Initializing constructor. More...
 
virtual ~Tokenizer ()
 Standard destructor. More...
 
void analyse (const std::string &s, const char *delim, const char *tagBegin, const char *tagEnd, const char *eq, const char *valBegin, const char *valEnd)
 Analyse tokens from string. More...
 
void analyse (const std::string &s, const char *delim, const char *tag, const char *eq, const char *val)
 Analyse tokens from string. More...
 
void analyse (const std::string &s, const char *delim, const char *eq, const char *val)
 Analyse tokens from string. More...
 
void analyse (const std::string &s, const char *delim=" ", const char *eq="=")
 Analyse tokens from string. More...
 
Itemsitems ()
 Access token collection. More...
 
const Itemsitems () const
 Access token collection (CONST) More...
 
 Tokenizer ()
 Standard (dummy) constructor. More...
 
 Tokenizer (bool resolve)
 Initializing constructor. More...
 
virtual ~Tokenizer ()
 Standard destructor. More...
 
void analyse (const std::string &s, const char *delim, const char *tagBegin, const char *tagEnd, const char *eq, const char *valBegin, const char *valEnd)
 Analyse tokens from string. More...
 
void analyse (const std::string &s, const char *delim, const char *tag, const char *eq, const char *val)
 Analyse tokens from string. More...
 
void analyse (const std::string &s, const char *delim, const char *eq, const char *val)
 Analyse tokens from string. More...
 
void analyse (const std::string &s, const char *delim=" ", const char *eq="=")
 Analyse tokens from string. More...
 
Itemsitems ()
 Access token collection. More...
 
const Itemsitems () const
 Access token collection (CONST) More...
 

Protected Attributes

Items m_tokens
 Assigned tokens within string. More...
 
bool m_resolve
 Flag to resolve environment. More...
 

Detailed Description

STL Include files.

definition of class Tokenizer

Definition at line 30 of file Tokenizer.h.

Member Typedef Documentation

Definition at line 74 of file Tokenizer.h.

Definition at line 74 of file Tokenizer.h.

typedef std::vector<Token> Tokenizer::Items

Definition at line 75 of file Tokenizer.h.

typedef std::vector<Token> Tokenizer::Items

Definition at line 75 of file Tokenizer.h.

Constructor & Destructor Documentation

Tokenizer::Tokenizer ( )
inline

Standard (dummy) constructor.

Definition at line 83 of file Tokenizer.h.

83 : m_resolve(false) {}
bool m_resolve
Flag to resolve environment.
Definition: Tokenizer.h:80
Tokenizer::Tokenizer ( bool  resolve)
inline

Initializing constructor.

Definition at line 85 of file Tokenizer.h.

85 : m_resolve(resolve) {}
bool m_resolve
Flag to resolve environment.
Definition: Tokenizer.h:80
virtual Tokenizer::~Tokenizer ( )
inlinevirtual

Standard destructor.

Definition at line 87 of file Tokenizer.h.

87  {
88  m_tokens.erase(m_tokens.begin(), m_tokens.end());
89  }
Items m_tokens
Assigned tokens within string.
Definition: Tokenizer.h:78
Tokenizer::Tokenizer ( )
inline

Standard (dummy) constructor.

Definition at line 83 of file Tokenizer.h.

83 : m_resolve(false) {}
bool m_resolve
Flag to resolve environment.
Definition: Tokenizer.h:80
Tokenizer::Tokenizer ( bool  resolve)
inline

Initializing constructor.

Definition at line 85 of file Tokenizer.h.

85 : m_resolve(resolve) {}
bool m_resolve
Flag to resolve environment.
Definition: Tokenizer.h:80
virtual Tokenizer::~Tokenizer ( )
inlinevirtual

Standard destructor.

Definition at line 87 of file Tokenizer.h.

87  {
88  m_tokens.erase(m_tokens.begin(), m_tokens.end());
89  }
Items m_tokens
Assigned tokens within string.
Definition: Tokenizer.h:78

Member Function Documentation

void Tokenizer::analyse ( const std::string &  s,
const char *  delim,
const char *  tagBegin,
const char *  tagEnd,
const char *  eq,
const char *  valBegin,
const char *  valEnd 
)

Analyse tokens from string.

Definition at line 36 of file Tokenizer.cpp.

36  {
37  m_tokens.clear();
38  if ( valEnd == 0 ) valEnd = valBegin;
39  long start = 0;
40  Token tok;
41  do {
42  tok.make(s, start, delim, tagBegin, tagEnd, eq, valBegin, valEnd);
43  if ( tok.length() > 0 ) {
44  start += tok.length();
45  m_tokens.push_back(tok);
46  }
47  else {
48  start += s.length();
49  }
50  } while ( start < long(s.length()) );
51  if ( m_resolve ) {
52  for(Items::iterator i=m_tokens.begin(); i != m_tokens.end(); ++i) {
53  (*i).resolveValue();
54  }
55  }
56 }
bool m_resolve
Flag to resolve environment.
Definition: Tokenizer.h:80
Items m_tokens
Assigned tokens within string.
Definition: Tokenizer.h:78
string s
Definition: gaudirun.py:244
list i
Definition: ana.py:128
tuple start
Definition: IOTest.py:88
void Tokenizer::analyse ( const std::string &  s,
const char *  delim,
const char *  tagBegin,
const char *  tagEnd,
const char *  eq,
const char *  valBegin,
const char *  valEnd 
)

Analyse tokens from string.

void Tokenizer::analyse ( const std::string &  s,
const char *  delim,
const char *  tag,
const char *  eq,
const char *  val 
)
inline

Analyse tokens from string.

Definition at line 93 of file Tokenizer.h.

93  {
94  analyse(s, delim, tag, tag, eq, val, val);
95  }
void analyse(const std::string &s, const char *delim, const char *tagBegin, const char *tagEnd, const char *eq, const char *valBegin, const char *valEnd)
Analyse tokens from string.
Definition: Tokenizer.cpp:36
string s
Definition: gaudirun.py:244
void Tokenizer::analyse ( const std::string &  s,
const char *  delim,
const char *  tag,
const char *  eq,
const char *  val 
)
inline

Analyse tokens from string.

Definition at line 93 of file Tokenizer.h.

93  {
94  analyse(s, delim, tag, tag, eq, val, val);
95  }
void analyse(const std::string &s, const char *delim, const char *tagBegin, const char *tagEnd, const char *eq, const char *valBegin, const char *valEnd)
Analyse tokens from string.
Definition: Tokenizer.cpp:36
string s
Definition: gaudirun.py:244
void Tokenizer::analyse ( const std::string &  s,
const char *  delim,
const char *  eq,
const char *  val 
)
inline

Analyse tokens from string.

Definition at line 97 of file Tokenizer.h.

97  {
98  analyse(s, delim, "", "", eq, val, val);
99  }
void analyse(const std::string &s, const char *delim, const char *tagBegin, const char *tagEnd, const char *eq, const char *valBegin, const char *valEnd)
Analyse tokens from string.
Definition: Tokenizer.cpp:36
string s
Definition: gaudirun.py:244
void Tokenizer::analyse ( const std::string &  s,
const char *  delim,
const char *  eq,
const char *  val 
)
inline

Analyse tokens from string.

Definition at line 97 of file Tokenizer.h.

97  {
98  analyse(s, delim, "", "", eq, val, val);
99  }
void analyse(const std::string &s, const char *delim, const char *tagBegin, const char *tagEnd, const char *eq, const char *valBegin, const char *valEnd)
Analyse tokens from string.
Definition: Tokenizer.cpp:36
string s
Definition: gaudirun.py:244
void Tokenizer::analyse ( const std::string &  s,
const char *  delim = " ",
const char *  eq = "=" 
)
inline

Analyse tokens from string.

Definition at line 101 of file Tokenizer.h.

101  {
102  analyse(s, delim, "", "", eq, "", "");
103  }
void analyse(const std::string &s, const char *delim, const char *tagBegin, const char *tagEnd, const char *eq, const char *valBegin, const char *valEnd)
Analyse tokens from string.
Definition: Tokenizer.cpp:36
string s
Definition: gaudirun.py:244
void Tokenizer::analyse ( const std::string &  s,
const char *  delim = " ",
const char *  eq = "=" 
)
inline

Analyse tokens from string.

Definition at line 101 of file Tokenizer.h.

101  {
102  analyse(s, delim, "", "", eq, "", "");
103  }
void analyse(const std::string &s, const char *delim, const char *tagBegin, const char *tagEnd, const char *eq, const char *valBegin, const char *valEnd)
Analyse tokens from string.
Definition: Tokenizer.cpp:36
string s
Definition: gaudirun.py:244
Items& Tokenizer::items ( )
inline

Access token collection.

Definition at line 105 of file Tokenizer.h.

105  {
106  return m_tokens;
107  }
Items m_tokens
Assigned tokens within string.
Definition: Tokenizer.h:78
Items& Tokenizer::items ( )
inline

Access token collection.

Definition at line 105 of file Tokenizer.h.

105  {
106  return m_tokens;
107  }
Items m_tokens
Assigned tokens within string.
Definition: Tokenizer.h:78
const Items& Tokenizer::items ( ) const
inline

Access token collection (CONST)

Definition at line 109 of file Tokenizer.h.

109  {
110  return m_tokens;
111  }
Items m_tokens
Assigned tokens within string.
Definition: Tokenizer.h:78
const Items& Tokenizer::items ( ) const
inline

Access token collection (CONST)

Definition at line 109 of file Tokenizer.h.

109  {
110  return m_tokens;
111  }
Items m_tokens
Assigned tokens within string.
Definition: Tokenizer.h:78

Member Data Documentation

bool Tokenizer::m_resolve
protected

Flag to resolve environment.

Definition at line 80 of file Tokenizer.h.

Items Tokenizer::m_tokens
protected

Assigned tokens within string.

Definition at line 78 of file Tokenizer.h.


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