STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Public Attributes | Private Attributes | List of all members
match_results< _BidIt, _Alloc > Class Template Reference

Public Types

typedef match_results< _BidIt, _Alloc > _Myt
 
typedef sub_match< _BidIt > _Elem
 
typedef vector< _Elem, _Alloc > _MyCont
 
typedef allocator_traits< _Alloc > _Mytraits
 
typedef _Elem value_type
 
typedef const value_typeconst_reference
 
typedef value_typereference
 
typedef _MyCont::const_iterator const_iterator
 
typedef const_iterator iterator
 
typedef iterator_traits< _BidIt >::difference_type difference_type
 
typedef _Mytraits::size_type size_type
 
typedef _Alloc allocator_type
 
typedef iterator_traits< _BidIt >::value_type char_type
 
typedef basic_string< char_typestring_type
 

Public Member Functions

 match_results ()
 
 match_results (const _Alloc &_Al)
 
 match_results (const _Myt &_Right)
 
_Mytoperator= (const _Myt &_Right)
 
 match_results (_Myt &&_Right)
 
_Mytoperator= (_Myt &&_Right) _NOEXCEPT
 
bool ready () const
 
size_type size () const
 
size_type max_size () const
 
bool empty () const
 
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 end () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
template<class _OutIt >
_OutIt _Format1 (_OutIt _Out, const char_type *_Fmt_begin, const char_type *_Fmt_end, regex_constants::match_flag_type _Flags) const
 
template<class _OutIt >
_OutIt format (_OutIt _Out, const char_type *_Fmt_begin, const char_type *_Fmt_end, regex_constants::match_flag_type _Flags=regex_constants::format_default) const
 
template<class _OutIt , class _Traits1 , class _Alloc1 >
_OutIt format (_OutIt _Out, const basic_string< char_type, _Traits1, _Alloc1 > &_Fmt, regex_constants::match_flag_type _Flags=regex_constants::format_default) const
 
template<class _Traits1 , class _Alloc1 >
basic_string< char_type, _Traits1, _Alloc1 > format (const basic_string< char_type, _Traits1, _Alloc1 > &_Fmt, regex_constants::match_flag_type _Flags=regex_constants::format_default) const
 
string_type format (const char_type *_Fmt_begin, regex_constants::match_flag_type _Flags=regex_constants::format_default) const
 
allocator_type get_allocator () const
 
void swap (match_results &_Right)
 
void _Resize (unsigned int _Nx)
 
_Elem_Pfx ()
 
_Elem_Sfx ()
 
_Elem_Null ()
 
_Elem_At (unsigned int _Sub)
 
_Elem _At (unsigned int _Sub) const
 

Public Attributes

_BidIt _Org
 
bool _Ready
 

Private Attributes

_MyCont _Matches
 
_Elem _Prefix
 
_Elem _Suffix
 
_Elem _Null_elem
 

Member Typedef Documentation

template<class _BidIt, class _Alloc>
typedef sub_match<_BidIt> match_results< _BidIt, _Alloc >::_Elem
template<class _BidIt, class _Alloc>
typedef vector<_Elem, _Alloc> match_results< _BidIt, _Alloc >::_MyCont
template<class _BidIt, class _Alloc>
typedef match_results<_BidIt, _Alloc> match_results< _BidIt, _Alloc >::_Myt
template<class _BidIt, class _Alloc>
typedef allocator_traits<_Alloc> match_results< _BidIt, _Alloc >::_Mytraits
template<class _BidIt, class _Alloc>
typedef _Alloc match_results< _BidIt, _Alloc >::allocator_type
template<class _BidIt, class _Alloc>
typedef iterator_traits<_BidIt>::value_type match_results< _BidIt, _Alloc >::char_type
template<class _BidIt, class _Alloc>
typedef _MyCont::const_iterator match_results< _BidIt, _Alloc >::const_iterator
template<class _BidIt, class _Alloc>
typedef const value_type& match_results< _BidIt, _Alloc >::const_reference
template<class _BidIt, class _Alloc>
typedef iterator_traits<_BidIt>::difference_type match_results< _BidIt, _Alloc >::difference_type
template<class _BidIt, class _Alloc>
typedef const_iterator match_results< _BidIt, _Alloc >::iterator
template<class _BidIt, class _Alloc>
typedef value_type& match_results< _BidIt, _Alloc >::reference
template<class _BidIt, class _Alloc>
typedef _Mytraits::size_type match_results< _BidIt, _Alloc >::size_type
template<class _BidIt, class _Alloc>
typedef basic_string<char_type> match_results< _BidIt, _Alloc >::string_type
template<class _BidIt, class _Alloc>
typedef _Elem match_results< _BidIt, _Alloc >::value_type

Constructor & Destructor Documentation

template<class _BidIt, class _Alloc>
match_results< _BidIt, _Alloc >::match_results ( )
inline
1196  : _Ready(false)
1197  { // construct empty match_results
1198  }
bool _Ready
Definition: regex:1457
template<class _BidIt, class _Alloc>
match_results< _BidIt, _Alloc >::match_results ( const _Alloc &  _Al)
inlineexplicit
1201  : _Ready(false),
1202  _Matches(_Al)
1203  { // construct empty match_results with allocator
1204  }
bool _Ready
Definition: regex:1457
_MyCont _Matches
Definition: regex:1460
template<class _BidIt, class _Alloc>
match_results< _BidIt, _Alloc >::match_results ( const _Myt _Right)
inline
1207  : _Ready(_Right._Ready),
1208  _Org(_Right._Org),
1209  _Matches(_Right._Matches),
1210  _Prefix(_Right._Prefix),
1211  _Suffix(_Right._Suffix)
1212  { // construct by copying
1213  }
_Elem _Suffix
Definition: regex:1462
_BidIt _Org
Definition: regex:1456
_Elem _Prefix
Definition: regex:1461
bool _Ready
Definition: regex:1457
_MyCont _Matches
Definition: regex:1460
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _BidIt, class _Alloc>
match_results< _BidIt, _Alloc >::match_results ( _Myt &&  _Right)
inline
1226  : _Ready(_Right._Ready),
1227  _Org(_Right._Org),
1228  _Matches(_STD move(_Right._Matches)),
1229  _Prefix(_Right._Prefix),
1230  _Suffix(_Right._Suffix),
1231  _Null_elem(_Right._Null_elem)
1232  { // construct by moving _Right
1233  }
_Elem _Suffix
Definition: regex:1462
_BidIt _Org
Definition: regex:1456
_Elem _Prefix
Definition: regex:1461
bool _Ready
Definition: regex:1457
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
_Elem _Null_elem
Definition: regex:1463
_MyCont _Matches
Definition: regex:1460
constexpr const _Ty &() _Right
Definition: algorithm:3723

Member Function Documentation

