Gaudi Framework, version v22r4

Home   Generated: Fri Sep 2 2011
Classes | Public Types | Public Member Functions | Protected Attributes

Tokenizer Class Reference

STL Include files. More...

#include <Tokenizer.h>

Collaboration diagram for Tokenizer:
Collaboration graph
[legend]

List of all members.

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.
 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.
Itemsitems ()
 Access token collection.
const Itemsitems () const
 Access token collection (CONST)

Protected Attributes

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

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.

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.

: m_resolve(false)  {}
Tokenizer::Tokenizer ( bool  resolve ) [inline]

Initializing constructor.

Definition at line 79 of file Tokenizer.h.

: m_resolve(resolve)  {}
virtual Tokenizer::~Tokenizer (  ) [inline, virtual]

Standard destructor.

Definition at line 81 of file Tokenizer.h.


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.

                                                                                                                                                                    {
  m_tokens.clear();
  if ( valEnd == 0 ) valEnd = valBegin;
  long start = 0;
  Token tok;
  do {
    tok.make(s, start, delim, tagBegin, tagEnd, eq, valBegin, valEnd);
    if ( tok.length() > 0 )   {
      start += tok.length();
      m_tokens.push_back(tok);
    }
    else  { 
      start += s.length();
    }
  } while ( start < long(s.length()) );
  if ( m_resolve )  {
    for(Items::iterator i=m_tokens.begin(); i != m_tokens.end(); ++i)  {
      (*i).resolveValue();
    }
  }
}
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.

                                                                                                           {
    analyse(s, delim, tag, tag, eq, val, val);
  }
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.

                                                                                 {
    analyse(s, delim, "", "", eq, "", "");
  }
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.

                                                                                          {
    analyse(s, delim, "", "", eq, val, val);
  }
const Items& Tokenizer::items (  ) const [inline]

Access token collection (CONST)

Definition at line 103 of file Tokenizer.h.

                                  {
    return m_tokens;
  }
Items& Tokenizer::items (  ) [inline]

Access token collection.

Definition at line 99 of file Tokenizer.h.

                    {
    return m_tokens;
  }

Member Data Documentation

Flag to resolve environment.

Definition at line 74 of file Tokenizer.h.

Assigned tokens within string.

Definition at line 72 of file Tokenizer.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated at Fri Sep 2 2011 16:25:49 for Gaudi Framework, version v22r4 by Doxygen version 1.7.2 written by Dimitri van Heesch, © 1997-2004