Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Protected Attributes

GlobExpr Class Reference

Glob-expression matching like UNIX shells. More...

List of all members.

Public Member Functions

 GlobExpr (const char *s=0, bool casesens=true)
 GlobExpr (const GlobExpr &ge)
GlobExproperator= (const GlobExpr &ge)
bool operator== (const GlobExpr &ge) const
void setCaseInSensitive (bool yn=true)
void set (const char *)
 operator const char * () const
bool matches (const char *t) const
const char * expressionFailMessage () const
 Normally null, only filled if invalid expression.

Static Public Member Functions

static bool matches (const char *expression, const char *txt, const char *&errmsg_if_expression_is_incorrect, bool caseinsens)

Static Protected Member Functions

static bool starMatches (const char *, const char *, const char *&, bool)

Protected Attributes

BufferString expr_
const char * errmsg_
bool ci_

Detailed Description

Glob-expression matching like UNIX shells.

Expressions may have '*', '?' and [] (e.g. [a-eA-E]) constructions. Also the inverted selection with '^' or '!' supported (e.g. [^x-z] or [!akPZ]). Escape the special chars with '\';


Constructor & Destructor Documentation

GlobExpr::GlobExpr ( const char *  s = 0,
bool  casesens = true 
) [inline]
GlobExpr::GlobExpr ( const GlobExpr ge  )  [inline]

Member Function Documentation

const char* GlobExpr::expressionFailMessage (  )  const [inline]

Normally null, only filled if invalid expression.

static bool GlobExpr::matches ( const char *  expression,
const char *  txt,
const char *&  errmsg_if_expression_is_incorrect,
bool  caseinsens 
) [static]
bool GlobExpr::matches ( const char *  t  )  const [inline]
GlobExpr::operator const char * (  )  const [inline]
GlobExpr& GlobExpr::operator= ( const GlobExpr ge  )  [inline]
bool GlobExpr::operator== ( const GlobExpr ge  )  const [inline]
void GlobExpr::set ( const char *   ) 
void GlobExpr::setCaseInSensitive ( bool  yn = true  )  [inline]
static bool GlobExpr::starMatches ( const char *  ,
const char *  ,
const char *&  ,
bool   
) [static, protected]

Member Data Documentation

bool GlobExpr::ci_ [protected]
const char* GlobExpr::errmsg_ [protected]