1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
|
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
// $Id: regularExpression.iC,v 1.2 2003/08/26 08:04:11 oliver Exp $
//
BALL_INLINE
void RegularExpression::set(const RegularExpression& regular_expression)
{
pattern_.set(regular_expression.pattern_);
regfree(®ex_);
compilePattern_();
}
BALL_INLINE
void RegularExpression::set(const String& pattern, bool wildcard_pattern)
{
pattern_.set(pattern);
if (wildcard_pattern == true)
{
toExtendedRegularExpression_();
}
regfree(®ex_);
compilePattern_();
}
BALL_INLINE
RegularExpression& RegularExpression::operator = (const RegularExpression& expression)
{
this->set(expression);
return (*this);
}
BALL_INLINE
void RegularExpression::get(RegularExpression& regular_expression) const
{
regular_expression.set(*this);
}
BALL_INLINE
const String& RegularExpression::getPattern() const
{
return pattern_;
}
BALL_INLINE
Size RegularExpression::countSubexpressions() const
{
if (valid_pattern_ == true)
{
return (Size)regex_.re_nsub;
}
return 0;
}
BALL_INLINE
void RegularExpression::clear()
{
set(BALL_REGULAR_EXPRESSION_DEFAULT_PATTERN);
}
BALL_INLINE
void RegularExpression::destroy()
{
clear();
}
BALL_INLINE
bool RegularExpression::isEmpty() const
{
return pattern_.isEmpty();
}
BALL_INLINE
bool RegularExpression::operator == (const RegularExpression& regular_expression) const
{
return (pattern_ == regular_expression.pattern_);
}
BALL_INLINE
bool RegularExpression::operator != (const RegularExpression& regular_expression) const
{
return (pattern_ != regular_expression.pattern_);
}
BALL_INLINE
bool RegularExpression::operator < (const RegularExpression& regular_expression) const
{
return (pattern_ < regular_expression.pattern_);
}
BALL_INLINE
bool RegularExpression::operator <= (const RegularExpression& regular_expression) const
{
return (pattern_ <= regular_expression.pattern_);
}
BALL_INLINE
bool RegularExpression::operator >= (const RegularExpression& regular_expression) const
{
return (pattern_ >= regular_expression.pattern_);
}
BALL_INLINE
bool RegularExpression::operator > (const RegularExpression& regular_expression) const
{
return (pattern_ > regular_expression.pattern_);
}
BALL_INLINE
bool RegularExpression::isValid() const
{
return (valid_pattern_ == true && pattern_.isValid());
}
|