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
3337  : _Myptr(0), _Nul(0)
3338  { // default construct
3339  }
_Elem _Nul
Definition: xutility:3427
_Elem * _Myptr
Definition: xutility:3426
template<class _Elem>
__CLR_OR_THIS_CALL _Yarn< _Elem >::_Yarn ( const _Myt _Right)
inline
3342  : _Myptr(0), _Nul(0)
3343  { // construct from _Yarn
3344  *this = _Right;
3345  }
_Elem _Nul
Definition: xutility:3427
_Elem * _Myptr
Definition: xutility:3426
const _Ty & _Right
Definition: algorithm:4087
template<class _Elem>
__CLR_OR_THIS_CALL _Yarn< _Elem >::_Yarn ( const _Elem *  _Right)
inline
3348  : _Myptr(0), _Nul(0)
3349  { // construct from NTBS
3350  *this = _Right;
3351  }
_Elem _Nul
Definition: xutility:3427
_Elem * _Myptr
Definition: xutility:3426
const _Ty & _Right
Definition: algorithm:4087
template<class _Elem>
__CLR_OR_THIS_CALL _Yarn< _Elem >::~_Yarn ( )
inline
3387  { // destroy the object
3388  _Tidy();
3389  }
void __CLR_OR_THIS_CALL _Tidy()
Definition: xutility:3412

Member Function Documentation

template<class _Elem>
const _Elem* __CLR_OR_THIS_CALL _Yarn< _Elem >::_C_str ( ) const
inline
3407  { // return NTBS
3408  return (_Myptr != 0 ? _Myptr : &_Nul);
3409  }
_Elem _Nul
Definition: xutility:3427
_Elem * _Myptr
Definition: xutility:3426
template<class _Elem>
bool __CLR_OR_THIS_CALL _Yarn< _Elem >::_Empty ( ) const
inline
3402  { // test if empty string
3403  return (_Myptr == 0);
3404  }
_Elem * _Myptr
Definition: xutility:3426
template<class _Elem>
void __CLR_OR_THIS_CALL _Yarn< _Elem >::_Tidy ( )
inlineprivate
3413  { // discard any string
3414  if (_Myptr != 0)
3415 
3416  #ifdef _DEBUG
3418 
3419  #else /* _DEBUG */
3420  _CSTD free(_Myptr);
3421  #endif /* _DEBUG */
3422 
3423  _Myptr = 0;
3424  }
_CRTIMP _CRTNOALIAS void __cdecl free(_Pre_maybenull_ _Post_invalid_ void *_Memory)
#define _free_dbg(p, t)
Definition: crtdbg.h:269
#define _CRT_BLOCK
Definition: crtdbg.h:158
_Elem * _Myptr
Definition: xutility:3426
#define _CSTD
Definition: yvals.h:559
template<class _Elem>
const _Elem* __CLR_OR_THIS_CALL _Yarn< _Elem >::c_str ( ) const
inline
3397  { // return NTBS
3398  return (_Myptr != 0 ? _Myptr : &_Nul);
3399  }
_Elem _Nul
Definition: xutility:3427
_Elem * _Myptr
Definition: xutility:3426
template<class _Elem>
bool __CLR_OR_THIS_CALL _Yarn< _Elem >::empty ( ) const
inline
3392  { // test if empty string
3393  return (_Myptr == 0);
3394  }
_Elem * _Myptr
Definition: xutility:3426
template<class _Elem>
_Myt& __CLR_OR_THIS_CALL _Yarn< _Elem >::operator= ( const _Myt _Right)
inline
3354  { // assign from _Yarn
3355  return (*this = _Right._Myptr);
3356  }
const _Ty & _Right
Definition: algorithm:4087
template<class _Elem>
_Myt& __CLR_OR_THIS_CALL _Yarn< _Elem >::operator= ( const _Elem *  _Right)
inline
3359  { // assign from NTBS
3360  if (_Myptr != _Right)
3361  { // new value, discard old and copy new
3362  _Tidy();
3363 
3364  if (_Right != 0)
3365  { // new is not empty, copy it
3366  const _Elem *_Ptr = _Right;
3367  while (*_Ptr != (_Elem)0)
3368  ++_Ptr;
3369  size_t _Count = ((const char *)++_Ptr - (const char *)_Right);
3370 
3371  #ifdef _DEBUG
3372  _Myptr = (_Elem *)_malloc_dbg(_Count, _CRT_BLOCK,
3373  __FILE__, __LINE__);
3374 
3375  #else /* _DEBUG */
3376  _Myptr = (_Elem *)_CSTD malloc(_Count);
3377  #endif /* _DEBUG */
3378 
3379  if (_Myptr != 0)
3380  _CSTD memcpy(_Myptr, _Right, _Count);
3381  }
3382  }
3383  return (*this);
3384  }
void __CLR_OR_THIS_CALL _Tidy()
Definition: xutility:3412
#define _CRT_BLOCK
Definition: crtdbg.h:158
_Diff _Count
Definition: algorithm:1941
_Elem * _Myptr
Definition: xutility:3426
#define _CSTD
Definition: yvals.h:559
#define _malloc_dbg(s, t, f, l)
Definition: crtdbg.h:264
const _Ty & _Right
Definition: algorithm:4087

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: