| # Gaudi Framework, version v23r0 |

Home |  | Generated: Mon Jan 30 2012

Classes | Public Types | Public Member Functions | Public Attributes

# Gaudi::Parsers::StringGrammar< Iterator, Skipper > Class Template Reference

The valid represenation of string values are: More...

`#include <Grammar.h>`

Inheritance diagram for Gaudi::Parsers::StringGrammar< Iterator, Skipper >:
[legend]
Collaboration diagram for Gaudi::Parsers::StringGrammar< Iterator, Skipper >:
[legend]

List of all members.

## Classes
struct | definition
## Public Types
typedef std::string | ResultT
typedef std::string | ResultT
typedef std::string | ResultT
## Public Member Functions
| StringGrammar ()
void | matchString () const
| remove CR/LF symbols form the parsed strings
| StringGrammar ()
## Public Attributes
qi::rule< Iterator, std::string(), qi::locals < char >, Skipper > | str
qi::rule< Iterator, char()> | begin_quote
qi::rule< Iterator, void(char)> | quote

## Detailed Description

### template<typename Iterator, typename Skipper>
class Gaudi::Parsers::StringGrammar< Iterator, Skipper >

The valid represenation of string values are:

- "abc" , "\"abc""
- 'abs' , '\'abc\''

Todo:
  implement not ASCII chars in strings

Author:
  Alexander MAZUROV Alexander.Mazurov@gmail.com
  Vanya BELYAEV ibelyaev@physics.syr.edu

Date:
  2006-05-14

Definition at line 46 of file Grammar.h.

## Member Typedef Documentation

template<typename Iterator , typename Skipper >

typedef std::string Gaudi::Parsers::StringGrammar< Iterator, Skipper >::ResultT

Definition at line 49 of file Grammar.h.

template<typename Iterator , typename Skipper >

typedef std::string Gaudi::Parsers::StringGrammar< Iterator, Skipper >::ResultT

Definition at line 91 of file GrammarsV2.h.

template<typename Iterator , typename Skipper >

typedef std::string Gaudi::Parsers::StringGrammar< Iterator, Skipper >::ResultT

Definition at line 252 of file Grammars.h.

## Constructor & Destructor Documentation

template<typename Iterator , typename Skipper >

Gaudi::Parsers::StringGrammar< Iterator, Skipper >::StringGrammar | ( | ) | `[inline]`

Definition at line 51 of file Grammar.h.

                        : qi::grammar<Iterator, std::string(), qi::locals<char>,
      Skipper> {
      //---------------------------------------------------------------------------
      typedef std::string ResultT;
            //---------------------------------------------------------------------

template<typename Iterator , typename Skipper >

Gaudi::Parsers::StringGrammar< Iterator, Skipper >::StringGrammar | ( | ) | `[inline]`

Definition at line 93 of file GrammarsV2.h.

                        : StringGrammar::base_type( str ) {
            begin_quote   = enc::char_("\"'");
            quote     = enc::char_(qi::_r1);

            str = qi::lexeme[begin_quote[qi::_a = qi::_1]
                    > *( (enc::char_('\\') >> quote(qi::_a))[qi::_val += qi::_a]
                        | (enc::char_[qi::_val += qi::_1] - quote(qi::_a))) >
                   quote(qi::_a)]
                  ;
        }

## Member Function Documentation

template<typename Iterator , typename Skipper >

void Gaudi::Parsers::StringGrammar< Iterator, Skipper >::matchString | ( | ) | const`[inline]`

remove CR/LF symbols form the parsed strings

Attention:
  it is a bit dangerous operation The operation allows to write "very long" input strings for opts-files (it is actual e.g. for DataOnDemandSvc configuration) by splitting the strings into few lines All new-line symbols (as well as '
  ', '', CR/LF etc are substituted by ordinary blanks.

Definition at line 261 of file Grammars.h.

          {
            for ( std::string::iterator cur=this->val().begin();
                  cur!=this->val().end();cur++)
            { if(std::isspace(*cur) ) { *cur = ' '; } }
          }

## Member Data Documentation

template<typename Iterator , typename Skipper >

qi::rule< Iterator, char()> Gaudi::Parsers::StringGrammar< Iterator, Skipper >::begin_quote

Definition at line 62 of file Grammar.h.

template<typename Iterator , typename Skipper >

qi::rule< Iterator, void(char)> Gaudi::Parsers::StringGrammar< Iterator, Skipper >::quote

Definition at line 63 of file Grammar.h.

template<typename Iterator , typename Skipper >

qi::rule< Iterator, std::string(), qi::locals< char >, Skipper > Gaudi::Parsers::StringGrammar< Iterator, Skipper >::str

Definition at line 61 of file Grammar.h.

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v23r0/GaudiCoreSvc/src/JobOptionsSvc/Grammar.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v23r0/GaudiKernel/GaudiKernel/Grammars.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v23r0/GaudiKernel/GaudiKernel/GrammarsV2.h

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines