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
1175  : _Ready(false)
1176  { // construct empty match_results
1177  }
bool _Ready
Definition: regex:1437
template<class _BidIt, class _Alloc>
match_results< _BidIt, _Alloc >::match_results ( const _Alloc &  _Al)
inlineexplicit
1180  : _Ready(false),
1181  _Matches(_Al)
1182  { // construct empty match_results with allocator
1183  }
bool _Ready
Definition: regex:1437
_MyCont _Matches
Definition: regex:1440
template<class _BidIt, class _Alloc>
match_results< _BidIt, _Alloc >::match_results ( const _Myt _Right)
inline
1186  : _Ready(_Right._Ready),
1187  _Org(_Right._Org),
1188  _Matches(_Right._Matches),
1189  _Prefix(_Right._Prefix),
1190  _Suffix(_Right._Suffix)
1191  { // construct by copying
1192  }
_Elem _Suffix
Definition: regex:1442
_BidIt _Org
Definition: regex:1436
_Elem _Prefix
Definition: regex:1441
bool _Ready
Definition: regex:1437
_MyCont _Matches
Definition: regex:1440
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _BidIt, class _Alloc>
match_results< _BidIt, _Alloc >::match_results ( _Myt &&  _Right)
inline
1205  : _Ready(_Right._Ready),
1206  _Org(_Right._Org),
1207  _Matches(_STD move(_Right._Matches)),
1208  _Prefix(_Right._Prefix),
1209  _Suffix(_Right._Suffix),
1210  _Null_elem(_Right._Null_elem)
1211  { // construct by moving _Right
1212  }
_Elem _Suffix
Definition: regex:1442
_BidIt _Org
Definition: regex:1436
_Elem _Prefix
Definition: regex:1441
bool _Ready
Definition: regex:1437
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1290
_Elem _Null_elem
Definition: regex:1443
_MyCont _Matches
Definition: regex:1440
constexpr const _Ty &() _Right
Definition: algorithm:3591

Member Function Documentation

