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

Public Types

typedef _Yarn< _Elem > _Myt
 

Public Member Functions

__CLR_OR_THIS_CALL _Yarn ()
 
__CLR_OR_THIS_CALL _Yarn (const _Myt &_Right)
 
__CLR_OR_THIS_CALL _Yarn (const _Elem *_Right)
 
_Myt &__CLR_OR_THIS_CALL operator= (const _Myt &_Right)
 
_Myt &__CLR_OR_THIS_CALL operator= (const _Elem *_Right)
 
__CLR_OR_THIS_CALL ~_Yarn () _NOEXCEPT
 
bool __CLR_OR_THIS_CALL empty () const
 
const _Elem *__CLR_OR_THIS_CALL c_str () const
 
bool __CLR_OR_THIS_CALL _Empty () const
 
const _Elem *__CLR_OR_THIS_CALL _C_str () const
 

Private Member Functions

void __CLR_OR_THIS_CALL _Tidy ()
 

Private Attributes

_Elem * _Myptr
 
_Elem _Nul
 

Member Typedef Documentation

template<class _Elem>
typedef _Yarn<_Elem> _Yarn< _Elem >::_Myt

Constructor & Destructor Documentation

template<class _Elem>
__CLR_OR_THIS_CALL _Yarn< _Elem >::_Yarn ( )
inline
3719  : _Myptr(0), _Nul(0)
3720  { // default construct
3721  }
_Elem _Nul
Definition: xutility:3810
_Elem * _Myptr
Definition: xutility:3809
template<class _Elem>
__CLR_OR_THIS_CALL _Yarn< _Elem >::_Yarn ( const _Myt _Right)
inline
3724  : _Myptr(0), _Nul(0)
3725  { // construct from _Yarn
3726  *this = _Right;
3727  }
_Elem _Nul
Definition: xutility:3810
_Elem * _Myptr
Definition: xutility:3809
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Elem>
__CLR_OR_THIS_CALL _Yarn< _Elem >::_Yarn ( const _Elem *  _Right)
inline
3730  : _Myptr(0), _Nul(0)
3731  { // construct from NTBS
3732  *this = _Right;
3733  }
_Elem _Nul
Definition: xutility:3810
_Elem * _Myptr
Definition: xutility:3809
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Elem>
__CLR_OR_THIS_CALL _Yarn< _Elem >::~_Yarn ( )
inline
3770  { // destroy the object
3771  _Tidy();
3772  }
void __CLR_OR_THIS_CALL _Tidy()
Definition: xutility:3795

Member Function Documentation

template<class _Elem>
const _Elem* __CLR_OR_THIS_CALL _Yarn< _Elem >::_C_str ( ) const
inline
3790  { // return NTBS
3791  return (_Myptr != 0 ? _Myptr : &_Nul);
3792  }
_Elem _Nul
Definition: xutility:3810
_Elem * _Myptr
Definition: xutility:3809
template<class _Elem>
bool __CLR_OR_THIS_CALL _Yarn< _Elem >::_Empty ( ) const
inline
3785  { // test if empty string
3786  return (_Myptr == 0);
3787  }
_Elem * _Myptr
Definition: xutility:3809
template<class _Elem>
void __CLR_OR_THIS_CALL _Yarn< _Elem >::_Tidy ( )
inlineprivate
3796  { // discard any string
3797  if (_Myptr != 0)
3798 
3799  #ifdef _DEBUG
3800  _free_dbg(_Myptr, _CRT_BLOCK);
3801 
3802  #else /* _DEBUG */
3803  _CSTD free(_Myptr);
3804  #endif /* _DEBUG */
3805 
3806  _Myptr = 0;
3807  }
_Elem * _Myptr
Definition: xutility:3809
#define _CSTD
Definition: yvals.h:570
template<class _Elem>
const _Elem* __CLR_OR_THIS_CALL _Yarn< _Elem >::c_str ( ) const
inline
3780  { // return NTBS
3781  return (_Myptr != 0 ? _Myptr : &_Nul);
3782  }
_Elem _Nul
Definition: xutility:3810
_Elem * _Myptr
Definition: xutility:3809
template<class _Elem>
bool __CLR_OR_THIS_CALL _Yarn< _Elem >::empty ( ) const
inline
3775  { // test if empty string
3776  return (_Myptr == 0);
3777  }
_Elem * _Myptr
Definition: xutility:3809
template<class _Elem>
_Myt& __CLR_OR_THIS_CALL _Yarn< _Elem >::operator= ( const _Myt _Right)
inline
3736  { // assign from _Yarn
3737  return (*this = _Right._Myptr);
3738  }
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<class _Elem>
_Myt& __CLR_OR_THIS_CALL _Yarn< _Elem >::operator= ( const _Elem *  _Right)
inline
3741  { // assign from NTBS
3742  if (_Myptr != _Right)
3743  { // new value, discard old and copy new
3744  _Tidy();
3745 
3746  if (_Right != 0)
3747  { // new is not empty, copy it
3748  const _Elem *_Ptr = _Right;
3749  while (*_Ptr != (_Elem)0)
3750  ++_Ptr;
3751  size_t _Count = ((const char *)++_Ptr - (const char *)_Right);
3752 
3753  #ifdef _DEBUG
3754  _Myptr = (_Elem *)_malloc_dbg(_Count, _CRT_BLOCK,
3755  __FILE__, __LINE__);
3756 
3757  #else /* _DEBUG */
3758  _Myptr = (_Elem *)_CSTD malloc(_Count);
3759  #endif /* _DEBUG */
3760 
3761  if (_Myptr != 0)
3762  _CSTD memcpy(_Myptr, _Right, _Count);
3763  }
3764  }
3765 
3766  return (*this);
3767  }
unsigned int _Count
Definition: xcomplex:668
void __CLR_OR_THIS_CALL _Tidy()
Definition: xutility:3795
_Elem * _Myptr
Definition: xutility:3809
#define _CSTD
Definition: yvals.h:570
constexpr const _Ty &() _Right
Definition: algorithm:3591

Member Data Documentation

template<class _Elem>
_Elem* _Yarn< _Elem >::_Myptr
private
template<class _Elem>
_Elem _Yarn< _Elem >::_Nul
private

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