home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / mfc / include / afx.inl < prev    next >
Text File  |  1998-06-16  |  19KB  |  434 lines

  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1998 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Microsoft Foundation Classes Reference and related
  7. // electronic documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Microsoft Foundation Classes product.
  10.  
  11. // Inlines for AFX.H
  12.  
  13. #ifdef _AFX_INLINE
  14.  
  15. // CObject
  16. _AFX_INLINE CObject::CObject()
  17.     { }
  18. _AFX_INLINE CObject::~CObject()
  19.     { }
  20. _AFX_INLINE void CObject::Serialize(CArchive&)
  21.     { /* CObject does not serialize anything by default */ }
  22. _AFX_INLINE void* PASCAL CObject::operator new(size_t, void* p)
  23.     { return p; }
  24. #ifndef _DEBUG
  25. // _DEBUG versions in afxmem.cpp
  26. _AFX_INLINE void PASCAL CObject::operator delete(void* p)
  27.     { ::operator delete(p); }
  28. #if _MSC_VER >= 1200
  29. _AFX_INLINE void PASCAL CObject::operator delete(void* p, void*)
  30.     { ::operator delete(p); }
  31. #endif
  32. _AFX_INLINE void* PASCAL CObject::operator new(size_t nSize)
  33.     { return ::operator new(nSize); }
  34. // _DEBUG versions in objcore.cpp
  35. #ifdef _AFXDLL
  36. _AFX_INLINE void CObject::AssertValid() const
  37.     { /* no asserts in release builds */ }
  38. _AFX_INLINE void CObject::Dump(CDumpContext&) const
  39.     { /* no dumping in release builds */ }
  40. #endif //_AFXDLL
  41. #endif //!_DEBUG
  42. _AFX_INLINE const CObject* AFX_CDECL AfxDynamicDownCast(CRuntimeClass* pClass, const CObject* pObject)
  43.     { return (const CObject*)AfxDynamicDownCast(pClass, (CObject*)pObject); }
  44. #ifdef _DEBUG
  45. _AFX_INLINE const CObject* AFX_CDECL AfxStaticDownCast(CRuntimeClass* pClass, const CObject* pObject)
  46.     { return (const CObject*)AfxStaticDownCast(pClass, (CObject*)pObject); }
  47. #endif
  48.  
  49. // exceptions
  50. _AFX_INLINE CException::~CException()
  51.     { }
  52. _AFX_INLINE CSimpleException::CSimpleException()
  53.     { m_bInitialized = FALSE; m_bLoaded = FALSE; }
  54. _AFX_INLINE CSimpleException::CSimpleException(BOOL bAutoDelete)
  55.     : CException(bAutoDelete) { m_bInitialized = FALSE; m_bLoaded = FALSE; }
  56. #if !defined(_AFX_CORE_IMPL) || !defined(_AFXDLL) || defined(_DEBUG)
  57. _AFX_INLINE CSimpleException::~CSimpleException()
  58.     { }
  59. #endif
  60.  
  61. _AFX_INLINE CMemoryException::CMemoryException()
  62.     : CSimpleException() { }
  63. _AFX_INLINE CMemoryException::CMemoryException(BOOL bAutoDelete, UINT nResourceID)
  64.     : CSimpleException(bAutoDelete) { m_nResourceID = nResourceID; }
  65. _AFX_INLINE CMemoryException::~CMemoryException()
  66.     { }
  67. _AFX_INLINE CNotSupportedException::CNotSupportedException()
  68.     : CSimpleException() { }
  69. _AFX_INLINE CNotSupportedException::CNotSupportedException(BOOL bAutoDelete, UINT nResourceID)
  70.     : CSimpleException(bAutoDelete) { m_nResourceID = nResourceID; }
  71. _AFX_INLINE CNotSupportedException::~CNotSupportedException()
  72.     { }
  73. _AFX_INLINE CArchiveException::CArchiveException(int cause,
  74.     LPCTSTR lpszFileName /* = NULL */)
  75.     { m_cause = cause; m_strFileName = lpszFileName; }
  76. _AFX_INLINE CArchiveException::~CArchiveException()
  77.     { }
  78. _AFX_INLINE CFileException::CFileException(int cause, LONG lOsError,
  79.     LPCTSTR pstrFileName /* = NULL */)
  80.     { m_cause = cause; m_lOsError = lOsError; m_strFileName = pstrFileName; }
  81. _AFX_INLINE CFileException::~CFileException()
  82.     { }
  83.  
  84. // CFile
  85. _AFX_INLINE CFile::operator HFILE() const
  86.     { return m_hFile; }
  87. _AFX_INLINE DWORD CFile::ReadHuge(void* lpBuffer, DWORD dwCount)
  88.     { return (DWORD)Read(lpBuffer, (UINT)dwCount); }
  89. _AFX_INLINE void CFile::WriteHuge(const void* lpBuffer, DWORD dwCount)
  90.     { Write(lpBuffer, (UINT)dwCount); }
  91. _AFX_INLINE DWORD CFile::SeekToEnd()
  92.     { return Seek(0, CFile::end); }
  93. _AFX_INLINE void CFile::SeekToBegin()
  94.     { Seek(0, CFile::begin); }
  95. _AFX_INLINE void CFile::SetFilePath(LPCTSTR lpszNewName)
  96. {
  97.     ASSERT_VALID(this);
  98.     ASSERT(AfxIsValidString(lpszNewName));
  99.     m_strFileName = lpszNewName;
  100. }
  101.  
  102. // CFileFind
  103. _AFX_INLINE BOOL CFileFind::IsReadOnly() const
  104.     { return MatchesMask(FILE_ATTRIBUTE_READONLY); }
  105. _AFX_INLINE BOOL CFileFind::IsDirectory() const
  106.     { return MatchesMask(FILE_ATTRIBUTE_DIRECTORY); }
  107. _AFX_INLINE BOOL CFileFind::IsCompressed() const
  108.     { return MatchesMask(FILE_ATTRIBUTE_COMPRESSED); }
  109. _AFX_INLINE BOOL CFileFind::IsSystem() const
  110.     { return MatchesMask(FILE_ATTRIBUTE_SYSTEM); }
  111. _AFX_INLINE BOOL CFileFind::IsHidden() const
  112.     { return MatchesMask(FILE_ATTRIBUTE_HIDDEN); }
  113. _AFX_INLINE BOOL CFileFind::IsTemporary() const
  114.     { return MatchesMask(FILE_ATTRIBUTE_TEMPORARY); }
  115. _AFX_INLINE BOOL CFileFind::IsNormal() const
  116.     { return MatchesMask(FILE_ATTRIBUTE_NORMAL); }
  117. _AFX_INLINE BOOL CFileFind::IsArchived() const
  118.     { return MatchesMask(FILE_ATTRIBUTE_ARCHIVE); }
  119.  
  120. // CString
  121. _AFX_INLINE CStringData* CString::GetData() const
  122.     { ASSERT(m_pchData != NULL); return ((CStringData*)m_pchData)-1; }
  123. _AFX_INLINE void CString::Init()
  124.     { m_pchData = afxEmptyString.m_pchData; }
  125. #ifndef _AFXDLL
  126. _AFX_INLINE CString::CString()
  127.     { m_pchData = afxEmptyString.m_pchData; }
  128. #endif
  129. _AFX_INLINE CString::CString(const unsigned char* lpsz)
  130.     { Init(); *this = (LPCSTR)lpsz; }
  131. _AFX_INLINE const CString& CString::operator=(const unsigned char* lpsz)
  132.     { *this = (LPCSTR)lpsz; return *this; }
  133. #ifdef _UNICODE
  134. _AFX_INLINE const CString& CString::operator+=(char ch)
  135.     { *this += (TCHAR)ch; return *this; }
  136. _AFX_INLINE const CString& CString::operator=(char ch)
  137.     { *this = (TCHAR)ch; return *this; }
  138. _AFX_INLINE CString AFXAPI operator+(const CString& string, char ch)
  139.     { return string + (TCHAR)ch; }
  140. _AFX_INLINE CString AFXAPI operator+(char ch, const CString& string)
  141.     { return (TCHAR)ch + string; }
  142. #endif
  143.  
  144. _AFX_INLINE int CString::GetLength() const
  145.     { return GetData()->nDataLength; }
  146. _AFX_INLINE int CString::GetAllocLength() const
  147.     { return GetData()->nAllocLength; }
  148. _AFX_INLINE BOOL CString::IsEmpty() const
  149.     { return GetData()->nDataLength == 0; }
  150. _AFX_INLINE CString::operator LPCTSTR() const
  151.     { return m_pchData; }
  152. _AFX_INLINE int PASCAL CString::SafeStrlen(LPCTSTR lpsz)
  153.     { return (lpsz == NULL) ? 0 : lstrlen(lpsz); }
  154.  
  155. // CString support (windows specific)
  156. _AFX_INLINE int CString::Compare(LPCTSTR lpsz) const
  157.     { ASSERT(AfxIsValidString(lpsz)); return _tcscmp(m_pchData, lpsz); }    // MBCS/Unicode aware
  158. _AFX_INLINE int CString::CompareNoCase(LPCTSTR lpsz) const
  159.     { ASSERT(AfxIsValidString(lpsz)); return _tcsicmp(m_pchData, lpsz); }   // MBCS/Unicode aware
  160. // CString::Collate is often slower than Compare but is MBSC/Unicode
  161. //  aware as well as locale-sensitive with respect to sort order.
  162. _AFX_INLINE int CString::Collate(LPCTSTR lpsz) const
  163.     { ASSERT(AfxIsValidString(lpsz)); return _tcscoll(m_pchData, lpsz); }   // locale sensitive
  164. _AFX_INLINE int CString::CollateNoCase(LPCTSTR lpsz) const
  165.     { ASSERT(AfxIsValidString(lpsz)); return _tcsicoll(m_pchData, lpsz); }   // locale sensitive
  166.  
  167. _AFX_INLINE TCHAR CString::GetAt(int nIndex) const
  168. {
  169.     ASSERT(nIndex >= 0);
  170.     ASSERT(nIndex < GetData()->nDataLength);
  171.     return m_pchData[nIndex];
  172. }
  173. _AFX_INLINE TCHAR CString::operator[](int nIndex) const
  174. {
  175.     // same as GetAt
  176.     ASSERT(nIndex >= 0);
  177.     ASSERT(nIndex < GetData()->nDataLength);
  178.     return m_pchData[nIndex];
  179. }
  180. _AFX_INLINE bool AFXAPI operator==(const CString& s1, const CString& s2)
  181.     { return s1.Compare(s2) == 0; }
  182. _AFX_INLINE bool AFXAPI operator==(const CString& s1, LPCTSTR s2)
  183.     { return s1.Compare(s2) == 0; }
  184. _AFX_INLINE bool AFXAPI operator==(LPCTSTR s1, const CString& s2)
  185.     { return s2.Compare(s1) == 0; }
  186. _AFX_INLINE bool AFXAPI operator!=(const CString& s1, const CString& s2)
  187.     { return s1.Compare(s2) != 0; }
  188. _AFX_INLINE bool AFXAPI operator!=(const CString& s1, LPCTSTR s2)
  189.     { return s1.Compare(s2) != 0; }
  190. _AFX_INLINE bool AFXAPI operator!=(LPCTSTR s1, const CString& s2)
  191.     { return s2.Compare(s1) != 0; }
  192. _AFX_INLINE bool AFXAPI operator<(const CString& s1, const CString& s2)
  193.     { return s1.Compare(s2) < 0; }
  194. _AFX_INLINE bool AFXAPI operator<(const CString& s1, LPCTSTR s2)
  195.     { return s1.Compare(s2) < 0; }
  196. _AFX_INLINE bool AFXAPI operator<(LPCTSTR s1, const CString& s2)
  197.     { return s2.Compare(s1) > 0; }
  198. _AFX_INLINE bool AFXAPI operator>(const CString& s1, const CString& s2)
  199.     { return s1.Compare(s2) > 0; }
  200. _AFX_INLINE bool AFXAPI operator>(const CString& s1, LPCTSTR s2)
  201.     { return s1.Compare(s2) > 0; }
  202. _AFX_INLINE bool AFXAPI operator>(LPCTSTR s1, const CString& s2)
  203.     { return s2.Compare(s1) < 0; }
  204. _AFX_INLINE bool AFXAPI operator<=(const CString& s1, const CString& s2)
  205.     { return s1.Compare(s2) <= 0; }
  206. _AFX_INLINE bool AFXAPI operator<=(const CString& s1, LPCTSTR s2)
  207.     { return s1.Compare(s2) <= 0; }
  208. _AFX_INLINE bool AFXAPI operator<=(LPCTSTR s1, const CString& s2)
  209.     { return s2.Compare(s1) >= 0; }
  210. _AFX_INLINE bool AFXAPI operator>=(const CString& s1, const CString& s2)
  211.     { return s1.Compare(s2) >= 0; }
  212. _AFX_INLINE bool AFXAPI operator>=(const CString& s1, LPCTSTR s2)
  213.     { return s1.Compare(s2) >= 0; }
  214. _AFX_INLINE bool AFXAPI operator>=(LPCTSTR s1, const CString& s2)
  215.     { return s2.Compare(s1) <= 0; }
  216.  
  217. // CTime and CTimeSpan
  218. #if !defined(_AFX_CORE_IMPL) || !defined(_AFXDLL) || defined(_DEBUG)
  219. _AFX_INLINE CTimeSpan::CTimeSpan()
  220.     { }
  221. #endif
  222. _AFX_INLINE CTimeSpan::CTimeSpan(time_t time)
  223.     { m_timeSpan = time; }
  224. _AFX_INLINE CTimeSpan::CTimeSpan(LONG lDays, int nHours, int nMins, int nSecs)
  225.     { m_timeSpan = nSecs + 60* (nMins + 60* (nHours + 24* lDays)); }
  226. _AFX_INLINE CTimeSpan::CTimeSpan(const CTimeSpan& timeSpanSrc)
  227.     { m_timeSpan = timeSpanSrc.m_timeSpan; }
  228. _AFX_INLINE const CTimeSpan& CTimeSpan::operator=(const CTimeSpan& timeSpanSrc)
  229.     { m_timeSpan = timeSpanSrc.m_timeSpan; return *this; }
  230. _AFX_INLINE LONG CTimeSpan::GetDays() const
  231.     { return m_timeSpan / (24*3600L); }
  232. _AFX_INLINE LONG CTimeSpan::GetTotalHours() const
  233.     { return m_timeSpan/3600; }
  234. _AFX_INLINE int CTimeSpan::GetHours() const
  235.     { return (int)(GetTotalHours() - GetDays()*24); }
  236. _AFX_INLINE LONG CTimeSpan::GetTotalMinutes() const
  237.     { return m_timeSpan/60; }
  238. _AFX_INLINE int CTimeSpan::GetMinutes() const
  239.     { return (int)(GetTotalMinutes() - GetTotalHours()*60); }
  240. _AFX_INLINE LONG CTimeSpan::GetTotalSeconds() const
  241.     { return m_timeSpan; }
  242. _AFX_INLINE int CTimeSpan::GetSeconds() const
  243.     { return (int)(GetTotalSeconds() - GetTotalMinutes()*60); }
  244. _AFX_INLINE CTimeSpan CTimeSpan::operator-(CTimeSpan timeSpan) const
  245.     { return CTimeSpan(m_timeSpan - timeSpan.m_timeSpan); }
  246. _AFX_INLINE CTimeSpan CTimeSpan::operator+(CTimeSpan timeSpan) const
  247.     { return CTimeSpan(m_timeSpan + timeSpan.m_timeSpan); }
  248. _AFX_INLINE const CTimeSpan& CTimeSpan::operator+=(CTimeSpan timeSpan)
  249.     { m_timeSpan += timeSpan.m_timeSpan; return *this; }
  250. _AFX_INLINE const CTimeSpan& CTimeSpan::operator-=(CTimeSpan timeSpan)
  251.     { m_timeSpan -= timeSpan.m_timeSpan; return *this; }
  252. _AFX_INLINE BOOL CTimeSpan::operator==(CTimeSpan timeSpan) const
  253.     { return m_timeSpan == timeSpan.m_timeSpan; }
  254. _AFX_INLINE BOOL CTimeSpan::operator!=(CTimeSpan timeSpan) const
  255.     { return m_timeSpan != timeSpan.m_timeSpan; }
  256. _AFX_INLINE BOOL CTimeSpan::operator<(CTimeSpan timeSpan) const
  257.     { return m_timeSpan < timeSpan.m_timeSpan; }
  258. _AFX_INLINE BOOL CTimeSpan::operator>(CTimeSpan timeSpan) const
  259.     { return m_timeSpan > timeSpan.m_timeSpan; }
  260. _AFX_INLINE BOOL CTimeSpan::operator<=(CTimeSpan timeSpan) const
  261.     { return m_timeSpan <= timeSpan.m_timeSpan; }
  262. _AFX_INLINE BOOL CTimeSpan::operator>=(CTimeSpan timeSpan) const
  263.     { return m_timeSpan >= timeSpan.m_timeSpan; }
  264.  
  265.  
  266. #if !defined(_AFX_CORE_IMPL) || !defined(_AFXDLL) || defined(_DEBUG)
  267. _AFX_INLINE CTime::CTime()
  268.     { }
  269. #endif
  270. _AFX_INLINE CTime::CTime(time_t time)
  271.     { m_time = time; }
  272. #if !defined(_AFX_CORE_IMPL) || !defined(_AFXDLL) || defined(_DEBUG)
  273. _AFX_INLINE CTime::CTime(const CTime& timeSrc)
  274.     { m_time = timeSrc.m_time; }
  275. #endif
  276. _AFX_INLINE const CTime& CTime::operator=(const CTime& timeSrc)
  277.     { m_time = timeSrc.m_time; return *this; }
  278. _AFX_INLINE const CTime& CTime::operator=(time_t t)
  279.     { m_time = t; return *this; }
  280. _AFX_INLINE time_t CTime::GetTime() const
  281.     { return m_time; }
  282. _AFX_INLINE int CTime::GetYear() const
  283.     { return (GetLocalTm(NULL)->tm_year) + 1900; }
  284. _AFX_INLINE int CTime::GetMonth() const
  285.     { return GetLocalTm(NULL)->tm_mon + 1; }
  286. _AFX_INLINE int CTime::GetDay() const
  287.     { return GetLocalTm(NULL)->tm_mday; }
  288. _AFX_INLINE int CTime::GetHour() const
  289.     { return GetLocalTm(NULL)->tm_hour; }
  290. _AFX_INLINE int CTime::GetMinute() const
  291.     { return GetLocalTm(NULL)->tm_min; }
  292. _AFX_INLINE int CTime::GetSecond() const
  293.     { return GetLocalTm(NULL)->tm_sec; }
  294. _AFX_INLINE int CTime::GetDayOfWeek() const
  295.     { return GetLocalTm(NULL)->tm_wday + 1; }
  296. _AFX_INLINE CTimeSpan CTime::operator-(CTime time) const
  297.     { return CTimeSpan(m_time - time.m_time); }
  298. _AFX_INLINE CTime CTime::operator-(CTimeSpan timeSpan) const
  299.     { return CTime(m_time - timeSpan.m_timeSpan); }
  300. _AFX_INLINE CTime CTime::operator+(CTimeSpan timeSpan) const
  301.     { return CTime(m_time + timeSpan.m_timeSpan); }
  302. _AFX_INLINE const CTime& CTime::operator+=(CTimeSpan timeSpan)
  303.     { m_time += timeSpan.m_timeSpan; return *this; }
  304. _AFX_INLINE const CTime& CTime::operator-=(CTimeSpan timeSpan)
  305.     { m_time -= timeSpan.m_timeSpan; return *this; }
  306. _AFX_INLINE BOOL CTime::operator==(CTime time) const
  307.     { return m_time == time.m_time; }
  308. _AFX_INLINE BOOL CTime::operator!=(CTime time) const
  309.     { return m_time != time.m_time; }
  310. _AFX_INLINE BOOL CTime::operator<(CTime time) const
  311.     { return m_time < time.m_time; }
  312. _AFX_INLINE BOOL CTime::operator>(CTime time) const
  313.     { return m_time > time.m_time; }
  314. _AFX_INLINE BOOL CTime::operator<=(CTime time) const
  315.     { return m_time <= time.m_time; }
  316. _AFX_INLINE BOOL CTime::operator>=(CTime time) const
  317.     { return m_time >= time.m_time; }
  318.  
  319.  
  320. // CArchive
  321. _AFX_INLINE BOOL CArchive::IsLoading() const
  322.     { return (m_nMode & CArchive::load) != 0; }
  323. _AFX_INLINE BOOL CArchive::IsStoring() const
  324.     { return (m_nMode & CArchive::load) == 0; }
  325. _AFX_INLINE BOOL CArchive::IsByteSwapping() const
  326.     { return (m_nMode & CArchive::bNoByteSwap) == 0; }
  327. _AFX_INLINE BOOL CArchive::IsBufferEmpty() const
  328.     { return m_lpBufCur == m_lpBufMax; }
  329. _AFX_INLINE CFile* CArchive::GetFile() const
  330.     { return m_pFile; }
  331. _AFX_INLINE void CArchive::SetObjectSchema(UINT nSchema)
  332.     { m_nObjectSchema = nSchema; }
  333. _AFX_INLINE void CArchive::SetStoreParams(UINT nHashSize, UINT nBlockSize)
  334. {
  335.     ASSERT(IsStoring());
  336.     ASSERT(m_pStoreMap == NULL);    // must be before first object written
  337.     m_nHashSize = nHashSize;
  338.     m_nGrowSize = nBlockSize;
  339. }
  340. _AFX_INLINE void CArchive::SetLoadParams(UINT nGrowBy)
  341. {
  342.     ASSERT(IsLoading());
  343.     ASSERT(m_pLoadArray == NULL);   // must be before first object read
  344.     m_nGrowSize = nGrowBy;
  345. }
  346. _AFX_INLINE CArchive& CArchive::operator<<(int i)
  347.     { return CArchive::operator<<((LONG)i); }
  348. _AFX_INLINE CArchive& CArchive::operator<<(unsigned u)
  349.     { return CArchive::operator<<((LONG)u); }
  350. _AFX_INLINE CArchive& CArchive::operator<<(short w)
  351.     { return CArchive::operator<<((WORD)w); }
  352. _AFX_INLINE CArchive& CArchive::operator<<(char ch)
  353.     { return CArchive::operator<<((BYTE)ch); }
  354. _AFX_INLINE CArchive& CArchive::operator<<(BYTE by)
  355.     { if (m_lpBufCur + sizeof(BYTE) > m_lpBufMax) Flush();
  356.         *(UNALIGNED BYTE*)m_lpBufCur = by; m_lpBufCur += sizeof(BYTE); return *this; }
  357. #ifndef _AFX_BYTESWAP
  358. _AFX_INLINE CArchive& CArchive::operator<<(WORD w)
  359.     { if (m_lpBufCur + sizeof(WORD) > m_lpBufMax) Flush();
  360.         *(UNALIGNED WORD*)m_lpBufCur = w; m_lpBufCur += sizeof(WORD); return *this; }
  361. _AFX_INLINE CArchive& CArchive::operator<<(LONG l)
  362.     { if (m_lpBufCur + sizeof(LONG) > m_lpBufMax) Flush();
  363.         *(UNALIGNED LONG*)m_lpBufCur = l; m_lpBufCur += sizeof(LONG); return *this; }
  364. _AFX_INLINE CArchive& CArchive::operator<<(DWORD dw)
  365.     { if (m_lpBufCur + sizeof(DWORD) > m_lpBufMax) Flush();
  366.         *(UNALIGNED DWORD*)m_lpBufCur = dw; m_lpBufCur += sizeof(DWORD); return *this; }
  367. _AFX_INLINE CArchive& CArchive::operator<<(float f)
  368.     { if (m_lpBufCur + sizeof(float) > m_lpBufMax) Flush();
  369.         *(UNALIGNED _AFX_FLOAT*)m_lpBufCur = *(_AFX_FLOAT*)&f; m_lpBufCur += sizeof(float); return *this;
  370.     }
  371. _AFX_INLINE CArchive& CArchive::operator<<(double d)
  372.     { if (m_lpBufCur + sizeof(double) > m_lpBufMax) Flush();
  373.         *(UNALIGNED _AFX_DOUBLE*)m_lpBufCur = *(_AFX_DOUBLE*)&d; m_lpBufCur += sizeof(double); return *this; }
  374. #endif
  375. _AFX_INLINE CArchive& CArchive::operator>>(int& i)
  376.     { return CArchive::operator>>((LONG&)i); }
  377. _AFX_INLINE CArchive& CArchive::operator>>(unsigned& u)
  378.     { return CArchive::operator>>((LONG&)u); }
  379. _AFX_INLINE CArchive& CArchive::operator>>(short& w)
  380.     { return CArchive::operator>>((WORD&)w); }
  381. _AFX_INLINE CArchive& CArchive::operator>>(char& ch)
  382.     { return CArchive::operator>>((BYTE&)ch); }
  383. _AFX_INLINE CArchive& CArchive::operator>>(BYTE& by)
  384.     { if (m_lpBufCur + sizeof(BYTE) > m_lpBufMax)
  385.             FillBuffer(sizeof(BYTE) - (UINT)(m_lpBufMax - m_lpBufCur));
  386.         by = *(UNALIGNED BYTE*)m_lpBufCur; m_lpBufCur += sizeof(BYTE); return *this; }
  387. #ifndef _AFX_BYTESWAP
  388. _AFX_INLINE CArchive& CArchive::operator>>(WORD& w)
  389.     { if (m_lpBufCur + sizeof(WORD) > m_lpBufMax)
  390.             FillBuffer(sizeof(WORD) - (UINT)(m_lpBufMax - m_lpBufCur));
  391.         w = *(UNALIGNED WORD*)m_lpBufCur; m_lpBufCur += sizeof(WORD); return *this; }
  392. _AFX_INLINE CArchive& CArchive::operator>>(DWORD& dw)
  393.     { if (m_lpBufCur + sizeof(DWORD) > m_lpBufMax)
  394.             FillBuffer(sizeof(DWORD) - (UINT)(m_lpBufMax - m_lpBufCur));
  395.         dw = *(UNALIGNED DWORD*)m_lpBufCur; m_lpBufCur += sizeof(DWORD); return *this; }
  396. _AFX_INLINE CArchive& CArchive::operator>>(float& f)
  397.     { if (m_lpBufCur + sizeof(float) > m_lpBufMax)
  398.             FillBuffer(sizeof(float) - (UINT)(m_lpBufMax - m_lpBufCur));
  399.         *(_AFX_FLOAT*)&f = *(UNALIGNED _AFX_FLOAT*)m_lpBufCur; m_lpBufCur += sizeof(float); return *this; }
  400. _AFX_INLINE CArchive& CArchive::operator>>(double& d)
  401.     { if (m_lpBufCur + sizeof(double) > m_lpBufMax)
  402.             FillBuffer(sizeof(double) - (UINT)(m_lpBufMax - m_lpBufCur));
  403.         *(_AFX_DOUBLE*)&d = *(UNALIGNED _AFX_DOUBLE*)m_lpBufCur; m_lpBufCur += sizeof(double); return *this; }
  404. _AFX_INLINE CArchive& CArchive::operator>>(LONG& l)
  405.     { if (m_lpBufCur + sizeof(LONG) > m_lpBufMax)
  406.             FillBuffer(sizeof(LONG) - (UINT)(m_lpBufMax - m_lpBufCur));
  407.         l = *(UNALIGNED LONG*)m_lpBufCur; m_lpBufCur += sizeof(LONG); return *this; }
  408. #endif
  409. _AFX_INLINE CArchive::CArchive(const CArchive& /* arSrc */)
  410.     { }
  411. _AFX_INLINE void CArchive::operator=(const CArchive& /* arSrc */)
  412.     { }
  413. _AFX_INLINE CArchive& AFXAPI operator<<(CArchive& ar, const CObject* pOb)
  414.     { ar.WriteObject(pOb); return ar; }
  415. _AFX_INLINE CArchive& AFXAPI operator>>(CArchive& ar, CObject*& pOb)
  416.     { pOb = ar.ReadObject(NULL); return ar; }
  417. _AFX_INLINE CArchive& AFXAPI operator>>(CArchive& ar, const CObject*& pOb)
  418.     { pOb = ar.ReadObject(NULL); return ar; }
  419.  
  420.  
  421. // CDumpContext
  422. _AFX_INLINE int CDumpContext::GetDepth() const
  423.     { return m_nDepth; }
  424. _AFX_INLINE void CDumpContext::SetDepth(int nNewDepth)
  425.     { m_nDepth = nNewDepth; }
  426. _AFX_INLINE CDumpContext::CDumpContext(const CDumpContext& /* dcSrc */)
  427.     { }
  428. _AFX_INLINE void CDumpContext::operator=(const CDumpContext& /* dcSrc */)
  429.     { }
  430.  
  431. /////////////////////////////////////////////////////////////////////////////
  432.  
  433. #endif //_AFX_INLINE
  434.