hgl 0.5.25
A compiler/interpreter suite for developing images
Public Member Functions | List of all members
HGL::Common::RegexInitializer Class Reference

Initializes an extended regular expression. More...

#include "regexinitializer.h"

Inherited by HGL::Common::URIImpl::_URIInit.

Public Member Functions

 RegexInitializer (const char *const pattern, bool nosub=false)
 Constructor More...
 
virtual ~RegexInitializer ()
 Destructor More...
 
 operator const regex_t * () const
 Gets the compiled regular expression. More...
 

Detailed Description

Initializes an extended regular expression.

Regular expressions must be compiled before use and freed after use. Therefore it is adviseable to do this in static initialization and destruction. This class will initialize, resp. compile a regular expression in its constructor and freeing it in its destructor.

Author
Heiko Schäfer heiko.nosp@m.@hgl.nosp@m..rang.nosp@m.un.d.nosp@m.e

Constructor & Destructor Documentation

RegexInitializer::RegexInitializer ( const char *const  pattern,
bool  nosub = false 
)
explicit

Constructor

Initializes, resp. compiles the regular expression

Parameters
patternthe pattern to compile
nosubtrue if the REG_NOSUB flag should be set
RegexInitializer::~RegexInitializer ( )
virtual

Destructor

Frees the regular expression

Member Function Documentation

HGL::Common::RegexInitializer::operator const regex_t * ( ) const

Gets the compiled regular expression.

Returns
the compiled regular expression