Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::xpressive::sub_match< BidiIter > Struct Template Reference

Class template sub_match denotes the sequence of characters matched by a particular marked sub-expression. More...

#include <xpressive_fwd.hpp>

Inheritance diagram for boost::xpressive::sub_match< BidiIter >:
Collaboration diagram for boost::xpressive::sub_match< BidiIter >:

Public Types

typedef iterator_value
< BidiIter >::type 
value_type
 
typedef iterator_difference
< BidiIter >::type 
difference_type
 
typedef detail::string_type
< value_type >::type 
string_type
 
typedef BidiIter iterator
 

Public Member Functions

 sub_match ()
 
 sub_match (BidiIter first, BidiIter second, bool matched_=false)
 
string_type str () const
 
 operator string_type () const
 
difference_type length () const
 
 operator bool_type () const
 
bool operator! () const
 
int compare (string_type const &str) const
 Performs a lexicographic string comparison. More...
 
int compare (sub_match const &sub) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
int compare (value_type const *ptr) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 

Public Attributes

bool matched
 true if this sub-match participated in the full match. More...
 

Detailed Description

template<typename BidiIter>
struct boost::xpressive::sub_match< BidiIter >

Class template sub_match denotes the sequence of characters matched by a particular marked sub-expression.

When the marked sub-expression denoted by an object of type sub_match<> participated in a regular expression match then member matched evaluates to true, and members first and second denote the range of characters [first,second) which formed that match. Otherwise matched is false, and members first and second contained undefined values.

If an object of type sub_match<> represents sub-expression 0 - that is to say the whole match - then member matched is always true, unless a partial match was obtained as a result of the flag match_partial being passed to a regular expression algorithm, in which case member matched is false, and members first and second represent the character range that formed the partial match.

Member Typedef Documentation

template<typename BidiIter>
typedef iterator_difference<BidiIter>::type boost::xpressive::sub_match< BidiIter >::difference_type
template<typename BidiIter>
typedef BidiIter boost::xpressive::sub_match< BidiIter >::iterator
template<typename BidiIter>
typedef detail::string_type<value_type>::type boost::xpressive::sub_match< BidiIter >::string_type
template<typename BidiIter>
typedef iterator_value<BidiIter>::type boost::xpressive::sub_match< BidiIter >::value_type

Constructor & Destructor Documentation

template<typename BidiIter>
boost::xpressive::sub_match< BidiIter >::sub_match ( )
inline
template<typename BidiIter>
boost::xpressive::sub_match< BidiIter >::sub_match ( BidiIter  first,
BidiIter  second,
bool  matched_ = false 
)
inline

Member Function Documentation

template<typename BidiIter>
int boost::xpressive::sub_match< BidiIter >::compare ( string_type const &  str) const
inline

Performs a lexicographic string comparison.

Parameters
strthe string against which to compare
Returns
the results of (*this).str().compare(str)

References boost::xpressive::sub_match< BidiIter >::str().

Referenced by boost::xpressive::operator!=(), boost::xpressive::operator<(), boost::xpressive::operator<=(), boost::xpressive::operator==(), boost::xpressive::operator>(), and boost::xpressive::operator>=().

template<typename BidiIter>
int boost::xpressive::sub_match< BidiIter >::compare ( sub_match< BidiIter > const &  sub) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

References boost::xpressive::sub_match< BidiIter >::str().

template<typename BidiIter>
int boost::xpressive::sub_match< BidiIter >::compare ( value_type const *  ptr) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

References boost::xpressive::sub_match< BidiIter >::str().

template<typename BidiIter>
boost::xpressive::sub_match< BidiIter >::operator bool_type ( ) const
inline
template<typename BidiIter>
boost::xpressive::sub_match< BidiIter >::operator string_type ( ) const
inline
template<typename BidiIter>
bool boost::xpressive::sub_match< BidiIter >::operator! ( ) const
inline

Member Data Documentation


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