limal
Public Member Functions | Private Attributes | List of all members
limal::ValuePerlRECheck Class Reference

Perl regex value check. More...

#include <ValuePerlRECheck.hpp>

Inheritance diagram for limal::ValuePerlRECheck:
limal::ValueCheckBase

Public Member Functions

 ValuePerlRECheck (const BLOCXX_NAMESPACE::String &regex, bool icase=false, bool utf8=false)
 
virtual bool isValid (const BLOCXX_NAMESPACE::String &value) const
 
virtual BLOCXX_NAMESPACE::String explain (const BLOCXX_NAMESPACE::String &value) const
 
- Public Member Functions inherited from limal::ValueCheckBase
virtual ~ValueCheckBase ()
 

Private Attributes

BLOCXX_NAMESPACE::PerlRegEx m_reg
 

Additional Inherited Members

- Protected Member Functions inherited from limal::ValueCheckBase
 ValueCheckBase ()
 

Detailed Description

Perl regex value check.

The ValuePerlRECheck implements a simple perl regex match check that can be used in ValueCheck.

Constructor & Destructor Documentation

limal::ValuePerlRECheck::ValuePerlRECheck ( const BLOCXX_NAMESPACE::String &  regex,
bool  icase = false,
bool  utf8 = false 
)

Constructor compiling a perl regular expression used to validate a value.

The match is case sensitive unless the icase flag is set.

Parameters
regexPerl regular expression string.
icaseMatch case insensitive.
utf8Whether to enable UTF8 mode.
Exceptions
blocxx::RegExCompileExceptionon invalid pattern or enabled utf8 mode with pcre that does not support it.

Member Function Documentation

virtual BLOCXX_NAMESPACE::String limal::ValuePerlRECheck::explain ( const BLOCXX_NAMESPACE::String &  value) const
virtual

Return a string showing the regex matching the specified string value.

Parameters
valueA string value.
Returns
A string showing the check.

Implements limal::ValueCheckBase.

virtual bool limal::ValuePerlRECheck::isValid ( const BLOCXX_NAMESPACE::String &  value) const
virtual

Return whether the regular expression matches the specified string value.

Parameters
valueA string value.
Returns
true, if the regex matches the value, false on no match.
Exceptions
blocxx::RegExExecuteExceptionon execute failure.

Implements limal::ValueCheckBase.

Member Data Documentation

BLOCXX_NAMESPACE::PerlRegEx limal::ValuePerlRECheck::m_reg
private

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