All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Tokenizer Class Reference

STL Include files. More...

#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
 

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...
 

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 24 of file Tokenizer.h.

Member Typedef Documentation

Definition at line 68 of file Tokenizer.h.

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

Definition at line 69 of file Tokenizer.h.

Constructor & Destructor Documentation

Tokenizer::Tokenizer ( )
inline

Standard (dummy) constructor.

Definition at line 77 of file Tokenizer.h.

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

Initializing constructor.

Definition at line 79 of file Tokenizer.h.

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

Standard destructor.

Definition at line 81 of file Tokenizer.h.

81  {
82  m_tokens.erase(m_tokens.begin(), m_tokens.end());
83  }
Items m_tokens
Assigned tokens within string.
Definition: Tokenizer.h:72

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 37 of file Tokenizer.cpp.

37  {
38  m_tokens.clear();
39  if ( valEnd == 0 ) valEnd = valBegin;
40  long start = 0;
41  Token tok;
42  do {
43  tok.make(s, start, delim, tagBegin, tagEnd, eq, valBegin, valEnd);
44  if ( tok.length() > 0 ) {
45  start += tok.length();
46  m_tokens.push_back(tok);
47  }
48  else {
49  start += s.length();
50  }
51  } while ( start < long(s.length()) );
52  if ( m_resolve ) {
53  for(Items::iterator i=m_tokens.begin(); i != m_tokens.end(); ++i) {
54  (*i).resolveValue();
55  }
56  }
57 }
bool m_resolve
Flag to resolve environment.
Definition: Tokenizer.h:74
Items m_tokens
Assigned tokens within string.
Definition: Tokenizer.h:72
string s
Definition: gaudirun.py:210
list i
Definition: ana.py:128
tuple start
Definition: IOTest.py:88
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 87 of file Tokenizer.h.

87  {
88  analyse(s, delim, tag, tag, eq, val, val);
89  }
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:37
string s
Definition: gaudirun.py:210
void Tokenizer::analyse ( const std::string &  s,
const char *  delim,
const char *  eq,
const char *  val 
)
inline

Analyse tokens from string.

Definition at line 91 of file Tokenizer.h.

91  {
92  analyse(s, delim, "", "", eq, val, val);
93  }
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:37
string s
Definition: gaudirun.py:210
void Tokenizer::analyse ( const std::string &  s,
const char *  delim = " ",
const char *  eq = "=" 
)
inline

Analyse tokens from string.

Definition at line 95 of file Tokenizer.h.

95  {
96  analyse(s, delim, "", "", eq, "", "");
97  }
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:37
string s
Definition: gaudirun.py:210
Items& Tokenizer::items ( )
inline

Access token collection.

Definition at line 99 of file Tokenizer.h.

99  {
100  return m_tokens;
101  }
Items m_tokens
Assigned tokens within string.
Definition: Tokenizer.h:72
const Items& Tokenizer::items ( ) const
inline

Access token collection (CONST)

Definition at line 103 of file Tokenizer.h.

103  {
104  return m_tokens;
105  }
Items m_tokens
Assigned tokens within string.
Definition: Tokenizer.h:72

Member Data Documentation

bool Tokenizer::m_resolve
protected

Flag to resolve environment.

Definition at line 74 of file Tokenizer.h.

Items Tokenizer::m_tokens
protected

Assigned tokens within string.

Definition at line 72 of file Tokenizer.h.


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