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
 
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 (int _Len)
 

Private Attributes

unsigned int _Sz
 
unsigned int _Nchrs
 
_Elem * _Chrs
 

Constructor & Destructor Documentation

template<class _Elem>
_Buf< _Elem >::_Buf ( )
inline
1523  : _Sz(0), _Nchrs(0), _Chrs(0)
1524  { // construct
1525  }
unsigned int _Sz
Definition: regex:1584
_Elem * _Chrs
Definition: regex:1586
unsigned int _Nchrs
Definition: regex:1585
template<class _Elem>
_Buf< _Elem >::~_Buf ( )
inline
1528  { // destroy
1529  free(_Chrs);
1530  }
_CRTIMP _CRTNOALIAS void __cdecl free(_Pre_maybenull_ _Post_invalid_ void *_Memory)
_Elem * _Chrs
Definition: regex:1586

Member Function Documentation

template<class _Elem>
_Elem _Buf< _Elem >::_At ( unsigned int  _Idx) const
inline
1538  { // return character at _Idx
1539  #if _ITERATOR_DEBUG_LEVEL == 2
1540  if (_Nchrs <= _Idx)
1541  _DEBUG_ERROR("regex buffer subscript out of range");
1542 
1543  #else /* _ITERATOR_DEBUG_LEVEL == 2 */
1545  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1546 
1547  return (_Chrs[_Idx]);
1548  }
_Elem * _Chrs
Definition: regex:1586
unsigned int _Nchrs
Definition: regex:1585
#define _SCL_SECURE_VALIDATE_RANGE(cond)
Definition: yvals.h:347
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
template<class _Elem>
_Elem _Buf< _Elem >::_Del ( )
inline
1563  { // remove and return last character
1564  return (_Chrs[--_Nchrs]);
1565  }
_Elem * _Chrs
Definition: regex:1586
unsigned int _Nchrs
Definition: regex:1585
template<class _Elem>
void _Buf< _Elem >::_Expand ( int  _Len)
inlineprivate
1576  { // expand buffer to hold _Len characters
1577  _Elem *_Tmp = (_Elem *)realloc(_Chrs, _Len * sizeof (_Elem));
1578  if (!_Tmp)
1579  _Xbad_alloc();
1580  _Chrs = _Tmp;
1581  _Sz = _Len;
1582  }
unsigned int _Sz
Definition: regex:1584
_Elem * _Chrs
Definition: regex:1586
template<class _Elem>
void _Buf< _Elem >::_Insert ( _Elem  _Ch)
inline
1556  { // append _Ch
1557  if (_Sz <= _Nchrs)
1559  _Chrs[_Nchrs++] = _Ch;
1560  }
const int _Buf_incr
Definition: regex:1465
unsigned int _Sz
Definition: regex:1584
_Elem * _Chrs
Definition: regex:1586
void _Expand(int _Len)
Definition: regex:1575
_In_ size_t _In_ unsigned int _Ch
Definition: mbstring.h:161
unsigned int _Nchrs
Definition: regex:1585
template<class _Elem>
template<class _FwdIt >
void _Buf< _Elem >::_Insert ( _FwdIt  _First,
_FwdIt  _Last 
)
inline
1569  { // append multiple characters
1570  while (_First != _Last)
1571  _Insert(*_First++);
1572  }
void _Insert(_Elem _Ch)
Definition: regex:1555
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem>
int _Buf< _Elem >::_Size ( ) const
inline
1533  { // return number of characters held in buffer
1534  return (_Nchrs);
1535  }
unsigned int _Nchrs
Definition: regex:1585
template<class _Elem>
const _Elem* _Buf< _Elem >::_Str ( ) const
inline
1551  { // return pointer to first character
1552  return (_Chrs);
1553  }
_Elem * _Chrs
Definition: regex:1586

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: