| # Gaudi Framework, version v21r7p1 |

Home |  | Generated: 15 Feb 2010

# Tokenizer Class Reference

STL Include files. More...

`#include <Tokenizer.h>`

List of all members.

## Public Types
typedef Token | Item
typedef std::vector< Token > | Items
## Public Member Functions
| Tokenizer ()
| Standard (dummy) constructor.
| Tokenizer (bool resolve)
| Initializing constructor.
virtual | ~Tokenizer ()
| Standard destructor.
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.
void | analyse (const std::string &s, const char *delim, const char *tag, const char *eq, const char *val)
| Analyse tokens from string.
void | analyse (const std::string &s, const char *delim, const char *eq, const char *val)
| Analyse tokens from string.
void | analyse (const std::string &s, const char *delim=" ", const char *eq="=")
| Analyse tokens from string.
Items & | items ()
| Access token collection.
const Items & | items () const
| Access token collection (CONST).
## Protected Attributes
Items | m_tokens
| Assigned tokens within string.
bool | m_resolve
| Flag to resolve environment.
## Classes
class | Token
| Definition of the sub-class Token. More...

## Detailed Description

STL Include files.

definition of class Tokenizer

Definition at line 24 of file Tokenizer.h.

## Member Typedef Documentation

typedef Token Tokenizer::Item

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.

    00077 : m_resolve(false)  {}

Tokenizer::Tokenizer | ( | bool | resolve | ) | `[inline]`

Initializing constructor.

Definition at line 79 of file Tokenizer.h.

    00079 : m_resolve(resolve)  {}

virtual Tokenizer::~Tokenizer | ( |  | ) | `[inline, virtual]`

Standard destructor.

Definition at line 81 of file Tokenizer.h.

    00081                           {
    00082     m_tokens.erase(m_tokens.begin(), m_tokens.end());
    00083   }

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

    00037                                                                                                                                                                     {
    00038   m_tokens.clear();
    00039   if ( valEnd == 0 ) valEnd = valBegin;
    00040   long start = 0;
    00041   Token tok;
    00042   do {
    00043     tok.make(s, start, delim, tagBegin, tagEnd, eq, valBegin, valEnd);
    00044     if ( tok.length() > 0 )   {
    00045       start += tok.length();
    00046       m_tokens.push_back(tok);
    00047     }
    00048     else  {
    00049       start += s.length();
    00050     }
    00051   } while ( start < long(s.length()) );
    00052   if ( m_resolve )  {
    00053     for(Items::iterator i=m_tokens.begin(); i != m_tokens.end(); ++i)  {
    00054       (*i).resolveValue();
    00055     }
    00056   }
    00057 }

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.

    00087                                                                                                            {
    00088     analyse(s, delim, tag, tag, eq, val, val);
    00089   }

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.

    00091                                                                                           {
    00092     analyse(s, delim, "", "", eq, val, val);
    00093   }

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.

    00095                                                                                  {
    00096     analyse(s, delim, "", "", eq, "", "");
    00097   }

Items& Tokenizer::items | ( |  | ) | `[inline]`

Access token collection.

Definition at line 99 of file Tokenizer.h.

    00099                     {
    00100     return m_tokens;
    00101   }

const Items& Tokenizer::items | ( |  | ) | const`[inline]`

Access token collection (CONST).

Definition at line 103 of file Tokenizer.h.

    00103                                   {
    00104     return m_tokens;
    00105   }

## Member Data Documentation

Items Tokenizer::m_tokens`[protected]`

Assigned tokens within string.

Definition at line 72 of file Tokenizer.h.

bool Tokenizer::m_resolve`[protected]`

Flag to resolve environment.

Definition at line 74 of file Tokenizer.h.

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v21r7p1/GaudiKernel/GaudiKernel/Tokenizer.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v21r7p1/GaudiKernel/src/Lib/Tokenizer.cpp