2003-05-17 11:55:51 +00:00
|
|
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
|
|
|
<html>
|
|
|
|
|
<head>
|
|
|
|
|
<title>Boost.Regex: sub_match</title>
|
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<LINK href="../../../boost.css" type="text/css" rel="stylesheet"></head>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
<body>
|
|
|
|
|
<P>
|
|
|
|
|
<TABLE id="Table1" cellSpacing="1" cellPadding="1" width="100%" border="0">
|
|
|
|
|
<TR>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<td vAlign="top" width="300">
|
2004-10-05 15:45:52 +00:00
|
|
|
|
<h3><A href="../../../index.htm"><IMG height="86" alt="C++ Boost" src="../../../boost.png" width="277" border="0"></A></h3>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
</td>
|
|
|
|
|
<TD width="353">
|
|
|
|
|
<H1 align="center">Boost.Regex</H1>
|
|
|
|
|
<H2 align="center">sub_match</H2>
|
|
|
|
|
</TD>
|
|
|
|
|
<td width="50">
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<h3><A href="index.html"><IMG height="45" alt="Boost.Regex Index" src="uarrow.gif" width="43" border="0"></A></h3>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
</td>
|
|
|
|
|
</TR>
|
|
|
|
|
</TABLE>
|
|
|
|
|
</P>
|
|
|
|
|
<HR>
|
|
|
|
|
<H3>Synopsis</H3>
|
2003-05-24 11:13:26 +00:00
|
|
|
|
<P>#include <<A href="../../../boost/regex.hpp">boost/regex.hpp</A>>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
</P>
|
|
|
|
|
<P>Regular expressions are different from many simple pattern-matching algorithms
|
|
|
|
|
in that as well as finding an overall match they can also produce
|
|
|
|
|
sub-expression matches: each sub-expression being delimited in the pattern by a
|
|
|
|
|
pair of parenthesis (...). There has to be some method for reporting
|
|
|
|
|
sub-expression matches back to the user: this is achieved this by defining a
|
2003-05-24 11:13:26 +00:00
|
|
|
|
class <I><A href="match_results.html">match_results</A></I> that acts as an
|
2003-05-17 11:55:51 +00:00
|
|
|
|
indexed collection of sub-expression matches, each sub-expression match being
|
|
|
|
|
contained in an object of type <I>sub_match</I>
|
|
|
|
|
.
|
|
|
|
|
<P>Objects of type <EM>sub_match</EM> may only obtained by subscripting an object
|
|
|
|
|
of type <EM><A href="match_results.html">match_results</A></EM>
|
|
|
|
|
.
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<P>Objects of type <EM>sub_match</EM> may be compared to objects of type <EM>std::basic_string</EM>,
|
|
|
|
|
or <EM>const charT*</EM> or <EM>const charT</EM>
|
|
|
|
|
.
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P>Objects of type <EM>sub_match</EM> may be added to objects of type <EM>std::basic_string</EM>,
|
|
|
|
|
or <EM>const charT* </EM>or <EM>const charT</EM>, to produce a new <EM>std::basic_string
|
|
|
|
|
</EM>
|
|
|
|
|
object.
|
2003-05-17 11:55:51 +00:00
|
|
|
|
<P>When the marked sub-expression denoted by an object of type sub_match<>
|
|
|
|
|
participated in a regular expression match then member <CODE>matched</CODE> evaluates
|
|
|
|
|
to true, and members <CODE>first</CODE> and <CODE>second</CODE> denote the
|
|
|
|
|
range of characters <CODE>[first,second)</CODE> which formed that match.
|
|
|
|
|
Otherwise <CODE>matched</CODE> is false, and members <CODE>first</CODE> and <CODE>second</CODE>
|
|
|
|
|
contained undefined values.</P>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P>When the marked sub-expression denoted by an object of type sub_match<>
|
|
|
|
|
was repeated, then the sub_match object represents the match obtained by the
|
|
|
|
|
last repeat. The complete set of all the captures obtained for all the
|
|
|
|
|
repeats, may be accessed via the captures() member function (Note: this has
|
|
|
|
|
serious performance implications, you have to explicitly enable this feature).</P>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
<P>If an object of type <CODE>sub_match<></CODE> represents sub-expression 0
|
|
|
|
|
- that is to say the whole match - then member <CODE>matched</CODE> is always
|
|
|
|
|
true, unless a partial match was obtained as a result of the flag <CODE>match_partial</CODE>
|
|
|
|
|
being passed to a regular expression algorithm, in which case member <CODE>matched</CODE>
|
|
|
|
|
is false, and members <CODE>first</CODE> and <CODE>second</CODE> represent the
|
|
|
|
|
character range that formed the partial match.</P>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<PRE>namespace boost{
|
2003-05-17 11:55:51 +00:00
|
|
|
|
|
|
|
|
|
template <class BidirectionalIterator>
|
|
|
|
|
class sub_match : public std::pair<BidirectionalIterator, BidirectionalIterator>
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
typedef typename iterator_traits<BidirectionalIterator>::value_type value_type;
|
|
|
|
|
typedef typename iterator_traits<BidirectionalIterator>::difference_type difference_type;
|
|
|
|
|
typedef BidirectionalIterator iterator;
|
|
|
|
|
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#m1" >matched</A>;
|
2003-05-17 11:55:51 +00:00
|
|
|
|
|
2003-12-13 12:28:48 +00:00
|
|
|
|
difference_type <A href="#m2" >length</A>()const;
|
|
|
|
|
operator <A href="#m3" >basic_string</A><value_type>()const;
|
|
|
|
|
basic_string<value_type> <A href="#m4" >str</A>()const;
|
2003-05-17 11:55:51 +00:00
|
|
|
|
|
2003-12-13 12:28:48 +00:00
|
|
|
|
int <A href="#m5" >compare</A>(const sub_match& s)const;
|
|
|
|
|
int <A href="#m6" >compare</A>(const basic_string<value_type>& s)const;
|
|
|
|
|
int <A href="#m7" >compare</A>(const value_type* s)const;
|
|
|
|
|
#ifdef BOOST_REGEX_MATCH_EXTRA
|
|
|
|
|
typedef implementation-private <A href="#m9">capture_sequence_type</A>;
|
|
|
|
|
const capture_sequence_type& <A href="#m8" >captures</A>()const;
|
|
|
|
|
#endif
|
2003-05-17 11:55:51 +00:00
|
|
|
|
};
|
2003-10-21 11:18:40 +00:00
|
|
|
|
//
|
|
|
|
|
// comparisons to another sub_match:
|
|
|
|
|
//
|
2003-05-17 11:55:51 +00:00
|
|
|
|
template <class BidirectionalIterator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o11" >operator</A> == (const sub_match<BidirectionalIterator>& lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
const sub_match<BidirectionalIterator>& rhs);
|
|
|
|
|
template <class BidirectionalIterator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o12" >operator</A> != (const sub_match<BidirectionalIterator>& lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
const sub_match<BidirectionalIterator>& rhs);
|
|
|
|
|
template <class BidirectionalIterator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o13" >operator</A> < (const sub_match<BidirectionalIterator>& lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
const sub_match<BidirectionalIterator>& rhs);
|
|
|
|
|
template <class BidirectionalIterator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o14" >operator</A> <= (const sub_match<BidirectionalIterator>& lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
const sub_match<BidirectionalIterator>& rhs);
|
|
|
|
|
template <class BidirectionalIterator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o15" >operator</A> >= (const sub_match<BidirectionalIterator>& lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
const sub_match<BidirectionalIterator>& rhs);
|
|
|
|
|
template <class BidirectionalIterator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o16" >operator</A> > (const sub_match<BidirectionalIterator>& lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
const sub_match<BidirectionalIterator>& rhs);
|
|
|
|
|
|
|
|
|
|
|
2003-10-21 11:18:40 +00:00
|
|
|
|
//
|
|
|
|
|
// comparisons to a basic_string:
|
|
|
|
|
//
|
2003-05-17 11:55:51 +00:00
|
|
|
|
template <class BidirectionalIterator, class traits, class Allocator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o21" >operator</A> == (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
const sub_match<BidirectionalIterator>& rhs);
|
|
|
|
|
template <class BidirectionalIterator, class traits, class Allocator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o22" >operator</A> != (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
const sub_match<BidirectionalIterator>& rhs);
|
|
|
|
|
template <class BidirectionalIterator, class traits, class Allocator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o23" >operator</A> < (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
const sub_match<BidirectionalIterator>& rhs);
|
|
|
|
|
template <class BidirectionalIterator, class traits, class Allocator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o24" >operator</A> > (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
const sub_match<BidirectionalIterator>& rhs);
|
|
|
|
|
template <class BidirectionalIterator, class traits, class Allocator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o25" >operator</A> >= (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
const sub_match<BidirectionalIterator>& rhs);
|
|
|
|
|
template <class BidirectionalIterator, class traits, class Allocator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o26" >operator</A> <= (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
const sub_match<BidirectionalIterator>& rhs);
|
|
|
|
|
|
|
|
|
|
template <class BidirectionalIterator, class traits, class Allocator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o31" >operator</A> == (const sub_match<BidirectionalIterator>& lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& rhs);
|
|
|
|
|
template <class BidirectionalIterator, class traits, class Allocator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o32" >operator</A> != (const sub_match<BidirectionalIterator>& lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& rhs);
|
|
|
|
|
template <class BidirectionalIterator, class traits, class Allocator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o33" >operator</A> < (const sub_match<BidirectionalIterator>& lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& rhs);
|
|
|
|
|
template <class BidirectionalIterator, class traits, class Allocator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o34" >operator</A> > (const sub_match<BidirectionalIterator>& lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& rhs);
|
|
|
|
|
template <class BidirectionalIterator, class traits, class Allocator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o35" >operator</A> >= (const sub_match<BidirectionalIterator>& lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& rhs);
|
|
|
|
|
template <class BidirectionalIterator, class traits, class Allocator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o36" >operator</A> <= (const sub_match<BidirectionalIterator>& lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& rhs);
|
|
|
|
|
|
2003-10-21 11:18:40 +00:00
|
|
|
|
//
|
|
|
|
|
// comparisons to a pointer to a character array:
|
|
|
|
|
//
|
2003-05-17 11:55:51 +00:00
|
|
|
|
template <class BidirectionalIterator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o41" >operator</A> == (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
const sub_match<BidirectionalIterator>& rhs);
|
|
|
|
|
template <class BidirectionalIterator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o42" >operator</A> != (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
const sub_match<BidirectionalIterator>& rhs);
|
|
|
|
|
template <class BidirectionalIterator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o43" >operator</A> < (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
const sub_match<BidirectionalIterator>& rhs);
|
|
|
|
|
template <class BidirectionalIterator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o44" >operator</A> > (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
const sub_match<BidirectionalIterator>& rhs);
|
|
|
|
|
template <class BidirectionalIterator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o45" >operator</A> >= (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
const sub_match<BidirectionalIterator>& rhs);
|
|
|
|
|
template <class BidirectionalIterator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o46" >operator</A> <= (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
const sub_match<BidirectionalIterator>& rhs);
|
|
|
|
|
|
|
|
|
|
template <class BidirectionalIterator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o51" >operator</A> == (const sub_match<BidirectionalIterator>& lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
typename iterator_traits<BidirectionalIterator>::value_type const* rhs);
|
|
|
|
|
template <class BidirectionalIterator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o52" >operator</A> != (const sub_match<BidirectionalIterator>& lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
typename iterator_traits<BidirectionalIterator>::value_type const* rhs);
|
|
|
|
|
template <class BidirectionalIterator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o53" >operator</A> < (const sub_match<BidirectionalIterator>& lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
typename iterator_traits<BidirectionalIterator>::value_type const* rhs);
|
|
|
|
|
template <class BidirectionalIterator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o54" >operator</A> > (const sub_match<BidirectionalIterator>& lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
typename iterator_traits<BidirectionalIterator>::value_type const* rhs);
|
|
|
|
|
template <class BidirectionalIterator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o55" >operator</A> >= (const sub_match<BidirectionalIterator>& lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
typename iterator_traits<BidirectionalIterator>::value_type const* rhs);
|
|
|
|
|
template <class BidirectionalIterator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o56" >operator</A> <= (const sub_match<BidirectionalIterator>& lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
typename iterator_traits<BidirectionalIterator>::value_type const* rhs);
|
|
|
|
|
|
2003-10-21 11:18:40 +00:00
|
|
|
|
//
|
|
|
|
|
// comparisons to a single character:
|
|
|
|
|
//
|
2003-05-17 11:55:51 +00:00
|
|
|
|
template <class BidirectionalIterator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o61" >operator</A> == (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
const sub_match<BidirectionalIterator>& rhs);
|
|
|
|
|
template <class BidirectionalIterator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o62" >operator</A> != (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
const sub_match<BidirectionalIterator>& rhs);
|
|
|
|
|
template <class BidirectionalIterator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o63" >operator</A> < (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
const sub_match<BidirectionalIterator>& rhs);
|
|
|
|
|
template <class BidirectionalIterator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o64" >operator</A> > (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
const sub_match<BidirectionalIterator>& rhs);
|
|
|
|
|
template <class BidirectionalIterator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o65" >operator</A> >= (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
const sub_match<BidirectionalIterator>& rhs);
|
|
|
|
|
template <class BidirectionalIterator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o66" >operator</A> <= (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
const sub_match<BidirectionalIterator>& rhs);
|
|
|
|
|
|
|
|
|
|
template <class BidirectionalIterator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o71" >operator</A> == (const sub_match<BidirectionalIterator>& lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
typename iterator_traits<BidirectionalIterator>::value_type const& rhs);
|
|
|
|
|
template <class BidirectionalIterator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o72" >operator</A> != (const sub_match<BidirectionalIterator>& lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
typename iterator_traits<BidirectionalIterator>::value_type const& rhs);
|
|
|
|
|
template <class BidirectionalIterator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o73" >operator</A> < (const sub_match<BidirectionalIterator>& lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
typename iterator_traits<BidirectionalIterator>::value_type const& rhs);
|
|
|
|
|
template <class BidirectionalIterator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o74" >operator</A> > (const sub_match<BidirectionalIterator>& lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
typename iterator_traits<BidirectionalIterator>::value_type const& rhs);
|
|
|
|
|
template <class BidirectionalIterator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o75" >operator</A> >= (const sub_match<BidirectionalIterator>& lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
typename iterator_traits<BidirectionalIterator>::value_type const& rhs);
|
|
|
|
|
template <class BidirectionalIterator>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
bool <A href="#o76" >operator</A> <= (const sub_match<BidirectionalIterator>& lhs,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
typename iterator_traits<BidirectionalIterator>::value_type const& rhs);
|
2003-10-21 11:18:40 +00:00
|
|
|
|
//
|
|
|
|
|
// addition operators:
|
|
|
|
|
//
|
2003-12-13 12:28:48 +00:00
|
|
|
|
template <class BidirectionalIterator, class traits, class Allocator>
|
|
|
|
|
std::basic_string<typename iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>
|
|
|
|
|
<A href="#o81" >operator</A> + (const std::basic_string<typename iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& s,
|
|
|
|
|
const sub_match<BidirectionalIterator>& m);
|
|
|
|
|
template <class BidirectionalIterator, class traits, class Allocator>
|
|
|
|
|
std::basic_string<typename iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>
|
|
|
|
|
<A href="#o82" >operator</A> + (const sub_match<BidirectionalIterator>& m,
|
|
|
|
|
const std::basic_string<typename iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& s);
|
|
|
|
|
template <class BidirectionalIterator> std::basic_string<typename iterator_traits<BidirectionalIterator>::value_type>
|
|
|
|
|
<A href="#o83" >operator</A> + (typename iterator_traits<BidirectionalIterator>::value_type const* s,
|
|
|
|
|
const sub_match<BidirectionalIterator>& m);
|
|
|
|
|
template <class BidirectionalIterator> std::basic_string<typename iterator_traits<BidirectionalIterator>::value_type>
|
|
|
|
|
<A href="#o84" >operator</A> + (const sub_match<BidirectionalIterator>& m,
|
|
|
|
|
typename iterator_traits<BidirectionalIterator>::value_type const * s);
|
|
|
|
|
template <class BidirectionalIterator>
|
|
|
|
|
std::basic_string<typename iterator_traits<BidirectionalIterator>::value_type>
|
|
|
|
|
<A href="#o85" >operator</A> + (typename iterator_traits<BidirectionalIterator>::value_type const& s,
|
|
|
|
|
const sub_match<BidirectionalIterator>& m);
|
|
|
|
|
template <class BidirectionalIterator>
|
|
|
|
|
std::basic_string<typename iterator_traits<BidirectionalIterator>::value_type>
|
|
|
|
|
<A href="#o86" >operator</A> + (const sub_match<BidirectionalIterator>& m,
|
|
|
|
|
typename iterator_traits<BidirectionalIterator>::value_type const& s);
|
|
|
|
|
template <class BidirectionalIterator>
|
|
|
|
|
std::basic_string<typename iterator_traits<BidirectionalIterator>::value_type>
|
|
|
|
|
<A href="#o87" >operator</A> + (const sub_match<BidirectionalIterator>& m1,
|
|
|
|
|
const sub_match<BidirectionalIterator>& m2);
|
2003-05-17 11:55:51 +00:00
|
|
|
|
|
2003-10-21 11:18:40 +00:00
|
|
|
|
//
|
|
|
|
|
// stream inserter:
|
|
|
|
|
//
|
2003-05-17 11:55:51 +00:00
|
|
|
|
template <class charT, class traits, class BidirectionalIterator>
|
|
|
|
|
basic_ostream<charT, traits>&
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<A href="#oi" >operator</A> << (basic_ostream<charT, traits>& os,
|
2003-05-17 11:55:51 +00:00
|
|
|
|
const sub_match<BidirectionalIterator>& m);
|
|
|
|
|
|
|
|
|
|
} // namespace boost</PRE>
|
|
|
|
|
<H3>Description</H3>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<H4>sub_match members</H4>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
<PRE>typedef typename std::iterator_traits<iterator>::value_type value_type;</PRE>
|
|
|
|
|
<P>The type pointed to by the iterators.</P>
|
|
|
|
|
<PRE>typedef typename std::iterator_traits<iterator>::difference_type difference_type;</PRE>
|
|
|
|
|
<P>A type that represents the difference between two iterators.</P>
|
|
|
|
|
<PRE>typedef iterator iterator_type;</PRE>
|
|
|
|
|
<P>The iterator type.</P>
|
|
|
|
|
<PRE>iterator first</PRE>
|
|
|
|
|
<P>An iterator denoting the position of the start of the match.</P>
|
|
|
|
|
<PRE>iterator second</PRE>
|
|
|
|
|
<P>An iterator denoting the position of the end of the match.</P>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<PRE><A name=m1></A>bool matched</PRE>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
<P>A Boolean value denoting whether this sub-expression participated in the match.</P>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<PRE><A name=m2></A>static difference_type length();</PRE>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P><B>Effects: </B>returns the length of this matched sub-expression, or 0 if this
|
2003-10-21 11:18:40 +00:00
|
|
|
|
sub-expression was not matched: <CODE>matched ? distance(first, second) : 0)</CODE>.</P>
|
|
|
|
|
<PRE><A name=m3></A>operator basic_string<value_type>()const;</PRE>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P><B>Effects: </B>converts *this into a string: returns <CODE>(matched ?
|
2003-10-21 11:18:40 +00:00
|
|
|
|
basic_string<value_type>(first, second) :
|
|
|
|
|
basic_string<value_type>()).</P>
|
|
|
|
|
</CODE><PRE><A name=m4></A>basic_string<value_type> str()const;</PRE>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P><B>Effects: </B>returns a string representation of *this: <CODE>(matched ?
|
2003-10-21 11:18:40 +00:00
|
|
|
|
basic_string<value_type>(first, second) :
|
|
|
|
|
basic_string<value_type>())</CODE>.</P>
|
|
|
|
|
<PRE><A name=m5></A>int compare(const sub_match& s)const;</PRE>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P><B>Effects: </B>performs a lexical comparison to <EM>s</EM>: returns <CODE>str().compare(s.str())</CODE>.</P>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<PRE><A name=m6></A>int compare(const basic_string<value_type>& s)const;</PRE>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P><B>Effects: </B>compares *this to the string s: returns <CODE>str().compare(s)</CODE>.</P>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<PRE><A name=m7></A>int compare(const value_type* s)const;</PRE>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P><B>Effects:<B></B> </B>compares *this to the null-terminated string <EM>s</EM>:<B> </B>returns
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<CODE>str().compare(s)</CODE>.</P>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<PRE><A name=m9></A>typedef implementation-private capture_sequence_type;</PRE>
|
|
|
|
|
<P>Defines an implementation-specific type that satisfies the requirements of
|
|
|
|
|
a standard library Sequence (21.1.1 including the optional Table 68
|
|
|
|
|
operations), whose value_type is a <EM>sub_match<BidirectionalIterator></EM>. This
|
|
|
|
|
type happens to be <EM>std::vector<sub_match<BidirectionalIterator> ></EM>,
|
|
|
|
|
but you shouldn't actually rely on that.</P>
|
|
|
|
|
<PRE><A name=m8></A>const capture_sequence_type& <A href="#m8" >captures</A>()const; </PRE>
|
|
|
|
|
<P><STRONG>Effects:</STRONG> returns a sequence containing all the captures
|
|
|
|
|
obtained for this sub-expression.</P>
|
|
|
|
|
<P><STRONG>Preconditions:</STRONG> the library must be built and used with
|
|
|
|
|
BOOST_REGEX_MATCH_EXTRA defined, and you must pass the flag <A href="match_flag_type.html">
|
|
|
|
|
match_extra</A> to the regex matching functions (<A href="regex_match.html">regex_match</A>,
|
|
|
|
|
<A href="regex_search.html">regex_search</A>, <A href="regex_iterator.html">regex_iterator</A>
|
|
|
|
|
or <A href="regex_token_iterator.html">regex_token_iterator</A>) in order for
|
|
|
|
|
this member function to be defined and return useful information.</P>
|
|
|
|
|
<P><STRONG>Rationale:</STRONG> Enabling this feature has several consequences:
|
|
|
|
|
</P>
|
|
|
|
|
<UL>
|
|
|
|
|
<LI>
|
|
|
|
|
sub_match occupies more memory resulting in complex expressions running out of
|
|
|
|
|
memory or stack space more quickly during matching.
|
|
|
|
|
<LI>
|
|
|
|
|
The matching algorithms are less efficient at handling some features
|
|
|
|
|
(independent sub-expressions for example), even when match_extra is not used.
|
|
|
|
|
<LI>
|
|
|
|
|
The matching algorithms are much less efficient (i.e. slower), when match_extra
|
|
|
|
|
is used. Mostly this is down to the extra memory allocations that have to
|
|
|
|
|
take place.</LI></UL>
|
|
|
|
|
<H4>sub_match non-member operators</H4>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<H5>Comparisons against self</H5>
|
|
|
|
|
<PRE><A name=o11></A>template <class BidirectionalIterator>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
bool operator == (const sub_match<BidirectionalIterator>& lhs,
|
|
|
|
|
const sub_match<BidirectionalIterator>& rhs);</PRE>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs.compare(rhs) == 0</CODE>.</P>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<PRE><A name=o12></A>template <class BidirectionalIterator>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
bool operator != (const sub_match<BidirectionalIterator>& lhs,
|
|
|
|
|
const sub_match<BidirectionalIterator>& rhs);</PRE>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs.compare(rhs) != 0</CODE>.</P>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<PRE><A name=o13></A>template <class BidirectionalIterator>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
bool operator < (const sub_match<BidirectionalIterator>& lhs,
|
|
|
|
|
const sub_match<BidirectionalIterator>& rhs);</PRE>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs.compare(rhs) < 0</CODE>.</P>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<PRE><A name=o14></A>template <class BidirectionalIterator>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
bool operator <= (const sub_match<BidirectionalIterator>& lhs,
|
|
|
|
|
const sub_match<BidirectionalIterator>& rhs);</PRE>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs.compare(rhs) <= 0</CODE>.</P>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<PRE><A name=o15></A>template <class BidirectionalIterator>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
bool operator >= (const sub_match<BidirectionalIterator>& lhs,
|
|
|
|
|
const sub_match<BidirectionalIterator>& rhs);</PRE>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs.compare(rhs) >= 0</CODE>.</P>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<PRE><A name=o16></A>template <class BidirectionalIterator>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
bool operator > (const sub_match<BidirectionalIterator>& lhs,
|
|
|
|
|
const sub_match<BidirectionalIterator>& rhs);</PRE>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs.compare(rhs) > 0</CODE>.</P>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<H5>Comparisons with std::basic_string</H5>
|
|
|
|
|
<pre><A name=o21></A>
|
|
|
|
|
template <class BidirectionalIterator, class traits, class Allocator>
|
|
|
|
|
bool operator == (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits,
|
|
|
|
|
Allocator>& lhs, const sub_match<BidirectionalIterator>& rhs);
|
|
|
|
|
</pre>
|
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs == rhs.str()</CODE>.</P>
|
|
|
|
|
<PRE><A name=o22></A>template <class BidirectionalIterator, class traits, class Allocator>
|
|
|
|
|
bool operator != (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
|
|
|
|
const sub_match<BidirectionalIterator>& rhs);</PRE>
|
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs != rhs.str()</CODE>.</P>
|
|
|
|
|
<PRE><A name=o23></A>template <class BidirectionalIterator, class traits, class Allocator>
|
|
|
|
|
bool operator < (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
|
|
|
|
const sub_match<BidirectionalIterator>& rhs);</PRE>
|
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs < rhs.str()</CODE>.</P>
|
|
|
|
|
<PRE><A name=o24></A>template <class BidirectionalIterator, class traits, class Allocator>
|
|
|
|
|
bool operator > (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
|
|
|
|
const sub_match<BidirectionalIterator>& rhs);</PRE>
|
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs > rhs.str()</CODE>.</P>
|
|
|
|
|
<PRE><A name=o25></A>template <class BidirectionalIterator, class traits, class Allocator>
|
|
|
|
|
bool operator >= (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
|
|
|
|
const sub_match<BidirectionalIterator>& rhs);</PRE>
|
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs >= rhs.str()</CODE>.</P>
|
|
|
|
|
<PRE><A name=o26></A>template <class BidirectionalIterator, class traits, class Allocator>
|
|
|
|
|
bool operator <= (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
|
|
|
|
const sub_match<BidirectionalIterator>& rhs);</PRE>
|
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs <= rhs.str()</CODE>.</P>
|
|
|
|
|
<PRE><A name=o31></A>template <class BidirectionalIterator, class traits, class Allocator>
|
|
|
|
|
bool operator == (const sub_match<BidirectionalIterator>& lhs,
|
|
|
|
|
const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& rhs);</PRE>
|
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs.str() == rhs</CODE>.</P>
|
|
|
|
|
<PRE><A name=o32></A>template <class BidirectionalIterator, class traits, class Allocator>
|
|
|
|
|
bool operator != (const sub_match<BidirectionalIterator>& lhs,
|
|
|
|
|
const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& rhs);</PRE>
|
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs.str() != rhs</CODE>.</P>
|
|
|
|
|
<PRE><A name=o33></A>template <class BidirectionalIterator, class traits, class Allocator>
|
|
|
|
|
bool operator < (const sub_match<BidirectionalIterator>& lhs,
|
|
|
|
|
const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& rhs);</PRE>
|
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs.str() < rhs</CODE>.</P>
|
|
|
|
|
<PRE><A name=o34></A>template <class BidirectionalIterator, class traits, class Allocator>
|
|
|
|
|
bool operator > (const sub_match<BidirectionalIterator>& lhs,
|
|
|
|
|
const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& rhs);</PRE>
|
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs.str() > rhs</CODE>.</P>
|
|
|
|
|
<PRE><A name=o35></A>template <class BidirectionalIterator, class traits, class Allocator>
|
|
|
|
|
bool operator >= (const sub_match<BidirectionalIterator>& lhs,
|
|
|
|
|
const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& rhs);</PRE>
|
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs.str() >= rhs</CODE>.</P>
|
|
|
|
|
<PRE><A name=o36></A>template <class BidirectionalIterator, class traits, class Allocator>
|
|
|
|
|
bool operator <= (const sub_match<BidirectionalIterator>& lhs,
|
|
|
|
|
const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& rhs);</PRE>
|
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs.str() <= rhs</CODE>.</P>
|
|
|
|
|
<H5>Comparisons with null-terminated strings</H5>
|
|
|
|
|
<PRE><A name=o41></A>template <class BidirectionalIterator>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
bool operator == (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
|
|
|
|
const sub_match<BidirectionalIterator>& rhs); </PRE>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs == rhs.str()</CODE>.</P>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<PRE><A name=o42></A>template <class BidirectionalIterator>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
bool operator != (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
|
|
|
|
const sub_match<BidirectionalIterator>& rhs); </PRE>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs != rhs.str()</CODE>.</P>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<PRE></A><A name=o43></A>template <class BidirectionalIterator>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
bool operator < (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
|
|
|
|
const sub_match<BidirectionalIterator>& rhs); </PRE>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs < rhs.str()</CODE>.</P>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<PRE><A name=o44></A>template <class BidirectionalIterator>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
bool operator > (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
|
|
|
|
const sub_match<BidirectionalIterator>& rhs); </PRE>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs > rhs.str()</CODE>.</P>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<PRE><A name=o45></A>template <class BidirectionalIterator>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
bool operator >= (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
|
|
|
|
const sub_match<BidirectionalIterator>& rhs); </PRE>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs >= rhs.str()</CODE>.</P>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<PRE><A name=o46></A>template <class BidirectionalIterator>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
bool operator <= (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
|
|
|
|
const sub_match<BidirectionalIterator>& rhs); </PRE>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs <= rhs.str()</CODE>.</P>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<PRE><A name=o51></A>template <class BidirectionalIterator>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
bool operator == (const sub_match<BidirectionalIterator>& lhs,
|
|
|
|
|
typename iterator_traits<BidirectionalIterator>::value_type const* rhs); </PRE>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs.str() == rhs</CODE>.</P>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<PRE><A name=o52></A>template <class BidirectionalIterator>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
bool operator != (const sub_match<BidirectionalIterator>& lhs,
|
|
|
|
|
typename iterator_traits<BidirectionalIterator>::value_type const* rhs); </PRE>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs.str() != rhs</CODE>.</P>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<PRE><A name=o53></A>template <class BidirectionalIterator>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
bool operator < (const sub_match<BidirectionalIterator>& lhs,
|
|
|
|
|
typename iterator_traits<BidirectionalIterator>::value_type const* rhs); </PRE>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs.str() < rhs</CODE>.</P>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<PRE><A name=o54></A>template <class BidirectionalIterator>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
bool operator > (const sub_match<BidirectionalIterator>& lhs,
|
|
|
|
|
typename iterator_traits<BidirectionalIterator>::value_type const* rhs); </PRE>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs.str() > rhs</CODE>.</P>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<PRE><A name=o55></A>template <class BidirectionalIterator>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
bool operator >= (const sub_match<BidirectionalIterator>& lhs,
|
|
|
|
|
typename iterator_traits<BidirectionalIterator>::value_type const* rhs); </PRE>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs.str() >= rhs</CODE>.</P>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<PRE><A name=o56></A>template <class BidirectionalIterator>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
bool operator <= (const sub_match<BidirectionalIterator>& lhs,
|
|
|
|
|
typename iterator_traits<BidirectionalIterator>::value_type const* rhs); </PRE>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs.str() <= rhs</CODE>.</P>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<H5>Comparisons with a single character</H5>
|
|
|
|
|
<PRE><A name=o61></A>template <class BidirectionalIterator>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
bool operator == (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
|
|
|
|
const sub_match<BidirectionalIterator>& rhs); </PRE>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs == rhs.str()</CODE>.</P>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<PRE><A name=o62></A>template <class BidirectionalIterator>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
bool operator != (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
|
|
|
|
const sub_match<BidirectionalIterator>& rhs); </PRE>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs != rhs.str()</CODE>.</P>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<PRE><A name=o63></A>template <class BidirectionalIterator>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
bool operator < (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
|
|
|
|
const sub_match<BidirectionalIterator>& rhs); </PRE>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs < rhs.str()</CODE>.</P>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<PRE><A name=o64></A>template <class BidirectionalIterator>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
bool operator > (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
|
|
|
|
const sub_match<BidirectionalIterator>& rhs); </PRE>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs > rhs.str()</CODE>.</P>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<PRE><A name=o65></A>template <class BidirectionalIterator>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
bool operator >= (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
|
|
|
|
const sub_match<BidirectionalIterator>& rhs); </PRE>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs >= rhs.str()</CODE>.</P>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<PRE><A name=o66></A>template <class BidirectionalIterator>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
bool operator <= (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
|
|
|
|
const sub_match<BidirectionalIterator>& rhs); </PRE>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs <= rhs.str()</CODE>.</P>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<PRE><A name=o71></A>template <class BidirectionalIterator>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
bool operator == (const sub_match<BidirectionalIterator>& lhs,
|
|
|
|
|
typename iterator_traits<BidirectionalIterator>::value_type const& rhs); </PRE>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs.str() == rhs</CODE>.</P>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<PRE><A name=o72></A>template <class BidirectionalIterator>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
bool operator != (const sub_match<BidirectionalIterator>& lhs,
|
|
|
|
|
typename iterator_traits<BidirectionalIterator>::value_type const& rhs); </PRE>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs.str() != rhs</CODE>.</P>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<PRE><A name=o73></A>template <class BidirectionalIterator>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
bool operator < (const sub_match<BidirectionalIterator>& lhs,
|
|
|
|
|
typename iterator_traits<BidirectionalIterator>::value_type const& rhs); </PRE>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs.str() < rhs</CODE>.</P>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<PRE><A name=o74></A>template <class BidirectionalIterator>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
bool operator > (const sub_match<BidirectionalIterator>& lhs,
|
|
|
|
|
typename iterator_traits<BidirectionalIterator>::value_type const& rhs); </PRE>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs.str() > rhs</CODE>.</P>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<PRE><A name=o75></A>template <class BidirectionalIterator>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
bool operator >= (const sub_match<BidirectionalIterator>& lhs,
|
|
|
|
|
typename iterator_traits<BidirectionalIterator>::value_type const& rhs); </PRE>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs.str() >= rhs</CODE>.</P>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<PRE><A name=o76></A>template <class BidirectionalIterator>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
bool operator <= (const sub_match<BidirectionalIterator>& lhs,
|
|
|
|
|
typename iterator_traits<BidirectionalIterator>::value_type const& rhs); </PRE>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>lhs.str() <= rhs</CODE>.</P>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<h5>Addition operators</h5>
|
|
|
|
|
<P>The addition operators for sub_match allow you to add a sub_match to any type
|
|
|
|
|
to which you can add a std::string and obtain a new string as the result.</P>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<PRE><A name=o81></A>template <class BidirectionalIterator, class traits, class Allocator>
|
|
|
|
|
std::basic_string<typename iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>
|
|
|
|
|
operator + (const std::basic_string<typename iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& s,
|
|
|
|
|
const sub_match<BidirectionalIterator>& m); </PRE>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>s + m.str()</CODE>.</P>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<PRE><A name=o82></A>template <class BidirectionalIterator, class traits, class Allocator>
|
|
|
|
|
std::basic_string<typename iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>
|
|
|
|
|
operator + (const sub_match<BidirectionalIterator>& m,
|
|
|
|
|
const std::basic_string<typename iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& s); </PRE>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>m.str() + s</CODE>.</P>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<PRE><A name=o83></A>template <class BidirectionalIterator> std::basic_string<typename iterator_traits<BidirectionalIterator>::value_type>
|
|
|
|
|
operator + (typename iterator_traits<BidirectionalIterator>::value_type const* s,
|
|
|
|
|
const sub_match<BidirectionalIterator>& m); </PRE>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>s + m.str()</CODE>.</P>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<PRE><A name=o84></A>template <class BidirectionalIterator> std::basic_string<typename iterator_traits<BidirectionalIterator>::value_type>
|
|
|
|
|
operator + (const sub_match<BidirectionalIterator>& m,
|
|
|
|
|
typename iterator_traits<BidirectionalIterator>::value_type const * s);</PRE>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>m.str() + s</CODE>.</P>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<PRE><A name=o85></A>template <class BidirectionalIterator>
|
|
|
|
|
std::basic_string<typename iterator_traits<BidirectionalIterator>::value_type>
|
|
|
|
|
operator + (typename iterator_traits<BidirectionalIterator>::value_type const& s,
|
|
|
|
|
const sub_match<BidirectionalIterator>& m); </PRE>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>s + m.str()</CODE>.</P>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<PRE><A name=o86></A>template <class BidirectionalIterator>
|
|
|
|
|
std::basic_string<typename iterator_traits<BidirectionalIterator>::value_type>
|
|
|
|
|
operator + (const sub_match<BidirectionalIterator>& m,
|
|
|
|
|
typename iterator_traits<BidirectionalIterator>::value_type const& s); </PRE>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>m.str() + s</CODE>.</P>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<PRE><A name=o87></A>template <class BidirectionalIterator>
|
|
|
|
|
std::basic_string<typename iterator_traits<BidirectionalIterator>::value_type>
|
|
|
|
|
operator + (const sub_match<BidirectionalIterator>& m1,
|
|
|
|
|
const sub_match<BidirectionalIterator>& m2);</PRE>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<P><B>Effects: </B>returns <CODE>m1.str() + m2.str()</CODE>.</P>
|
|
|
|
|
<h5>Stream inserter</h5>
|
|
|
|
|
<PRE><A name=oi></A>template <class charT, class traits, class BidirectionalIterator>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
basic_ostream<charT, traits>&
|
|
|
|
|
operator << (basic_ostream<charT, traits>& os
|
|
|
|
|
const sub_match<BidirectionalIterator>& m);</PRE>
|
2003-10-21 11:18:40 +00:00
|
|
|
|
<P>
|
|
|
|
|
<B>Effects: </B>returns <CODE>(os << m.str())</CODE>.
|
2003-05-17 11:55:51 +00:00
|
|
|
|
<HR>
|
|
|
|
|
<p>Revised
|
|
|
|
|
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->
|
2003-10-24 10:51:38 +00:00
|
|
|
|
24 Oct 2003
|
|
|
|
|
<!--webbot bot="Timestamp" endspan i-checksum="39359" --></p>
|
|
|
|
|
<p><i><EFBFBD> Copyright John Maddock 1998-
|
2003-12-13 12:28:48 +00:00
|
|
|
|
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%Y" startspan --> 2003<!--webbot bot="Timestamp" endspan i-checksum="39359" --></i></p>
|
2003-10-24 10:51:38 +00:00
|
|
|
|
<P><I>Use, modification and distribution are subject to the Boost Software License,
|
|
|
|
|
Version 1.0. (See accompanying file <A href="../../../LICENSE_1_0.txt">LICENSE_1_0.txt</A>
|
|
|
|
|
or copy at <A href="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</A>)</I></P>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
</body>
|
|
|
|
|
</html>
|
2003-12-13 12:28:48 +00:00
|
|
|
|
|