STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Private Member Functions | Private Attributes | List of all members
_Buf< _Elem > Struct Template Reference

Public Member Functions

 _Buf ()
 
 ~_Buf () _NOEXCEPT
 
unsigned int _Size () const
 
_Elem _At (unsigned int _Idx) const
 
const _Elem * _Str () const
 
void _Insert (_Elem _Ch)
 
_Elem _Del ()
 
template<class _FwdIt >
void _Insert (_FwdIt _First, _FwdIt _Last)
 

Private Member Functions

void _Expand (unsigned int _Len)
 

Private Attributes

unsigned int _Sz
 
unsigned int _Nchrs
 
_Elem * _Chrs
 

Constructor & Destructor Documentation

template<class _Elem>
_Buf< _Elem >::_Buf ( )
inline
1542  : _Sz(0), _Nchrs(0), _Chrs(0)
1543  { // construct
1544  }
unsigned int _Sz
Definition: regex:1603
_Elem * _Chrs
Definition: regex:1605
unsigned int _Nchrs
Definition: regex:1604
template<class _Elem>
_Buf< _Elem >::~_Buf ( )
inline
1547  { // destroy
1548  free(_Chrs);
1549  }
_Elem * _Chrs
Definition: regex:1605

Member Function Documentation

template<class _Elem>
_Elem _Buf< _Elem >::_At ( unsigned int  _Idx) const
inline
1557  { // return character at _Idx
1558  #if _ITERATOR_DEBUG_LEVEL == 2
1559  if (_Nchrs <= _Idx)
1560  _DEBUG_ERROR("regex buffer subscript out of range");
1561 
1562  #else /* _ITERATOR_DEBUG_LEVEL == 2 */
1564  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1565 
1566  return (_Chrs[_Idx]);
1567  }
_Elem * _Chrs
Definition: regex:1605
unsigned int _Nchrs
Definition: regex:1604
#define _SCL_SECURE_VALIDATE_RANGE(cond)
Definition: yvals.h:392
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
template<class _Elem>
_Elem _Buf< _Elem >::_Del ( )
inline
1582  { // remove and return last character
1583  return (_Chrs[--_Nchrs]);
1584  }
_Elem * _Chrs
Definition: regex:1605
unsigned int _Nchrs
Definition: regex:1604
template<class _Elem>
void _Buf< _Elem >::_Expand ( unsigned int  _Len)
inlineprivate
1595  { // expand buffer to hold _Len characters
1596  _Elem *_Tmp = (_Elem *)realloc(_Chrs, _Len * sizeof (_Elem));
1597  if (!_Tmp)
1598  _Xbad_alloc();
1599  _Chrs = _Tmp;
1600  _Sz = _Len;
1601  }
unsigned int _Sz
Definition: regex:1603
_Elem * _Chrs
Definition: regex:1605
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xbad_alloc()
template<class _Elem>
void _Buf< _Elem >::_Insert ( _Elem  _Ch)
inline
1575  { // append _Ch
1576  if (_Sz <= _Nchrs)
1578  _Chrs[_Nchrs++] = _Ch;
1579  }
const unsigned int _Buf_incr
Definition: regex:1484
unsigned int _Sz
Definition: regex:1603
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
_Elem * _Chrs
Definition: regex:1605
void _Expand(unsigned int _Len)
Definition: regex:1594
unsigned int _Nchrs
Definition: regex:1604
template<class _Elem>
template<class _FwdIt >
void _Buf< _Elem >::_Insert ( _FwdIt  _First,
_FwdIt  _Last 
)
inline
1588  { // append multiple characters
1589  while (_First != _Last)
1590  _Insert(*_First++);
1591  }
void _Insert(_Elem _Ch)
Definition: regex:1574
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem>
unsigned int _Buf< _Elem >::_Size ( ) const
inline
1552  { // return number of characters held in buffer
1553  return (_Nchrs);
1554  }
unsigned int _Nchrs
Definition: regex:1604
template<class _Elem>
const _Elem* _Buf< _Elem >::_Str ( ) const
inline
1570  { // return pointer to first character
1571  return (_Chrs);
1572  }
_Elem * _Chrs
Definition: regex:1605

Member Data Documentation

template<class _Elem>
_Elem* _Buf< _Elem >::_Chrs
private
template<class _Elem>
unsigned int _Buf< _Elem >::_Nchrs
private
template<class _Elem>
unsigned int _Buf< _Elem >::_Sz
private

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