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">
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="../../../boost.css">
|
|
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
<P>
|
|
|
|
|
<TABLE id="Table1" cellSpacing="1" cellPadding="1" width="100%" border="0">
|
|
|
|
|
<TR>
|
|
|
|
|
<td valign="top" width="300">
|
|
|
|
|
<h3><a href="../../../index.htm"><img height="86" width="277" alt="C++ Boost" src="../../../c++boost.gif" border="0"></a></h3>
|
|
|
|
|
</td>
|
|
|
|
|
<TD width="353">
|
|
|
|
|
<H1 align="center">Boost.Regex</H1>
|
|
|
|
|
<H2 align="center">sub_match</H2>
|
|
|
|
|
</TD>
|
|
|
|
|
<td width="50">
|
|
|
|
|
<h3><a href="index.html"><img height="45" width="43" alt="Boost.Regex Index" src="uarrow.gif" border="0"></a></h3>
|
|
|
|
|
</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-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>
|
|
|
|
|
<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>
|
|
|
|
|
<PRE>
|
|
|
|
|
namespace boost{
|
|
|
|
|
|
|
|
|
|
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-10-21 11:18:40 +00:00
|
|
|
|
bool <A href="#m1">matched</A>;
|
2003-05-17 11:55:51 +00:00
|
|
|
|
|
2003-10-21 11:18:40 +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-10-21 11:18:40 +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;
|
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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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-10-21 11:18:40 +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:
|
|
|
|
|
//
|
|
|
|
|
template <class RandomAccessIterator, class traits, class Allocator>
|
|
|
|
|
std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>
|
|
|
|
|
<A href="#o81">operator</A> + (const std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
|
|
|
|
|
const sub_match<RandomAccessIterator>& m);
|
|
|
|
|
template <class RandomAccessIterator, class traits, class Allocator>
|
|
|
|
|
std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>
|
|
|
|
|
<A href="#o82">operator</A> + (const sub_match<RandomAccessIterator>& m,
|
|
|
|
|
const std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s);
|
|
|
|
|
template <class RandomAccessIterator> std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type>
|
|
|
|
|
<A href="#o83">operator</A> + (typename iterator_traits<RandomAccessIterator>::value_type const* s,
|
|
|
|
|
const sub_match<RandomAccessIterator>& m);
|
|
|
|
|
template <class RandomAccessIterator> std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type>
|
|
|
|
|
<A href="#o84">operator</A> + (const sub_match<RandomAccessIterator>& m,
|
|
|
|
|
typename iterator_traits<RandomAccessIterator>::value_type const * s);
|
|
|
|
|
template <class RandomAccessIterator>
|
|
|
|
|
std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type>
|
|
|
|
|
<A href="#o85">operator</A> + (typename iterator_traits<RandomAccessIterator>::value_type const& s,
|
|
|
|
|
const sub_match<RandomAccessIterator>& m);
|
|
|
|
|
template <class RandomAccessIterator>
|
|
|
|
|
std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type>
|
|
|
|
|
<A href="#o86">operator</A> + (const sub_match<RandomAccessIterator>& m,
|
|
|
|
|
typename iterator_traits<RandomAccessIterator>::value_type const& s);
|
|
|
|
|
template <class RandomAccessIterator>
|
|
|
|
|
std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type>
|
|
|
|
|
<A href="#o87">operator</A> + (const sub_match<RandomAccessIterator>& m1,
|
|
|
|
|
const sub_match<RandomAccessIterator>& 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-10-21 11:18:40 +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>
|
|
|
|
|
<H4>
|
|
|
|
|
sub_match members</H4>
|
|
|
|
|
<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>
|
|
|
|
|
<P>
|
|
|
|
|
<B>Effects: </B>returns the length of this matched sub-expression, or 0 if this
|
|
|
|
|
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>
|
|
|
|
|
<P>
|
|
|
|
|
<B>Effects: </B>converts *this into a string: returns <CODE>(matched ?
|
|
|
|
|
basic_string<value_type>(first, second) :
|
|
|
|
|
basic_string<value_type>()).</P>
|
|
|
|
|
</CODE><PRE><A name=m4></A>basic_string<value_type> str()const;</PRE>
|
|
|
|
|
<P><B> Effects: </B>returns a string representation of *this: <CODE>(matched ?
|
|
|
|
|
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>
|
|
|
|
|
<P>
|
|
|
|
|
<B>Effects: </B>performs a lexical comparison to <EM>s</EM>: returns <CODE>str().compare(s.str())</CODE>.</P>
|
|
|
|
|
<PRE><A name=m6></A>int compare(const basic_string<value_type>& s)const;</PRE>
|
|
|
|
|
<P><B> Effects: </B>compares *this to the string s: returns <CODE>str().compare(s)</CODE>.</P>
|
|
|
|
|
<PRE><A name=m7></A>int compare(const value_type* s)const;</PRE>
|
|
|
|
|
<P>
|
|
|
|
|
<B>Effects:<B></B> </B>compares *this to the null-terminated string <EM>s</EM>:<B> </B>returns
|
|
|
|
|
<CODE>str().compare(s)</CODE>.</P>
|
2003-05-17 11:55:51 +00:00
|
|
|
|
<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-10-21 11:18:40 +00:00
|
|
|
|
<P>
|
|
|
|
|
<B>Effects: </B>returns <CODE>lhs.compare(rhs) == 0</CODE>.</P>
|
|
|
|
|
<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-10-21 11:18:40 +00:00
|
|
|
|
<P>
|
|
|
|
|
<B>Effects: </B>returns <CODE>lhs.compare(rhs) != 0</CODE>.</P>
|
|
|
|
|
<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-10-21 11:18:40 +00:00
|
|
|
|
<P>
|
|
|
|
|
<B>Effects: </B>returns <CODE>lhs.compare(rhs) < 0</CODE>.</P>
|
|
|
|
|
<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-10-21 11:18:40 +00:00
|
|
|
|
<P><B> Effects: </B>returns <CODE>lhs.compare(rhs) <= 0</CODE>.</P>
|
|
|
|
|
<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-10-21 11:18:40 +00:00
|
|
|
|
<P>
|
|
|
|
|
<B>Effects: </B>returns <CODE>lhs.compare(rhs) >= 0</CODE>.</P>
|
|
|
|
|
<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-10-21 11:18:40 +00:00
|
|
|
|
<P>
|
|
|
|
|
<B>Effects: </B>returns <CODE>lhs.compare(rhs) > 0</CODE>.</P>
|
|
|
|
|
<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-10-21 11:18:40 +00:00
|
|
|
|
<P>
|
|
|
|
|
<B>Effects: </B>returns <CODE>lhs == rhs.str()</CODE>.</P>
|
|
|
|
|
<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-10-21 11:18:40 +00:00
|
|
|
|
<P>
|
|
|
|
|
<B>Effects: </B>returns <CODE>lhs != rhs.str()</CODE>.</P>
|
|
|
|
|
<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-10-21 11:18:40 +00:00
|
|
|
|
<P>
|
|
|
|
|
<B>Effects: </B>returns <CODE>lhs < rhs.str()</CODE>.</P>
|
|
|
|
|
<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-10-21 11:18:40 +00:00
|
|
|
|
<P>
|
|
|
|
|
<B>Effects: </B>returns <CODE>lhs > rhs.str()</CODE>.</P>
|
|
|
|
|
<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-10-21 11:18:40 +00:00
|
|
|
|
<P>
|
|
|
|
|
<B>Effects: </B>returns <CODE>lhs >= rhs.str()</CODE>.</P>
|
|
|
|
|
<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-10-21 11:18:40 +00:00
|
|
|
|
<P>
|
|
|
|
|
<B>Effects: </B>returns <CODE>lhs <= rhs.str()</CODE>.</P>
|
|
|
|
|
<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-10-21 11:18:40 +00:00
|
|
|
|
<P>
|
|
|
|
|
<B>Effects: </B>returns <CODE>lhs.str() == rhs</CODE>.</P>
|
|
|
|
|
<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-10-21 11:18:40 +00:00
|
|
|
|
<P>
|
|
|
|
|
<B>Effects: </B>returns <CODE>lhs.str() != rhs</CODE>.</P>
|
|
|
|
|
<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-10-21 11:18:40 +00:00
|
|
|
|
<P>
|
|
|
|
|
<B>Effects: </B>returns <CODE>lhs.str() < rhs</CODE>.</P>
|
|
|
|
|
<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-10-21 11:18:40 +00:00
|
|
|
|
<P>
|
|
|
|
|
<B>Effects: </B>returns <CODE>lhs.str() > rhs</CODE>.</P>
|
|
|
|
|
<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-10-21 11:18:40 +00:00
|
|
|
|
<P>
|
|
|
|
|
<B>Effects: </B>returns <CODE>lhs.str() >= rhs</CODE>.</P>
|
|
|
|
|
<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-10-21 11:18:40 +00:00
|
|
|
|
<P>
|
|
|
|
|
<B>Effects: </B>returns <CODE>lhs.str() <= rhs</CODE>.</P>
|
|
|
|
|
<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-10-21 11:18:40 +00:00
|
|
|
|
<P>
|
|
|
|
|
<B>Effects: </B>returns <CODE>lhs == rhs.str()</CODE>.</P>
|
|
|
|
|
<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-10-21 11:18:40 +00:00
|
|
|
|
<P>
|
|
|
|
|
<B>Effects: </B>returns <CODE>lhs != rhs.str()</CODE>.</P>
|
|
|
|
|
<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-10-21 11:18:40 +00:00
|
|
|
|
<P>
|
|
|
|
|
<B>Effects: </B>returns <CODE>lhs < rhs.str()</CODE>.</P>
|
|
|
|
|
<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-10-21 11:18:40 +00:00
|
|
|
|
<P>
|
|
|
|
|
<B>Effects: </B>returns <CODE>lhs > rhs.str()</CODE>.</P>
|
|
|
|
|
<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-10-21 11:18:40 +00:00
|
|
|
|
<P>
|
|
|
|
|
<B>Effects: </B>returns <CODE>lhs >= rhs.str()</CODE>.</P>
|
|
|
|
|
<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-10-21 11:18:40 +00:00
|
|
|
|
<P>
|
|
|
|
|
<B>Effects: </B>returns <CODE>lhs <= rhs.str()</CODE>.</P>
|
|
|
|
|
<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-10-21 11:18:40 +00:00
|
|
|
|
<P>
|
|
|
|
|
<B>Effects: </B>returns <CODE>lhs.str() == rhs</CODE>.</P>
|
|
|
|
|
<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-10-21 11:18:40 +00:00
|
|
|
|
<P>
|
|
|
|
|
<B>Effects: </B>returns <CODE>lhs.str() != rhs</CODE>.</P>
|
|
|
|
|
<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-10-21 11:18:40 +00:00
|
|
|
|
<P>
|
|
|
|
|
<B>Effects: </B>returns <CODE>lhs.str() < rhs</CODE>.</P>
|
|
|
|
|
<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-10-21 11:18:40 +00:00
|
|
|
|
<P>
|
|
|
|
|
<B>Effects: </B>returns <CODE>lhs.str() > rhs</CODE>.</P>
|
|
|
|
|
<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-10-21 11:18:40 +00:00
|
|
|
|
<P>
|
|
|
|
|
<B>Effects: </B>returns <CODE>lhs.str() >= rhs</CODE>.</P>
|
|
|
|
|
<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-10-21 11:18:40 +00:00
|
|
|
|
<P>
|
|
|
|
|
<B>Effects: </B>returns <CODE>lhs.str() <= rhs</CODE>.</P>
|
|
|
|
|
<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>
|
|
|
|
|
<PRE><A name=o81></A>template <class RandomAccessIterator, class traits, class Allocator>
|
|
|
|
|
std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>
|
|
|
|
|
operator + (const std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
|
|
|
|
|
const sub_match<RandomAccessIterator>& m); </PRE>
|
|
|
|
|
<P><B>Effects: </B>returns <CODE>s + m.str()</CODE>.</P>
|
|
|
|
|
<PRE><A name=o82></A>template <class RandomAccessIterator, class traits, class Allocator>
|
|
|
|
|
std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>
|
|
|
|
|
operator + (const sub_match<RandomAccessIterator>& m,
|
|
|
|
|
const std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s); </PRE>
|
|
|
|
|
<P><B>Effects: </B>returns <CODE>m.str() + s</CODE>.</P>
|
|
|
|
|
<PRE><A name=o83></A>template <class RandomAccessIterator> std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type>
|
|
|
|
|
operator + (typename iterator_traits<RandomAccessIterator>::value_type const* s,
|
|
|
|
|
const sub_match<RandomAccessIterator>& m); </PRE>
|
|
|
|
|
<P><B>Effects: </B>returns <CODE>s + m.str()</CODE>.</P>
|
|
|
|
|
<PRE><A name=o84></A>template <class RandomAccessIterator> std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type>
|
|
|
|
|
operator + (const sub_match<RandomAccessIterator>& m,
|
|
|
|
|
typename iterator_traits<RandomAccessIterator>::value_type const * s);</PRE>
|
|
|
|
|
<P><B>Effects: </B>returns <CODE>m.str() + s</CODE>.</P>
|
|
|
|
|
<PRE><A name=o85></A>template <class RandomAccessIterator>
|
|
|
|
|
std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type>
|
|
|
|
|
operator + (typename iterator_traits<RandomAccessIterator>::value_type const& s,
|
|
|
|
|
const sub_match<RandomAccessIterator>& m); </PRE>
|
|
|
|
|
<P><B>Effects: </B>returns <CODE>s + m.str()</CODE>.</P>
|
|
|
|
|
<PRE><A name=o86></A>template <class RandomAccessIterator>
|
|
|
|
|
std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type>
|
|
|
|
|
operator + (const sub_match<RandomAccessIterator>& m,
|
|
|
|
|
typename iterator_traits<RandomAccessIterator>::value_type const& s); </PRE>
|
|
|
|
|
<P><B>Effects: </B>returns <CODE>m.str() + s</CODE>.</P>
|
|
|
|
|
<PRE><A name=o87></A>template <class RandomAccessIterator>
|
|
|
|
|
std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type>
|
|
|
|
|
operator + (const sub_match<RandomAccessIterator>& m1,
|
|
|
|
|
const sub_match<RandomAccessIterator>& m2);</PRE>
|
|
|
|
|
<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 -->
|
|
|
|
|
17 May 2003
|
|
|
|
|
<!--webbot bot="Timestamp" endspan i-checksum="39359" -->
|
|
|
|
|
</p>
|
|
|
|
|
<P><I><EFBFBD> Copyright <a href="mailto:jm@regex.fsnet.co.uk">John Maddock</a> 1998-<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%Y" startspan --> 2003<!--webbot bot="Timestamp" endspan i-checksum="39359" --></I></P>
|
|
|
|
|
<P align="left"><I>Permission to use, copy, modify, distribute and sell this software
|
|
|
|
|
and its documentation for any purpose is hereby granted without fee, provided
|
|
|
|
|
that the above copyright notice appear in all copies and that both that
|
|
|
|
|
copyright notice and this permission notice appear in supporting documentation.
|
|
|
|
|
Dr John Maddock makes no representations about the suitability of this software
|
|
|
|
|
for any purpose. It is provided "as is" without express or implied warranty.</I></P>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|