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
1562  : _Sz(0), _Nchrs(0), _Chrs(0)
1563  { // construct
1564  }
unsigned int _Sz
Definition: regex:1624
_Elem * _Chrs
Definition: regex:1626
unsigned int _Nchrs
Definition: regex:1625
template<class _Elem>
_Buf< _Elem >::~_Buf ( )
inline
1567  { // destroy
1568  free(_Chrs);
1569  }
_ACRTIMP void __cdecl free(_Pre_maybenull_ _Post_invalid_ void *_Block)
_Elem * _Chrs
Definition: regex:1626

Member Function Documentation

template<class _Elem>
_Elem _Buf< _Elem >::_At ( unsigned int  _Idx) const
inline
1577  { // return character at _Idx
1578  #if _ITERATOR_DEBUG_LEVEL == 2
1579  if (_Nchrs <= _Idx)
1580  {
1581  _DEBUG_ERROR("regex buffer subscript out of range");
1582  }
1583  #else /* _ITERATOR_DEBUG_LEVEL == 2 */
1585  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1586 
1587  return (_Chrs[_Idx]);
1588  }
_Elem * _Chrs
Definition: regex:1626
unsigned int _Nchrs
Definition: regex:1625
#define _SCL_SECURE_VALIDATE_RANGE(cond)
Definition: yvals.h:432
#define _DEBUG_ERROR(mesg)
Definition: xutility:33
template<class _Elem>
_Elem _Buf< _Elem >::_Del ( )
inline
1603  { // remove and return last character
1604  return (_Chrs[--_Nchrs]);
1605  }
_Elem * _Chrs
Definition: regex:1626
unsigned int _Nchrs
Definition: regex:1625
template<class _Elem>
void _Buf< _Elem >::_Expand ( unsigned int  _Len)
inlineprivate
1616  { // expand buffer to hold _Len characters
1617  _Elem *_Tmp = (_Elem *)realloc(_Chrs, _Len * sizeof (_Elem));
1618  if (!_Tmp)
1619  _Xbad_alloc();
1620  _Chrs = _Tmp;
1621  _Sz = _Len;
1622  }
unsigned int _Sz
Definition: regex:1624
_Elem * _Chrs
Definition: regex:1626
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xbad_alloc()
template<class _Elem>
void _Buf< _Elem >::_Insert ( _Elem  _Ch)
inline
1596  { // append _Ch
1597  if (_Sz <= _Nchrs)
1599  _Chrs[_Nchrs++] = _Ch;
1600  }
const unsigned int _Buf_incr
Definition: regex:1504
unsigned int _Sz
Definition: regex:1624
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
_Elem * _Chrs
Definition: regex:1626
void _Expand(unsigned int _Len)
Definition: regex:1615
unsigned int _Nchrs
Definition: regex:1625
template<class _Elem>
template<class _FwdIt >
void _Buf< _Elem >::_Insert ( _FwdIt  _First,
_FwdIt  _Last 
)
inline
1609  { // append multiple characters
1610  while (_First != _Last)
1611  _Insert(*_First++);
1612  }
void _Insert(_Elem _Ch)
Definition: regex:1595
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem>
unsigned int _Buf< _Elem >::_Size ( ) const
inline
1572  { // return number of characters held in buffer
1573  return (_Nchrs);
1574  }
unsigned int _Nchrs
Definition: regex:1625
template<class _Elem>
const _Elem* _Buf< _Elem >::_Str ( ) const
inline
1591  { // return pointer to first character
1592  return (_Chrs);
1593  }
_Elem * _Chrs
Definition: regex:1626

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: