libstdc++
std::match_results< _Bi_iter, _Allocator > Class Template Reference
Inheritance diagram for std::match_results< _Bi_iter, _Allocator >:

Public Member Functions

bool ready () const
 

Private Types

typedef
_Tp_alloc_type::const_pointer 
const_pointer
 
typedef std::reverse_iterator
< const_iterator > 
const_reverse_iterator
 
typedef _Tp_alloc_type::pointer pointer
 
typedef std::reverse_iterator
< iterator > 
reverse_iterator
 

Private Member Functions

_Tp_alloc_type::pointer _M_allocate (size_t __n)
 
pointer _M_allocate_and_copy (size_type __n, _ForwardIterator __first, _ForwardIterator __last)
 
void _M_assign_aux (_InputIterator __first, _InputIterator __last, std::input_iterator_tag)
 
void _M_assign_aux (_ForwardIterator __first, _ForwardIterator __last, std::forward_iterator_tag)
 
void _M_assign_dispatch (_Integer __n, _Integer __val, __true_type)
 
void _M_assign_dispatch (_InputIterator __first, _InputIterator __last, __false_type)
 
size_type _M_check_len (size_type __n, const char *__s) const
 
void _M_deallocate (typename _Tp_alloc_type::pointer __p, size_t __n)
 
void _M_default_append (size_type __n)
 
void _M_default_initialize (size_type __n)
 
void _M_erase_at_end (pointer __pos)
 
void _M_fill_assign (size_type __n, const value_type &__val)
 
void _M_fill_initialize (size_type __n, const value_type &__value)
 
void _M_fill_insert (iterator __pos, size_type __n, const value_type &__x)
 
_Tp_alloc_type & _M_get_Tp_allocator ()
 
const _Tp_alloc_type & _M_get_Tp_allocator () const
 
void _M_initialize_dispatch (_Integer __n, _Integer __value, __true_type)
 
void _M_initialize_dispatch (_InputIterator __first, _InputIterator __last, __false_type)
 
void _M_insert_aux (iterator __position, _Args &&...__args)
 
void _M_insert_dispatch (iterator __pos, _Integer __n, _Integer __val, __true_type)
 
void _M_insert_dispatch (iterator __pos, _InputIterator __first, _InputIterator __last, __false_type)
 
void _M_range_check (size_type __n) const
 
void _M_range_initialize (_InputIterator __first, _InputIterator __last, std::input_iterator_tag)
 
void _M_range_initialize (_ForwardIterator __first, _ForwardIterator __last, std::forward_iterator_tag)
 
void _M_range_insert (iterator __pos, _InputIterator __first, _InputIterator __last, std::input_iterator_tag)
 
void _M_range_insert (iterator __pos, _ForwardIterator __first, _ForwardIterator __last, std::forward_iterator_tag)
 
void assign (size_type __n, const value_type &__val)
 
void assign (_InputIterator __first, _InputIterator __last)
 
void assign (initializer_list< value_type > __l)
 
reference at (size_type __n)
 
const_reference at (size_type __n) const
 
reference back ()
 
const_reference back () const
 
iterator begin ()
 
size_type capacity () const
 
void clear ()
 
const_reverse_iterator crbegin () const
 
const_reverse_iterator crend () const
 
sub_match< _Bi_iter > * data ()
 
const sub_match< _Bi_iter > * data () const
 
iterator emplace (iterator __position, _Args &&...__args)
 
void emplace_back (_Args &&...__args)
 
iterator end ()
 
iterator erase (iterator __position)
 
iterator erase (iterator __first, iterator __last)
 
reference front ()
 
const_reference front () const
 
iterator insert (iterator __position, const value_type &__x)
 
iterator insert (iterator __position, value_type &&__x)
 
void insert (iterator __position, initializer_list< value_type > __l)
 
void insert (iterator __position, size_type __n, const value_type &__x)
 
void insert (iterator __position, _InputIterator __first, _InputIterator __last)
 
reference operator[] (size_type __n)
 
const_reference operator[] (size_type __n) const
 
void pop_back ()
 
void push_back (const value_type &__x)
 
void push_back (value_type &&__x)
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
void reserve (size_type __n)
 
void resize (size_type __new_size)
 
void resize (size_type __new_size, const value_type &__x)
 
void shrink_to_fit ()
 
void swap (vector &__x)
 

Private Attributes

_Vector_impl _M_impl
 

Friends

class __regex::_SpecializedResults< _Bi_iter, _Allocator >
 

10.? Public Types

typedef sub_match< _Bi_iter > value_type
 
typedef const value_typeconst_reference
 
typedef const_reference reference
 
typedef _Base_type::const_iterator const_iterator
 
typedef const_iterator iterator
 
typedef std::iterator_traits
< _Bi_iter >::difference_type 
difference_type
 
typedef _Allocator::size_type size_type
 
typedef _Allocator allocator_type
 
typedef std::iterator_traits
< _Bi_iter >::value_type 
char_type
 
typedef std::basic_string
< char_type > 
string_type
 

28.10.1 Construction, Copying, and Destruction

 match_results (const _Allocator &__a=_Allocator())
 
 match_results (const match_results &__rhs)
 
 match_results (match_results &&__rhs) noexcept
 
match_resultsoperator= (const match_results &__rhs)
 
match_resultsoperator= (match_results &&__rhs)
 
 ~match_results ()
 

28.10.2 Size

size_type size () const
 
size_type max_size () const
 
bool empty () const
 

10.3 Element Access

difference_type length (size_type __sub=0) const
 
difference_type position (size_type __sub=0) const
 
string_type str (size_type __sub=0) const
 
const_reference operator[] (size_type __sub) const
 
const_reference prefix () const
 
const_reference suffix () const
 
const_iterator begin () const
 
const_iterator cbegin () const
 
const_iterator end () const
 
const_iterator cend () const
 

10.4 Formatting

These functions perform formatted substitution of the matched character sequences into their target. The format specifiers and escape sequences accepted by these functions are determined by their flags parameter as documented above.

template<typename _Out_iter >
_Out_iter format (_Out_iter __out, const char_type *__fmt_first, const char_type *__fmt_last, regex_constants::match_flag_type __flags=regex_constants::format_default) const
 
template<typename _Out_iter , typename _St , typename _Sa >
_Out_iter format (_Out_iter __out, const basic_string< char_type, _St, _Sa > &__fmt, regex_constants::match_flag_type __flags=regex_constants::format_default) const
 
template<typename _Out_iter , typename _St , typename _Sa >
basic_string< char_type, _St, _Sa > format (const basic_string< char_type, _St, _Sa > &__fmt, regex_constants::match_flag_type __flags=regex_constants::format_default) const
 
string_type format (const char_type *__fmt, regex_constants::match_flag_type __flags=regex_constants::format_default) const
 

10.5 Allocator

allocator_type get_allocator () const
 

10.6 Swap

void swap (match_results &__that)
 

Detailed Description

template<typename _Bi_iter, typename _Allocator = allocator<sub_match<_Bi_iter> >>
class std::match_results< _Bi_iter, _Allocator >

The results of a match or search operation.

A collection of character sequences representing the result of a regular expression match. Storage for the collection is allocated and freed as necessary by the member functions of class template match_results.

This class satisfies the Sequence requirements, with the exception that only the operations defined for a const-qualified Sequence are supported.

The sub_match object stored at index 0 represents sub-expression 0, i.e. the whole match. In this case the sub_match member matched is always true. The sub_match object stored at index n denotes what matched the marked sub-expression n within the matched expression. If the sub-expression n participated in a regular expression match then the sub_match 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 point to the end of the sequence that was searched.

Definition at line 1461 of file regex.h.

Constructor & Destructor Documentation

template<typename _Bi_iter, typename _Allocator = allocator<sub_match<_Bi_iter> >>
std::match_results< _Bi_iter, _Allocator >::match_results ( const _Allocator &  __a = _Allocator())
inlineexplicit

Constructs a default match_results container.

Postcondition
size() returns 0 and str() returns an empty string.

Definition at line 1509 of file regex.h.

Referenced by std::match_results< _FwdIterT, _Alloc >::operator=().

template<typename _Bi_iter, typename _Allocator = allocator<sub_match<_Bi_iter> >>
std::match_results< _Bi_iter, _Allocator >::match_results ( const match_results< _Bi_iter, _Allocator > &  __rhs)
inline

Copy constructs a match_results.

Definition at line 1516 of file regex.h.

template<typename _Bi_iter, typename _Allocator = allocator<sub_match<_Bi_iter> >>
std::match_results< _Bi_iter, _Allocator >::match_results ( match_results< _Bi_iter, _Allocator > &&  __rhs)
inlinenoexcept

Move constructs a match_results.

Definition at line 1523 of file regex.h.

template<typename _Bi_iter, typename _Allocator = allocator<sub_match<_Bi_iter> >>
std::match_results< _Bi_iter, _Allocator >::~match_results ( )
inline

Destroys a match_results object.

Definition at line 1550 of file regex.h.

Member Function Documentation

template<typename _Bi_iter, typename _Allocator = allocator<sub_match<_Bi_iter> >>
const_iterator std::match_results< _Bi_iter, _Allocator >::begin ( ) const
inline

Gets an iterator to the start of the sub_match collection.

Definition at line 1706 of file regex.h.

Referenced by std::operator==().

template<typename _Bi_iter, typename _Allocator = allocator<sub_match<_Bi_iter> >>
const_iterator std::match_results< _Bi_iter, _Allocator >::cbegin ( ) const
inline

Gets an iterator to the start of the sub_match collection.

Definition at line 1713 of file regex.h.

template<typename _Bi_iter, typename _Allocator = allocator<sub_match<_Bi_iter> >>
const_iterator std::match_results< _Bi_iter, _Allocator >::cend ( ) const
inline

Gets an iterator to one-past-the-end of the collection.

Definition at line 1727 of file regex.h.

template<typename _Bi_iter, typename _Allocator = allocator<sub_match<_Bi_iter> >>
bool std::match_results< _Bi_iter, _Allocator >::empty ( ) const
inline

Indicates if the match_results contains no results.

Return values
trueThe match_results object is empty.
falseThe match_results object is not empty.

Definition at line 1594 of file regex.h.

Referenced by std::match_results< _FwdIterT, _Alloc >::end(), std::operator==(), std::match_results< _FwdIterT, _Alloc >::prefix(), and std::match_results< _FwdIterT, _Alloc >::suffix().

template<typename _Bi_iter, typename _Allocator = allocator<sub_match<_Bi_iter> >>
const_iterator std::match_results< _Bi_iter, _Allocator >::end ( ) const
inline

Gets an iterator to one-past-the-end of the collection.

Definition at line 1720 of file regex.h.

Referenced by std::match_results< _FwdIterT, _Alloc >::cend(), and std::operator==().

template<typename _Bi_iter, typename _Allocator = allocator<sub_match<_Bi_iter> >>
template<typename _Out_iter >
_Out_iter std::match_results< _Bi_iter, _Allocator >::format ( _Out_iter  __out,
const char_type *  __fmt_first,
const char_type *  __fmt_last,
regex_constants::match_flag_type  __flags = regex_constants::format_default 
) const
inline
Precondition
ready() == true
Todo:
Implement this function.

Definition at line 1748 of file regex.h.

Referenced by std::match_results< _FwdIterT, _Alloc >::format().

template<typename _Bi_iter, typename _Allocator = allocator<sub_match<_Bi_iter> >>
template<typename _Out_iter , typename _St , typename _Sa >
_Out_iter std::match_results< _Bi_iter, _Allocator >::format ( _Out_iter  __out,
const basic_string< char_type, _St, _Sa > &  __fmt,
regex_constants::match_flag_type  __flags = regex_constants::format_default 
) const
inline
Precondition
ready() == true

Definition at line 1759 of file regex.h.

template<typename _Bi_iter, typename _Allocator = allocator<sub_match<_Bi_iter> >>
template<typename _Out_iter , typename _St , typename _Sa >
basic_string<char_type, _St, _Sa> std::match_results< _Bi_iter, _Allocator >::format ( const basic_string< char_type, _St, _Sa > &  __fmt,
regex_constants::match_flag_type  __flags = regex_constants::format_default 
) const
inline
Precondition
ready() == true

Definition at line 1772 of file regex.h.

template<typename _Bi_iter, typename _Allocator = allocator<sub_match<_Bi_iter> >>
string_type std::match_results< _Bi_iter, _Allocator >::format ( const char_type *  __fmt,
regex_constants::match_flag_type  __flags = regex_constants::format_default 
) const
inline
Precondition
ready() == true

Definition at line 1785 of file regex.h.

template<typename _Bi_iter, typename _Allocator = allocator<sub_match<_Bi_iter> >>
allocator_type std::match_results< _Bi_iter, _Allocator >::get_allocator ( ) const
inline

Gets a copy of the allocator.

Definition at line 1807 of file regex.h.

template<typename _Bi_iter, typename _Allocator = allocator<sub_match<_Bi_iter> >>
difference_type std::match_results< _Bi_iter, _Allocator >::length ( size_type  __sub = 0) const
inline

Gets the length of the indicated submatch.

Parameters
subindicates the submatch.
Precondition
ready() == true

This function returns the length of the indicated submatch, or the length of the entire match if sub is zero (the default).

Definition at line 1613 of file regex.h.

template<typename _Bi_iter, typename _Allocator = allocator<sub_match<_Bi_iter> >>
size_type std::match_results< _Bi_iter, _Allocator >::max_size ( ) const
inline

Gets the number of matches and submatches.

The number of matches for a given regular expression will be either 0 if there was no match or mark_count() + 1 if a match was successful. Some matches may be empty.

Returns
the number of matches found.

Definition at line 1585 of file regex.h.

template<typename _Bi_iter, typename _Allocator = allocator<sub_match<_Bi_iter> >>
match_results& std::match_results< _Bi_iter, _Allocator >::operator= ( const match_results< _Bi_iter, _Allocator > &  __rhs)
inline

Assigns rhs to *this.

Definition at line 1531 of file regex.h.

template<typename _Bi_iter, typename _Allocator = allocator<sub_match<_Bi_iter> >>
match_results& std::match_results< _Bi_iter, _Allocator >::operator= ( match_results< _Bi_iter, _Allocator > &&  __rhs)
inline

Move-assigns rhs to *this.

Definition at line 1541 of file regex.h.

template<typename _Bi_iter, typename _Allocator = allocator<sub_match<_Bi_iter> >>
const_reference std::match_results< _Bi_iter, _Allocator >::operator[] ( size_type  __sub) const
inline

Gets a sub_match reference for the match or submatch.

Parameters
subindicates the submatch.
Precondition
ready() == true

This function gets a reference to the indicated submatch, or the entire match if sub is zero.

If sub >= size() then this function returns a sub_match with a special value indicating no submatch.

Definition at line 1660 of file regex.h.

template<typename _Bi_iter, typename _Allocator = allocator<sub_match<_Bi_iter> >>
difference_type std::match_results< _Bi_iter, _Allocator >::position ( size_type  __sub = 0) const
inline

Gets the offset of the beginning of the indicated submatch.

Parameters
subindicates the submatch.
Precondition
ready() == true

This function returns the offset from the beginning of the target sequence to the beginning of the submatch, unless the value of sub is zero (the default), in which case this function returns the offset from the beginning of the target sequence to the beginning of the match.

Returns -1 if sub is out of range.

Definition at line 1630 of file regex.h.

template<typename _Bi_iter, typename _Allocator = allocator<sub_match<_Bi_iter> >>
const_reference std::match_results< _Bi_iter, _Allocator >::prefix ( ) const
inline

Gets a sub_match representing the match prefix.

Precondition
ready() == true

This function gets a reference to a sub_match object representing the part of the target range between the start of the target range and the start of the match.

Definition at line 1677 of file regex.h.

Referenced by std::operator==(), and std::match_results< _FwdIterT, _Alloc >::position().

template<typename _Bi_iter, typename _Allocator = allocator<sub_match<_Bi_iter> >>
bool std::match_results< _Bi_iter, _Allocator >::ready ( ) const
inline

Indicates if the match_results is ready.

Return values
trueThe object has a fully-established result state.
falseThe object is not ready.

Definition at line 1561 of file regex.h.

Referenced by std::operator==(), std::match_results< _FwdIterT, _Alloc >::operator[](), std::match_results< _FwdIterT, _Alloc >::prefix(), and std::match_results< _FwdIterT, _Alloc >::suffix().

template<typename _Bi_iter, typename _Allocator = allocator<sub_match<_Bi_iter> >>
size_type std::match_results< _Bi_iter, _Allocator >::size ( ) const
inline

Gets the number of matches and submatches.

The number of matches for a given regular expression will be either 0 if there was no match or mark_count() + 1 if a match was successful. Some matches may be empty.

Returns
the number of matches found.

Definition at line 1578 of file regex.h.

Referenced by std::match_results< _FwdIterT, _Alloc >::empty(), std::operator==(), std::match_results< _FwdIterT, _Alloc >::operator[](), and std::match_results< _FwdIterT, _Alloc >::position().

template<typename _Bi_iter, typename _Allocator = allocator<sub_match<_Bi_iter> >>
string_type std::match_results< _Bi_iter, _Allocator >::str ( size_type  __sub = 0) const
inline

Gets the match or submatch converted to a string type.

Parameters
subindicates the submatch.
Precondition
ready() == true

This function gets the submatch (or match, if sub is zero) extracted from the target range and converted to the associated string type.

Definition at line 1645 of file regex.h.

template<typename _Bi_iter, typename _Allocator = allocator<sub_match<_Bi_iter> >>
const_reference std::match_results< _Bi_iter, _Allocator >::suffix ( ) const
inline

Gets a sub_match representing the match suffix.

Precondition
ready() == true

This function gets a reference to a sub_match object representing the part of the target range between the end of the match and the end of the target range.

Definition at line 1694 of file regex.h.

Referenced by std::operator==().

template<typename _Bi_iter, typename _Allocator = allocator<sub_match<_Bi_iter> >>
void std::match_results< _Bi_iter, _Allocator >::swap ( match_results< _Bi_iter, _Allocator > &  __that)
inline

Swaps the contents of two match_results.

Definition at line 1821 of file regex.h.

Referenced by std::swap().


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