home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 23 / IOPROG_23.ISO / SOFT / VFORM.ZIP / Samples / vfTest / person2.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-10-10  |  2.2 KB  |  80 lines

  1. // -------------------------------------------------------------------------
  2. // Copyright @ 1997 TCK Software, Incorporated
  3. // All Rights Reserved
  4. // -------------------------------------------------------------------------
  5.  
  6. #include "stdafx.h"
  7. #include <io.h>
  8. #include <errno.h>
  9.  
  10. #include "Person2.h"
  11.  
  12. // IMPLEMENT_DYNAMIC( CPerson2, CObject )
  13. // IMPLEMENT_DYNAMIC( CPerson2DB, CObject )
  14.  
  15.  
  16. // -------------------------------------------------------------------------
  17. // -------------------------------------------------------------------------
  18. // CPerson2 Class
  19. // -------------------------------------------------------------------------
  20. // -------------------------------------------------------------------------
  21.  
  22. // -------------------------------------------------------------------------
  23. // CPerson2 Constructor
  24. // -------------------------------------------------------------------------
  25. CPerson2::CPerson2()
  26. {
  27.     Clear();
  28.     m_deleted = 'N';
  29. }
  30.  
  31. // -------------------------------------------------------------------------
  32. // CPerson2 Destructor
  33. // -------------------------------------------------------------------------
  34. CPerson2::~CPerson2()
  35. {
  36. }
  37.  
  38.  
  39. // -------------------------------------------------------------------------
  40. // CPerson2 copy constructor
  41. // -------------------------------------------------------------------------
  42. CPerson2::CPerson2(CPerson2& x)
  43. {
  44.     *this = x;
  45. }
  46.  
  47. // -------------------------------------------------------------------------
  48. // CPerson2 overloaded assigment
  49. // -------------------------------------------------------------------------
  50. CPerson2& CPerson2::operator=(CPerson2& x)
  51. {
  52.     int i;
  53.  
  54.     Clear();
  55.  
  56.     _tcscpy(m_name,        x.m_name);
  57.     _tcscpy(m_note,        x.m_note);
  58.     for(i=0; i < PERS2_MAX_PHONES; i++)
  59.     {
  60.         _tcscpy(m_phones[i].m_phoneDesc,    x.m_phones[i].m_phoneDesc);
  61.         _tcscpy(m_phones[i].m_phone,        x.m_phones[i].m_phone);
  62.     }
  63.  
  64.     m_deleted = x.m_deleted;
  65.  
  66.     return *this;
  67. }
  68.  
  69. // -------------------------------------------------------------------------
  70. // Wipe everything out except carrage return, line feed
  71. // -------------------------------------------------------------------------
  72. void CPerson2::Clear()
  73. {
  74.     memset(this, 0, sizeof(*this));
  75.     m_carriage_return = '\r';
  76.     m_newline = '\n';
  77. }
  78.  
  79.  
  80.