template<class _BidIt, class _Alloc>
_Elem& match_results< _BidIt, _Alloc >::_At ( unsigned int  _Sub)
inline
1447  { // unchecked access to element at _Sub
1448  return (_Matches[_Sub]);
1449  }
_MyCont _Matches
Definition: regex:1460
template<class _BidIt, class _Alloc>
_Elem match_results< _BidIt, _Alloc >::_At ( unsigned int  _Sub) const
inline
1452  { // unchecked access to element at _Sub
1453  return (_Matches[_Sub]);
1454  }
_MyCont _Matches
Definition: regex:1460
template<class _BidIt, class _Alloc>
template<class _OutIt >
_OutIt match_results< _BidIt, _Alloc >::_Format1 ( _OutIt  _Out,
const char_type _Fmt_begin,
const char_type _Fmt_end,
regex_constants::match_flag_type  _Flags 
) const
inline
1324  { // format text, replacing matches
1325  return (_Flags & regex_constants::format_sed
1326  ? _Format_sed(*this, _Out, _Fmt_begin, _Fmt_end, _Flags)
1327  : _Format_default(*this, _Out, _Fmt_begin, _Fmt_end, _Flags));
1328  }
basic_ostream< _Elem, _Traits > & _Out(basic_ostream< _Elem, _Traits > &_Os, _Ty _Dx)
Definition: random:174
_OutIt _Format_sed(const match_results< _BidIt, _Alloc > &_Match, _OutIt _Out, _InIt _First, _InIt _Last, regex_constants::match_flag_type _Flags=regex_constants::format_default)
Definition: regex:2693
_OutIt _Format_default(const match_results< _BidIt, _Alloc > &_Match, _OutIt _Out, _InIt _First, _InIt _Last, regex_constants::match_flag_type _Flags=regex_constants::format_default)
Definition: regex:2624
Definition: regex:127
template<class _BidIt, class _Alloc>
_Elem& match_results< _BidIt, _Alloc >::_Null ( )
inline
1442  { // return modifiable pair of iterators for null element
1443  return (_Null_elem);
1444  }
_Elem _Null_elem
Definition: regex:1463
template<class _BidIt, class _Alloc>
_Elem& match_results< _BidIt, _Alloc >::_Pfx ( )
inline
1432  { // return modifiable pair of iterators to prefix
1433  return (_Prefix);
1434  }
_Elem _Prefix
Definition: regex:1461
template<class _BidIt, class _Alloc>
void match_results< _BidIt, _Alloc >::_Resize ( unsigned int  _Nx)
inline
1427  { // allocate space for _Nx submatches
1428  _Matches.resize(_Nx);
1429  }
void resize(_CRT_GUARDOVERFLOW const size_type _Newsize)
Definition: vector:1489
_MyCont _Matches
Definition: regex:1460
template<class _BidIt, class _Alloc>
_Elem& match_results< _BidIt, _Alloc >::_Sfx ( )
inline
1437  { // return modifiable pair of iterators to suffix
1438  return (_Suffix);
1439  }
_Elem _Suffix
Definition: regex:1462
template<class _BidIt, class _Alloc>
const_iterator match_results< _BidIt, _Alloc >::begin ( ) const
inline
1300  { // return iterator for beginning of sequence of submatches
1301  return (_Matches.begin());
1302  }
iterator begin() _NOEXCEPT
Definition: vector:1643
_MyCont _Matches
Definition: regex:1460
template<class _BidIt, class _Alloc>
const_iterator match_results< _BidIt, _Alloc >::cbegin ( ) const
inline
1310  { // return iterator for beginning of sequence of submatches
1311  return (_Matches.begin());
1312  }
iterator begin() _NOEXCEPT
Definition: vector:1643
_MyCont _Matches
Definition: regex:1460
template<class _BidIt, class _Alloc>
const_iterator match_results< _BidIt, _Alloc >::cend ( ) const
inline
1315  { // return iterator for end of sequence of submatches
1316  return (_Matches.end());
1317  }
iterator end() _NOEXCEPT
Definition: vector:1653
_MyCont _Matches
Definition: regex:1460
template<class _BidIt, class _Alloc>
bool match_results< _BidIt, _Alloc >::empty ( ) const
inline
1265  { // test if object is empty
1266  return (_Matches.empty());
1267  }
_MyCont _Matches
Definition: regex:1460
bool empty() const _NOEXCEPT
Definition: vector:1703
template<class _BidIt, class _Alloc>
const_iterator match_results< _BidIt, _Alloc >::end ( ) const
inline
1305  { // return iterator for end of sequence of submatches
1306  return (_Matches.end());
1307  }
iterator end() _NOEXCEPT
Definition: vector:1653
_MyCont _Matches
Definition: regex:1460
template<class _BidIt, class _Alloc>
template<class _OutIt >
_OutIt match_results< _BidIt, _Alloc >::format ( _OutIt  _Out,
const char_type _Fmt_begin,
const char_type _Fmt_end,
regex_constants::match_flag_type  _Flags = regex_constants::format_default 
) const
inline
1336  { // format text, replacing matches
1338  _DEBUG_RANGE(_Fmt_begin, _Fmt_end);
1339  return (_Rechecked(_Out,
1340  _Format1(_Unchecked_idl0(_Out), _Fmt_begin, _Fmt_end, _Flags)));
1341  }
basic_ostream< _Elem, _Traits > & _Out(basic_ostream< _Elem, _Traits > &_Os, _Ty _Dx)
Definition: random:174
_OutIt format(_OutIt _Out, const char_type *_Fmt_begin, const char_type *_Fmt_end, regex_constants::match_flag_type _Flags=regex_constants::format_default) const
Definition: regex:1331
#define _DEPRECATE_UNCHECKED(_Func, _Iter)
Definition: xutility:501
#define _DEBUG_RANGE(first, last)
Definition: xutility:902
_Deque_const_iterator< _Mydeque > & _Rechecked(_Deque_const_iterator< _Mydeque > &_Iter, typename _Deque_const_iterator< _Mydeque >::_Unchecked_type _Right)
Definition: deque:527
_OutIt _Format1(_OutIt _Out, const char_type *_Fmt_begin, const char_type *_Fmt_end, regex_constants::match_flag_type _Flags) const
Definition: regex:1320
template<class _BidIt, class _Alloc>
template<class _OutIt , class _Traits1 , class _Alloc1 >
_OutIt match_results< _BidIt, _Alloc >::format ( _OutIt  _Out,
const basic_string< char_type, _Traits1, _Alloc1 > &  _Fmt,
regex_constants::match_flag_type  _Flags = regex_constants::format_default 
) const
inline
1365  { // format text, replacing matches
1367  return (_Rechecked(_Out, _Format1(_Unchecked_idl0(_Out),
1368  _Unchecked(_Fmt.begin()), _Unchecked(_Fmt.end()), _Flags)));
1369  }
basic_ostream< _Elem, _Traits > & _Out(basic_ostream< _Elem, _Traits > &_Os, _Ty _Dx)
Definition: random:174
_OutIt format(_OutIt _Out, const char_type *_Fmt_begin, const char_type *_Fmt_end, regex_constants::match_flag_type _Flags=regex_constants::format_default) const
Definition: regex:1331
#define _DEPRECATE_UNCHECKED(_Func, _Iter)
Definition: xutility:501
_Deque_const_iterator< _Mydeque > & _Rechecked(_Deque_const_iterator< _Mydeque > &_Iter, typename _Deque_const_iterator< _Mydeque >::_Unchecked_type _Right)
Definition: deque:527
iterator end() _NOEXCEPT
Definition: xstring:2869
_Iter_t _Unchecked(_Iter_t _Iter)
Definition: iterator:11
_OutIt _Format1(_OutIt _Out, const char_type *_Fmt_begin, const char_type *_Fmt_end, regex_constants::match_flag_type _Flags) const
Definition: regex:1320
iterator begin() _NOEXCEPT
Definition: xstring:2857
template<class _BidIt, class _Alloc>
template<class _Traits1 , class _Alloc1 >
basic_string<char_type, _Traits1, _Alloc1> match_results< _BidIt, _Alloc >::format ( const basic_string< char_type, _Traits1, _Alloc1 > &  _Fmt,
regex_constants::match_flag_type  _Flags = regex_constants::format_default 
) const
inline
1393  { // format text, replacing matches
1395  format(_STD back_inserter(_Str),
1396  _Unchecked(_Fmt.begin()), _Unchecked(_Fmt.end()), _Flags);
1397  return (_Str);
1398  }
_OutIt format(_OutIt _Out, const char_type *_Fmt_begin, const char_type *_Fmt_end, regex_constants::match_flag_type _Flags=regex_constants::format_default) const
Definition: regex:1331
back_insert_iterator< _Container > back_inserter(_Container &_Cont)
Definition: xutility:3750
iterator end() _NOEXCEPT
Definition: xstring:2869
_Iter_t _Unchecked(_Iter_t _Iter)
Definition: iterator:11
iterator begin() _NOEXCEPT
Definition: xstring:2857
Definition: xstring:1866
template<class _BidIt, class _Alloc>
string_type match_results< _BidIt, _Alloc >::format ( const char_type _Fmt_begin,
regex_constants::match_flag_type  _Flags = regex_constants::format_default 
) const
inline
1403  { // format text, replacing matches
1404  string_type _Fmt(_Fmt_begin);
1405  string_type _Str;
1406  format(_STD back_inserter(_Str),
1407  _Unchecked(_Fmt.begin()), _Unchecked(_Fmt.end()), _Flags);
1408  return (_Str);
1409  }
basic_string< char_type > string_type
Definition: regex:1193
_OutIt format(_OutIt _Out, const char_type *_Fmt_begin, const char_type *_Fmt_end, regex_constants::match_flag_type _Flags=regex_constants::format_default) const
Definition: regex:1331
back_insert_iterator< _Container > back_inserter(_Container &_Cont)
Definition: xutility:3750
_Iter_t _Unchecked(_Iter_t _Iter)
Definition: iterator:11
template<class _BidIt, class _Alloc>
allocator_type match_results< _BidIt, _Alloc >::get_allocator ( ) const
inline
1412  { // return allocator object for submatches
1414  return (_Ret);
1415  }
_Alloc get_allocator() const _NOEXCEPT
Definition: vector:1839
_Alloc allocator_type
Definition: regex:1191
_MyCont _Matches
Definition: regex:1460
template<class _BidIt, class _Alloc>
difference_type match_results< _BidIt, _Alloc >::length ( size_type  _Sub = 0) const
inline
1270  { // return length of capture group _Sub
1271  return ((*this)[_Sub].length());
1272  }
difference_type length(size_type _Sub=0) const
Definition: regex:1269
template<class _BidIt, class _Alloc>
size_type match_results< _BidIt, _Alloc >::max_size ( ) const
inline
1260  { // return maximum possible number of capture groups
1261  return (_Matches.max_size());
1262  }
size_type max_size() const _NOEXCEPT
Definition: vector:1713
_MyCont _Matches
Definition: regex:1460
template<class _BidIt, class _Alloc>
_Myt& match_results< _BidIt, _Alloc >::operator= ( const _Myt _Right)
inline
1216  { // assign
1217  _Ready = _Right._Ready;
1218  _Org = _Right._Org;
1219  _Matches = _Right._Matches;
1220  _Prefix = _Right._Prefix;
1221  _Suffix = _Right._Suffix;
1222  return (*this);
1223  }
_Elem _Suffix
Definition: regex:1462
_BidIt _Org
Definition: regex:1456
_Elem _Prefix
Definition: regex:1461
bool _Ready
Definition: regex:1457
_MyCont _Matches
Definition: regex:1460
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _BidIt, class _Alloc>
_Myt& match_results< _BidIt, _Alloc >::operator= ( _Myt &&  _Right)
inline
1236  { // assign by moving _Right
1237  if (this != _STD addressof(_Right))
1238  { // clear this and steal from _Right
1239  _Ready = _Right._Ready;
1240  _Org = _Right._Org;
1241  _Matches = _STD move(_Right._Matches);
1242  _Prefix = _Right._Prefix;
1243  _Suffix = _Right._Suffix;
1244  _Null_elem = _Right._Null_elem;
1245  }
1246  return (*this);
1247  }
_Elem _Suffix
Definition: regex:1462
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
_BidIt _Org
Definition: regex:1456
_Elem _Prefix
Definition: regex:1461
bool _Ready
Definition: regex:1457
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
_Elem _Null_elem
Definition: regex:1463
_MyCont _Matches
Definition: regex:1460
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _BidIt, class _Alloc>
const_reference match_results< _BidIt, _Alloc >::operator[] ( size_type  _Sub) const
inline
1285  { // return submatch _Sub
1286  return (_Matches.size() <= _Sub ? _Null_elem : _Matches[_Sub]);
1287  }
size_type size() const _NOEXCEPT
Definition: vector:1708
_Elem _Null_elem
Definition: regex:1463
_MyCont _Matches
Definition: regex:1460
template<class _BidIt, class _Alloc>
difference_type match_results< _BidIt, _Alloc >::position ( size_type  _Sub = 0) const
inline
1275  { // return offset of submatch _Sub
1276  return (_STD distance(_Org, (*this)[_Sub].first));
1277  }
_BidIt _Org
Definition: regex:1456
_Iter_diff_t< _InIt > distance(_InIt _First, _InIt _Last)
Definition: xutility:1111
template<class _BidIt, class _Alloc>
const_reference match_results< _BidIt, _Alloc >::prefix ( ) const
inline
1290  { // return text preceding match
1291  return (_Prefix);
1292  }
_Elem _Prefix
Definition: regex:1461
template<class _BidIt, class _Alloc>
bool match_results< _BidIt, _Alloc >::ready ( ) const
inline
1250  { // test if ready
1251  return (_Ready);
1252  }
bool _Ready
Definition: regex:1457
template<class _BidIt, class _Alloc>
size_type match_results< _BidIt, _Alloc >::size ( ) const
inline
1255  { // return number of capture groups
1256  return (_Matches.size());
1257  }
size_type size() const _NOEXCEPT
Definition: vector:1708
_MyCont _Matches
Definition: regex:1460
template<class _BidIt, class _Alloc>
string_type match_results< _BidIt, _Alloc >::str ( size_type  _Sub = 0) const
inline
1280  { // return contents of submatch _Sub
1281  return (string_type((*this)[_Sub]));
1282  }
basic_string< char_type > string_type
Definition: regex:1193
template<class _BidIt, class _Alloc>
const_reference match_results< _BidIt, _Alloc >::suffix ( ) const
inline
1295  { // return text following match
1296  return (_Suffix);
1297  }
_Elem _Suffix
Definition: regex:1462
template<class _BidIt, class _Alloc>
void match_results< _BidIt, _Alloc >::swap ( match_results< _BidIt, _Alloc > &  _Right)
inline
1418  { // exchange contents with _Right
1419  _STD swap(_Ready, _Right._Ready);
1420  _Swap_adl(_Org, _Right._Org);
1421  _Matches.swap(_Right._Matches);
1422  _STD swap(_Prefix, _Right._Prefix);
1423  _STD swap(_Suffix, _Right._Suffix);
1424  }
_Elem _Suffix
Definition: regex:1462
_BidIt _Org
Definition: regex:1456
void swap(vector &_Right) _NOEXCEPT_OP(_Alty
Definition: vector:1620
_Elem _Prefix
Definition: regex:1461
void swap(match_results &_Right)
Definition: regex:1417
void _Swap_adl(_Ty &_Left, _Ty &_Right) _NOEXCEPT_OP(_Is_nothrow_swappable< _Ty >
Definition: utility:73
bool _Ready
Definition: regex:1457
_MyCont _Matches
Definition: regex:1460

Member Data Documentation

template<class _BidIt, class _Alloc>
_MyCont match_results< _BidIt, _Alloc >::_Matches
private
template<class _BidIt, class _Alloc>
_Elem match_results< _BidIt, _Alloc >::_Null_elem
private
template<class _BidIt, class _Alloc>
_BidIt match_results< _BidIt, _Alloc >::_Org
template<class _BidIt, class _Alloc>
_Elem match_results< _BidIt, _Alloc >::_Prefix
private
template<class _BidIt, class _Alloc>
bool match_results< _BidIt, _Alloc >::_Ready
template<class _BidIt, class _Alloc>
_Elem match_results< _BidIt, _Alloc >::_Suffix
private

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