#include <RegexPattern.h>

Collaboration diagram for RegexPattern:

Public Member Functions

 RegexPattern ()=delete
 
 RegexPattern (const SBuf &aPattern, int aFlags)
 
 ~RegexPattern ()
 
 RegexPattern (RegexPattern &&)=delete
 
bool caseSensitive () const
 whether the regex differentiates letter case More...
 
bool isDot () const
 whether this is an "any single character" regex (".") More...
 
bool match (const char *str) const
 
void print (std::ostream &os, const RegexPattern *previous=nullptr) const
 

Private Member Functions

 MEMPROXY_CLASS (RegexPattern)
 

Private Attributes

SBuf pattern
 a regular expression in the text form, suitable for regcomp(3) More...
 
const int flags
 bitmask of REG_* flags for regcomp(3) More...
 
regex_t regex
 a "compiled pattern buffer" filled by regcomp(3) for regexec(3) More...
 

Detailed Description

A regular expression, plain text and compiled representations

Definition at line 23 of file RegexPattern.h.

Constructor & Destructor Documentation

◆ RegexPattern() [1/3]

RegexPattern::RegexPattern ( )
delete

◆ RegexPattern() [2/3]

RegexPattern::RegexPattern ( const SBuf aPattern,
int  aFlags 
)

Definition at line 18 of file RegexPattern.cc.

References SBuf::c_str(), debugs, Debug::Extra(), flags, Here, pattern, regex, and ToSBuf().

◆ ~RegexPattern()

RegexPattern::~RegexPattern ( )

Definition at line 36 of file RegexPattern.cc.

References regex.

◆ RegexPattern() [3/3]

RegexPattern::RegexPattern ( RegexPattern &&  )
delete

Member Function Documentation

◆ caseSensitive()

bool RegexPattern::caseSensitive ( ) const
inline

Definition at line 35 of file RegexPattern.h.

References flags.

Referenced by print().

◆ isDot()

bool RegexPattern::isDot ( ) const
inline

Definition at line 38 of file RegexPattern.h.

References SBuf::length(), and pattern.

◆ match()

bool RegexPattern::match ( const char *  str) const
inline

Definition at line 40 of file RegexPattern.h.

References regex.

Referenced by mimeGetEntry().

◆ MEMPROXY_CLASS()

RegexPattern::MEMPROXY_CLASS ( RegexPattern  )
private

◆ print()

void RegexPattern::print ( std::ostream &  os,
const RegexPattern previous = nullptr 
) const

Attempts to reproduce this regex (context-sensitive) configuration. If the previous regex is nil, may not report default flags. Otherwise, may not report same-as-previous flags (and prepends a space).

Definition at line 42 of file RegexPattern.cc.

References caseSensitive(), flags, and pattern.

Referenced by ACLRegexData::dump(), and operator<<().

Member Data Documentation

◆ flags

const int RegexPattern::flags
private

Definition at line 52 of file RegexPattern.h.

Referenced by RegexPattern(), caseSensitive(), and print().

◆ pattern

SBuf RegexPattern::pattern
private

Definition at line 49 of file RegexPattern.h.

Referenced by RegexPattern(), isDot(), and print().

◆ regex

regex_t RegexPattern::regex
private

Definition at line 55 of file RegexPattern.h.

Referenced by RegexPattern(), ~RegexPattern(), and match().


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors