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
 
_Ret_z_ const _Elem *__CLR_OR_THIS_CALL c_str () const
 
bool __CLR_OR_THIS_CALL _Empty () const
 
_Ret_z_ 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
3602  : _Myptr(0), _Nul(0)
3603  { // default construct
3604  }
_Elem _Nul
Definition: xutility:3693
_Elem * _Myptr
Definition: xutility:3692
template<class _Elem>
__CLR_OR_THIS_CALL _Yarn< _Elem >::_Yarn ( const _Myt _Right)
inline
3607  : _Myptr(0), _Nul(0)
3608  { // construct from _Yarn
3609  *this = _Right;
3610  }
_Elem _Nul
Definition: xutility:3693
_Elem * _Myptr
Definition: xutility:3692
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem>
__CLR_OR_THIS_CALL _Yarn< _Elem >::_Yarn ( const _Elem *  _Right)
inline
3613  : _Myptr(0), _Nul(0)
3614  { // construct from NTBS
3615  *this = _Right;
3616  }
_Elem _Nul
Definition: xutility:3693
_Elem * _Myptr
Definition: xutility:3692
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem>
__CLR_OR_THIS_CALL _Yarn< _Elem >::~_Yarn ( )
inline
3653  { // destroy the object
3654  _Tidy();
3655  }
void __CLR_OR_THIS_CALL _Tidy()
Definition: xutility:3678

Member Function Documentation

template<class _Elem>
_Ret_z_ const _Elem* __CLR_OR_THIS_CALL _Yarn< _Elem >::_C_str ( ) const
inline
3673  { // return NTBS
3674  return (_Myptr != 0 ? _Myptr : &_Nul);
3675  }
_Elem _Nul
Definition: xutility:3693
_Elem * _Myptr
Definition: xutility:3692
template<class _Elem>
bool __CLR_OR_THIS_CALL _Yarn< _Elem >::_Empty ( ) const
inline
3668  { // test if empty string
3669  return (_Myptr == 0);
3670  }
_Elem * _Myptr
Definition: xutility:3692
template<class _Elem>
void __CLR_OR_THIS_CALL _Yarn< _Elem >::_Tidy ( )
inlineprivate
3679  { // discard any string
3680  if (_Myptr != 0)
3681 
3682  #ifdef _DEBUG
3684 
3685  #else /* _DEBUG */
3686  _CSTD free(_Myptr);
3687  #endif /* _DEBUG */
3688 
3689  _Myptr = 0;
3690  }
_ACRTIMP void __cdecl free(_Pre_maybenull_ _Post_invalid_ void *_Block)
#define _free_dbg(p, t)
Definition: crtdbg.h:246
#define _CRT_BLOCK
Definition: crtdbg.h:95
_Elem * _Myptr
Definition: xutility:3692
#define _CSTD
Definition: yvals.h:570
template<class _Elem>
_Ret_z_ const _Elem* __CLR_OR_THIS_CALL _Yarn< _Elem >::c_str ( ) const
inline
3663  { // return NTBS
3664  return (_Myptr != 0 ? _Myptr : &_Nul);
3665  }
_Elem _Nul
Definition: xutility:3693
_Elem * _Myptr
Definition: xutility:3692
template<class _Elem>
bool __CLR_OR_THIS_CALL _Yarn< _Elem >::empty ( ) const
inline
3658  { // test if empty string
3659  return (_Myptr == 0);
3660  }
_Elem * _Myptr
Definition: xutility:3692
template<class _Elem>
_Myt& __CLR_OR_THIS_CALL _Yarn< _Elem >::operator= ( const _Myt _Right)
inline
3619  { // assign from _Yarn
3620  return (*this = _Right._Myptr);
3621  }
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem>
_Myt& __CLR_OR_THIS_CALL _Yarn< _Elem >::operator= ( const _Elem *  _Right)
inline
3624  { // assign from NTBS
3625  if (_Myptr != _Right)
3626  { // new value, discard old and copy new
3627  _Tidy();
3628 
3629  if (_Right != 0)
3630  { // new is not empty, copy it
3631  const _Elem *_Ptr = _Right;
3632  while (*_Ptr != (_Elem)0)
3633  ++_Ptr;
3634  size_t _Count = ((const char *)++_Ptr - (const char *)_Right);
3635 
3636  #ifdef _DEBUG
3637  _Myptr = (_Elem *)_malloc_dbg(_Count, _CRT_BLOCK,
3638  __FILE__, __LINE__);
3639 
3640  #else /* _DEBUG */
3641  _Myptr = (_Elem *)_CSTD malloc(_Count);
3642  #endif /* _DEBUG */
3643 
3644  if (_Myptr != 0)
3645  _CSTD memcpy(_Myptr, _Right, _Count);
3646  }
3647  }
3648 
3649  return (*this);
3650  }
void __CLR_OR_THIS_CALL _Tidy()
Definition: xutility:3678
#define _CRT_BLOCK
Definition: crtdbg.h:95
memcpy(_Destination, _Source, _SourceSize)
_Diff _Count
Definition: algorithm:1941
_Elem * _Myptr
Definition: xutility:3692
#define _CSTD
Definition: yvals.h:570
#define _malloc_dbg(s, t, f, l)
Definition: crtdbg.h:247
constexpr const _Ty &() _Right
Definition: algorithm:3723

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: