CMS 3D CMS Logo

lat::Regexp Class Reference

#include <Iguana/Utilities/classlib/utils/Regexp.h>

List of all members.

Public Types

enum  MatchOptions {
  MatchNotBOL = 0x01, MatchOffsetBOL = 0x02, MatchNotEOL = 0x04, MatchNoEmpty = 0x08,
  MatchAnchored = 0x10, MatchAll = 0x20, MatchContinue = 0x40
}
enum  Options {
  AnchorAtStart = 0x0010, IgnoreCase = 0x0020, DollarAtEndOnly = 0x0040, DotMatchesAll = 0x0080,
  Extended = 0x0100, MultiLine = 0x0200, Minimal = 0x0400, StandardLocale = 0x2000
}
enum  Syntax { POSIXBasic = 0x0001, POSIXExtended = 0x0002, Perl = 0x0003, Wildcard = 0x0004 }

Public Member Functions

void clearError (void)
bool compile (bool force=false)
void disableOptions (unsigned mask)
bool empty (void) const
void enableOptions (unsigned mask)
const char * errorMessage (void) const
int errorOffset (void) const
bool exactMatch (const std::string &s) const
bool exactMatch (const char *s) const
bool match (const std::string &s, int offset=0, int flags=0, RegexpMatch *result=0) const
bool match (const char *s, int offset=0, int flags=0, RegexpMatch *result=0) const
bool operator!= (const Regexp &x) const
Regexpoperator= (const std::string &x)
Regexpoperator= (const Regexp &x)
bool operator== (const Regexp &x) const
unsigned options (void) const
std::string pattern (void) const
 Regexp (const Regexp &x)
 Regexp (const std::string &pat, unsigned options=0, Syntax s=Perl)
 Regexp (void)
int rsearch (const std::string &s, int offset=-1, int flags=0, RegexpMatch *result=0) const
int rsearch (const char *s, int offset=-1, int flags=0, RegexpMatch *result=0) const
int search (const std::string &s, int offset=0, int flags=0, RegexpMatch *result=0) const
int search (const char *s, int offset=0, int flags=0, RegexpMatch *result=0) const
void setOptions (unsigned value)
void setPattern (const std::string &pat)
void study (void)
Syntax syntax (void) const
bool valid (void) const
 ~Regexp (void)

Static Public Member Functions

static std::string escape (const std::string &text)

Static Public Attributes

static const Regexp rxalpha
static const Regexp rxalphanum
static const Regexp rxdouble
static const Regexp rxidentifier
static const Regexp rxint
static const Regexp rxlowercase
static const Regexp rxuppercase
static const Regexp rxwhite

Protected Member Functions

void uncompile (void)

Private Attributes

unsigned m_options
std::string m_pattern
Rep * m_rep

Static Private Attributes

static const int SyntaxMask = 0x000F


Detailed Description

Definition at line 20 of file Regexp.h.


Member Enumeration Documentation

enum lat::Regexp::MatchOptions

Enumerator:
MatchNotBOL  Option to indicate that the beginning-of-line operator (^) should fail at the beginning of the match string.

Use this option when portions of a string are passed to match() and the beginning of the string is not a beginning of line.

When match() is called without this option and a non-zero start offset, the beginning of the string, not the start offset, is considered to be beginning of line. This is useful when looking for further matches in the string after a previous success.

This option is valid for PERL and POSIX regexps (WILDCARD regexps do not have the concept).

MatchOffsetBOL  Option to indicate that the beginning-of-line operator (^) should succeed at the given start offset, not at the beginning of the string.

Use this option when portions of a string are passed to match() and the beginning of the string is at the supplied start offset.

Without this option, match() assumes that the beginning of the string, not the start offset, is the beginning of the line (except if NotBOL is given).

This option is valid for PERL and POSIX regexps (WILDCARD regexps do not have the concept).

MatchNotEOL  Option to indicate that the end-of-line operator ($) should fail at the end of the match string.

Use this option when passing portions of strings to match() and the end of the string is not a end of line.

This option is valid for PERL and POSIX regexps (WILDCARD regexps do not have the concept).

MatchNoEmpty  Option to indicate that an empty string should not be considered a valid match.

If there are alternatives in the pattern, they are tried. If all alternatives match an empty string, the entire match fails.

This option is valid only for PERL regexps.

MatchAnchored  FIXME (PCRE_ANCHORED).
MatchAll  Option to indicate to look for all possible matches.

MatchContinue  Option to indicate that result should not be automatically cleared but appended to.

Use this to search incrementally for more than one match, without it the search methods reset the match result.

Definition at line 62 of file Regexp.h.

00062                       {
00077         MatchNotBOL     = 0x01,
00078 
00091         MatchOffsetBOL  = 0x02,
00092 
00100         MatchNotEOL     = 0x04,
00101 
00108         MatchNoEmpty    = 0x08,
00109 
00111         MatchAnchored   = 0x10,
00112 
00114         MatchAll        = 0x20,
00115 
00120         MatchContinue   = 0x40
00121     };

enum lat::Regexp::Options

Enumerator:
AnchorAtStart 
IgnoreCase 
DollarAtEndOnly 
DotMatchesAll 
Extended 
MultiLine 
Minimal 
StandardLocale 

Definition at line 46 of file Regexp.h.

00046                  {
00047         AnchorAtStart   = 0x0010, // PCRE
00048         IgnoreCase      = 0x0020, // PCRE, POSIX
00049         DollarAtEndOnly = 0x0040, // PCRE
00050         DotMatchesAll   = 0x0080, // PCRE
00051         Extended        = 0x0100, // PCRE
00052         MultiLine       = 0x0200, // PCRE
00053         Minimal         = 0x0400, // PCRE
00054         // UTF8Chars    = 0x0400, // PCRE
00055         // Extra        = 0x0800, // PCRE
00056         // NoMatchData  = 0x1000, // PCRE?, POSIX
00057         StandardLocale  = 0x2000  // PCRE, POSIX?
00058     };

enum lat::Regexp::Syntax

Enumerator:
POSIXBasic 
POSIXExtended 
Perl 
Wildcard 

Definition at line 37 of file Regexp.h.

00037                 {
00038         POSIXBasic      = 0x0001,       //< POSIX.1 basic regular expression
00039         POSIXExtended   = 0x0002,       //< POSIX.1 extended regular expression
00040         Perl            = 0x0003,       //< PERL regular expression
00041         Wildcard        = 0x0004        //< Bourne shell file name glob pattern
00042     };


Constructor & Destructor Documentation

lat::Regexp::Regexp ( void   ) 

lat::Regexp::Regexp ( const std::string &  pat,
unsigned  options = 0,
Syntax  s = Perl 
)

lat::Regexp::Regexp ( const Regexp x  ) 

lat::Regexp::~Regexp ( void   ) 


Member Function Documentation

void lat::Regexp::clearError ( void   ) 

bool lat::Regexp::compile ( bool  force = false  ) 

void lat::Regexp::disableOptions ( unsigned  mask  ) 

bool lat::Regexp::empty ( void   )  const

void lat::Regexp::enableOptions ( unsigned  mask  ) 

const char* lat::Regexp::errorMessage ( void   )  const

Referenced by DQMService::DQMService().

int lat::Regexp::errorOffset ( void   )  const

Referenced by DQMService::DQMService().

static std::string lat::Regexp::escape ( const std::string &  text  )  [static]

bool lat::Regexp::exactMatch ( const std::string &  s  )  const

bool lat::Regexp::exactMatch ( const char *  s  )  const

bool lat::Regexp::match ( const std::string &  s,
int  offset = 0,
int  flags = 0,
RegexpMatch result = 0 
) const

bool lat::Regexp::match ( const char *  s,
int  offset = 0,
int  flags = 0,
RegexpMatch result = 0 
) const

Referenced by DQMStore::getMatchingContents(), DQMNet::reconstructObject(), DQMNet::reinstateObject(), and DQMStore::useQTestByMatch().

bool lat::Regexp::operator!= ( const Regexp x  )  const

Regexp& lat::Regexp::operator= ( const std::string &  x  ) 

Regexp& lat::Regexp::operator= ( const Regexp x  ) 

bool lat::Regexp::operator== ( const Regexp x  )  const

unsigned lat::Regexp::options ( void   )  const

std::string lat::Regexp::pattern ( void   )  const

int lat::Regexp::rsearch ( const std::string &  s,
int  offset = -1,
int  flags = 0,
RegexpMatch result = 0 
) const

int lat::Regexp::rsearch ( const char *  s,
int  offset = -1,
int  flags = 0,
RegexpMatch result = 0 
) const

int lat::Regexp::search ( const std::string &  s,
int  offset = 0,
int  flags = 0,
RegexpMatch result = 0 
) const

int lat::Regexp::search ( const char *  s,
int  offset = 0,
int  flags = 0,
RegexpMatch result = 0 
) const

Referenced by DQMService::flush().

void lat::Regexp::setOptions ( unsigned  value  ) 

void lat::Regexp::setPattern ( const std::string &  pat  ) 

void lat::Regexp::study ( void   ) 

Referenced by DQMService::DQMService(), DQMStore::getMatchingContents(), and DQMStore::useQTestByMatch().

Syntax lat::Regexp::syntax ( void   )  const

void lat::Regexp::uncompile ( void   )  [protected]

bool lat::Regexp::valid ( void   )  const

Referenced by DQMService::DQMService().


Member Data Documentation

unsigned lat::Regexp::m_options [private]

Definition at line 194 of file Regexp.h.

std::string lat::Regexp::m_pattern [private]

Definition at line 191 of file Regexp.h.

Rep* lat::Regexp::m_rep [private]

Definition at line 195 of file Regexp.h.

const Regexp lat::Regexp::rxalpha [static]

Definition at line 29 of file Regexp.h.

const Regexp lat::Regexp::rxalphanum [static]

Definition at line 32 of file Regexp.h.

const Regexp lat::Regexp::rxdouble [static]

Definition at line 27 of file Regexp.h.

const Regexp lat::Regexp::rxidentifier [static]

Definition at line 33 of file Regexp.h.

const Regexp lat::Regexp::rxint [static]

Definition at line 26 of file Regexp.h.

const Regexp lat::Regexp::rxlowercase [static]

Definition at line 30 of file Regexp.h.

const Regexp lat::Regexp::rxuppercase [static]

Definition at line 31 of file Regexp.h.

const Regexp lat::Regexp::rxwhite [static]

Definition at line 25 of file Regexp.h.

const int lat::Regexp::SyntaxMask = 0x000F [static, private]

Definition at line 188 of file Regexp.h.


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:48:34 2009 for CMSSW by  doxygen 1.5.4