template<class _BidIt, class _Alloc>
_Elem& match_results< _BidIt, _Alloc >::_At ( unsigned int  _Sub)
inline
1427  { // unchecked access to element at _Sub
1428  return (_Matches[_Sub]);
1429  }
_MyCont _Matches
Definition: regex:1440
template<class _BidIt, class _Alloc>
_Elem match_results< _BidIt, _Alloc >::_At ( unsigned int  _Sub) const
inline
1432  { // unchecked access to element at _Sub
1433  return (_Matches[_Sub]);
1434  }
_MyCont _Matches
Definition: regex:1440
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
1303  { // format text, replacing matches
1304  return (_Flags & regex_constants::format_sed
1305  ? _Format_sed(*this, _Out, _Fmt_begin, _Fmt_end, _Flags)
1306  : _Format_default(*this, _Out, _Fmt_begin, _Fmt_end, _Flags));
1307  }
basic_ostream< _Elem, _Traits > & _Out(basic_ostream< _Elem, _Traits > &_Os, _Ty _Dx)
Definition: random:151
_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:2672
_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:2603
Definition: regex:128
template<class _BidIt, class _Alloc>
_Elem& match_results< _BidIt, _Alloc >::_Null ( )
inline
1422  { // return modifiable pair of iterators for null element
1423  return (_Null_elem);
1424  }
_Elem _Null_elem
Definition: regex:1443
template<class _BidIt, class _Alloc>
_Elem& match_results< _BidIt, _Alloc >::_Pfx ( )
inline
1412  { // return modifiable pair of iterators to prefix
1413  return (_Prefix);
1414  }
_Elem _Prefix
Definition: regex:1441
template<class _BidIt, class _Alloc>
void match_results< _BidIt, _Alloc >::_Resize ( unsigned int  _Nx)
inline
1407  { // allocate space for _Nx submatches
1408  _Matches.resize(_Nx);
1409  }
void resize(size_type _Newsize)
Definition: vector:1132
_MyCont _Matches
Definition: regex:1440
template<class _BidIt, class _Alloc>
_Elem& match_results< _BidIt, _Alloc >::_Sfx ( )
inline
1417  { // return modifiable pair of iterators to suffix
1418  return (_Suffix);
1419  }
_Elem _Suffix
Definition: regex:1442
template<class _BidIt, class _Alloc>
const_iterator match_results< _BidIt, _Alloc >::begin ( ) const
inline
1279  { // return iterator for beginning of sequence of submatches
1280  return (_Matches.begin());
1281  }
iterator begin() _NOEXCEPT
Definition: vector:1056
_MyCont _Matches
Definition: regex:1440
template<class _BidIt, class _Alloc>
const_iterator match_results< _BidIt, _Alloc >::cbegin ( ) const
inline
1289  { // return iterator for beginning of sequence of submatches
1290  return (_Matches.begin());
1291  }
iterator begin() _NOEXCEPT
Definition: vector:1056
_MyCont _Matches
Definition: regex:1440
template<class _BidIt, class _Alloc>
const_iterator match_results< _BidIt, _Alloc >::cend ( ) const
inline
1294  { // return iterator for end of sequence of submatches
1295  return (_Matches.end());
1296  }
iterator end() _NOEXCEPT
Definition: vector:1066
_MyCont _Matches
Definition: regex:1440
template<class _BidIt, class _Alloc>
bool match_results< _BidIt, _Alloc >::empty ( ) const
inline
1244  { // test if object is empty
1245  return (_Matches.empty());
1246  }
_MyCont _Matches
Definition: regex:1440
bool empty() const _NOEXCEPT
Definition: vector:1188
template<class _BidIt, class _Alloc>
const_iterator match_results< _BidIt, _Alloc >::end ( ) const
inline
1284  { // return iterator for end of sequence of submatches
1285  return (_Matches.end());
1286  }
iterator end() _NOEXCEPT
Definition: vector:1066
_MyCont _Matches
Definition: regex:1440
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
1315  { // format text, replacing matches
1317  _DEBUG_RANGE_PTR(_Fmt_begin, _Fmt_end, _Out);
1318  return (_Rechecked(_Out,
1319  _Format1(_Unchecked_idl0(_Out), _Fmt_begin, _Fmt_end, _Flags)));
1320  }
basic_ostream< _Elem, _Traits > & _Out(basic_ostream< _Elem, _Traits > &_Os, _Ty _Dx)
Definition: random:151
_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:1310
#define _DEPRECATE_UNCHECKED(_Func, _Iter)
Definition: xutility:478
_Deque_const_iterator< _Mydeque > & _Rechecked(_Deque_const_iterator< _Mydeque > &_Iter, typename _Deque_const_iterator< _Mydeque >::_Unchecked_type _Right)
Definition: deque:534
#define _DEBUG_RANGE_PTR(first, last, ptr)
Definition: xutility:824
_OutIt _Format1(_OutIt _Out, const char_type *_Fmt_begin, const char_type *_Fmt_end, regex_constants::match_flag_type _Flags) const
Definition: regex:1299
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
1344  { // format text, replacing matches
1346  _DEBUG_POINTER_IF(!_Fmt.empty(), _Out);
1347  return (_Rechecked(_Out, _Format1(_Unchecked_idl0(_Out),
1348  _Unchecked(_Fmt.begin()), _Unchecked(_Fmt.end()), _Flags)));
1349  }
basic_ostream< _Elem, _Traits > & _Out(basic_ostream< _Elem, _Traits > &_Os, _Ty _Dx)
Definition: random:151
_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:1310
#define _DEPRECATE_UNCHECKED(_Func, _Iter)
Definition: xutility:478
_Deque_const_iterator< _Mydeque > & _Rechecked(_Deque_const_iterator< _Mydeque > &_Iter, typename _Deque_const_iterator< _Mydeque >::_Unchecked_type _Right)
Definition: deque:534
#define _DEBUG_POINTER_IF(test, first)
Definition: xutility:820
iterator end() _NOEXCEPT
Definition: xstring:1605
_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:1299
iterator begin() _NOEXCEPT
Definition: xstring:1593
bool empty() const _NOEXCEPT
Definition: xstring:1802
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
1373  { // format text, replacing matches
1375  format(_STD back_inserter(_Str),
1376  _Unchecked(_Fmt.begin()), _Unchecked(_Fmt.end()), _Flags);
1377  return (_Str);
1378  }
_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:1310
back_insert_iterator< _Container > back_inserter(_Container &_Cont)
Definition: iterator:69
iterator end() _NOEXCEPT
Definition: xstring:1605
_Iter_t _Unchecked(_Iter_t _Iter)
Definition: iterator:11
iterator begin() _NOEXCEPT
Definition: xstring:1593
Definition: xstring:21
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
1383  { // format text, replacing matches
1384  string_type _Fmt(_Fmt_begin);
1385  string_type _Str;
1386  format(_STD back_inserter(_Str),
1387  _Unchecked(_Fmt.begin()), _Unchecked(_Fmt.end()), _Flags);
1388  return (_Str);
1389  }
basic_string< char_type > string_type
Definition: regex:1172
_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:1310
back_insert_iterator< _Container > back_inserter(_Container &_Cont)
Definition: iterator:69
_Iter_t _Unchecked(_Iter_t _Iter)
Definition: iterator:11
template<class _BidIt, class _Alloc>
allocator_type match_results< _BidIt, _Alloc >::get_allocator ( ) const
inline
1392  { // return allocator object for submatches
1394  return (_Ret);
1395  }
_Alloc get_allocator() const _NOEXCEPT
Definition: vector:1193
_Alloc allocator_type
Definition: regex:1170
_MyCont _Matches
Definition: regex:1440
template<class _BidIt, class _Alloc>
difference_type match_results< _BidIt, _Alloc >::length ( size_type  _Sub = 0) const
inline
1249  { // return length of capture group _Sub
1250  return ((*this)[_Sub].length());
1251  }
difference_type length(size_type _Sub=0) const
Definition: regex:1248
template<class _BidIt, class _Alloc>
size_type match_results< _BidIt, _Alloc >::max_size ( ) const
inline
1239  { // return maximum possible number of capture groups
1240  return (_Matches.max_size());
1241  }
size_type max_size() const _NOEXCEPT
Definition: vector:1183
_MyCont _Matches
Definition: regex:1440
template<class _BidIt, class _Alloc>
_Myt& match_results< _BidIt, _Alloc >::operator= ( const _Myt _Right)
inline
1195  { // assign
1196  _Ready = _Right._Ready;
1197  _Org = _Right._Org;
1198  _Matches = _Right._Matches;
1199  _Prefix = _Right._Prefix;
1200  _Suffix = _Right._Suffix;
1201  return (*this);
1202  }
_Elem _Suffix
Definition: regex:1442
_BidIt _Org
Definition: regex:1436
_Elem _Prefix
Definition: regex:1441
bool _Ready
Definition: regex:1437
_MyCont _Matches
Definition: regex:1440
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _BidIt, class _Alloc>
_Myt& match_results< _BidIt, _Alloc >::operator= ( _Myt &&  _Right)
inline
1215  { // assign by moving _Right
1216  if (this != &_Right)
1217  { // clear this and steal from _Right
1218  _Ready = _Right._Ready;
1219  _Org = _Right._Org;
1220  _Matches = _STD move(_Right._Matches);
1221  _Prefix = _Right._Prefix;
1222  _Suffix = _Right._Suffix;
1223  _Null_elem = _Right._Null_elem;
1224  }
1225  return (*this);
1226  }
_Elem _Suffix
Definition: regex:1442
_BidIt _Org
Definition: regex:1436
_Elem _Prefix
Definition: regex:1441
bool _Ready
Definition: regex:1437
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1290
_Elem _Null_elem
Definition: regex:1443
_MyCont _Matches
Definition: regex:1440
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _BidIt, class _Alloc>
const_reference match_results< _BidIt, _Alloc >::operator[] ( size_type  _Sub) const
inline
1264  { // return submatch _Sub
1265  return (_Matches.size() <= _Sub ? _Null_elem : _Matches[_Sub]);
1266  }
size_type size() const _NOEXCEPT
Definition: vector:1178
_Elem _Null_elem
Definition: regex:1443
_MyCont _Matches
Definition: regex:1440
template<class _BidIt, class _Alloc>
difference_type match_results< _BidIt, _Alloc >::position ( size_type  _Sub = 0) const
inline
1254  { // return offset of submatch _Sub
1255  return (_STD distance(_Org, (*this)[_Sub].first));
1256  }
_BidIt _Org
Definition: regex:1436
_Iter_diff_t< _InIt > distance(_InIt _First, _InIt _Last)
Definition: xutility:1124
template<class _BidIt, class _Alloc>
const_reference match_results< _BidIt, _Alloc >::prefix ( ) const
inline
1269  { // return text preceding match
1270  return (_Prefix);
1271  }
_Elem _Prefix
Definition: regex:1441
template<class _BidIt, class _Alloc>
bool match_results< _BidIt, _Alloc >::ready ( ) const
inline
1229  { // test if ready
1230  return (_Ready);
1231  }
bool _Ready
Definition: regex:1437
template<class _BidIt, class _Alloc>
size_type match_results< _BidIt, _Alloc >::size ( ) const
inline
1234  { // return number of capture groups
1235  return (_Matches.size());
1236  }
size_type size() const _NOEXCEPT
Definition: vector:1178
_MyCont _Matches
Definition: regex:1440
template<class _BidIt, class _Alloc>
string_type match_results< _BidIt, _Alloc >::str ( size_type  _Sub = 0) const
inline
1259  { // return contents of submatch _Sub
1260  return (string_type((*this)[_Sub]));
1261  }
basic_string< char_type > string_type
Definition: regex:1172
template<class _BidIt, class _Alloc>
const_reference match_results< _BidIt, _Alloc >::suffix ( ) const
inline
1274  { // return text following match
1275  return (_Suffix);
1276  }
_Elem _Suffix
Definition: regex:1442
template<class _BidIt, class _Alloc>
void match_results< _BidIt, _Alloc >::swap ( match_results< _BidIt, _Alloc > &  _Right)
inline
1398  { // exchange contents with _Right
1399  _STD swap(_Ready, _Right._Ready);
1400  _Swap_adl(_Org, _Right._Org);
1401  _Matches.swap(_Right._Matches);
1402  _STD swap(_Prefix, _Right._Prefix);
1403  _STD swap(_Suffix, _Right._Suffix);
1404  }
_Elem _Suffix
Definition: regex:1442
_BidIt _Org
Definition: regex:1436
void swap(_Myt &_Right) _NOEXCEPT_OP(_Alty
Definition: vector:1545
_Elem _Prefix
Definition: regex:1441
void swap(match_results &_Right)
Definition: regex:1397
void _Swap_adl(_Ty &_Left, _Ty &_Right) _NOEXCEPT_OP(_Is_nothrow_swappable< _Ty >
Definition: utility:56
bool _Ready
Definition: regex:1437
_MyCont _Matches
Definition: regex:1440

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: