// This is a part of the Microsoft Foundation Classes C library.// Copyright (C) 1992-1998 Microsoft Corporation // All rights reserved.//// This source code is only intended as a supplement to the // Microsoft Foundation Classes Reference And Related // Electronic Documentation Provided with The Library.// See Sources for Detailed Information Regarding The // Microsoft Foundation Classes ProducT.
// inline for afx.h
#ifdef _afx_inline
// CObject_AFX_INLINE CObject :: CObject () {} _AFX_INLINE CObject :: ~ CObject () {} _AFX_INLINE void CObject :: Serialize (CArchive &) {/ * CObject does not serialize anything by default * /} _AFX_INLINE void * PASCAL CObject :: Operator new (size_t, void * p) {return p;} #ifndef _debug // _debug version in AFXMEM.CPP_AFX_INLINE VOID PASCAL COBJECT :: Operator Delete (Void * P) {:: Operator delete (p);} #IF _MSC_VER > = 1200_AFX_INLINE void PASCAL CObject :: operator delete (void * p, void *) {:: operator delete (p);} #endif_AFX_INLINE void * PASCAL CObject :: operator new (size_t nSize) {return :: operator new (nSize );} // _DEBUG versions in objcore.cpp # ifdef _AFXDLL_AFX_INLINE void CObject :: AssertValid () const {/ * no asserts in release builds * /} _AFX_INLINE void CObject :: Dump (CDumpContext &) const {/ * no dumping in release builds * /} #endif // _ AFXDLL # endif //! _ DEBUG_AFX_INLINE const CObject * AFX_CDECL AfxDynamicDownCast (CRuntimeClass * pClass, const CObject * pObject) {return (const CObject *) AfxDynamicDownCast (pC lass, (CObject *) pObject);} #ifdef _DEBUG_AFX_INLINE const CObject * AFX_CDECL AfxStaticDownCast (CRuntimeClass * pClass, const CObject * pObject) {return (const CObject *) AfxStaticDownCast (pClass, (CObject *) pObject);} #endif
// exceptions_AFX_INLINE CException :: ~ CException () {} _AFX_INLINE CSimpleException :: CSimpleException () {m_bInitialized = FALSE; m_bLoaded = FALSE;} _AFX_INLINE CSimpleException :: CSimpleException (BOOL bAutoDelete): CException (bAutoDelete) {m_bInitialized = FALSE; m_bLoaded = !! FALSE;} #if defined (_AFX_CORE_IMPL) || defined (_AFXDLL) || defined (_DEBUG) _AFX_INLINE CSimpleException :: ~ CSimpleException () {} #endif_AFX_INLINE CMemoryException :: CMemoryException (): CSimpleException () {} _AFX_INLINE CMemoryException: : CMemoryException (BOOL bAutoDelete, UINT nResourceID): CSimpleException (bAutoDelete) {m_nResourceID = nResourceID;} _AFX_INLINE CMemoryException :: ~ CMemoryException () {} _AFX_INLINE CNotSupportedException :: CNotSupportedException (): CSimpleException () {} _AFX_INLINE CNotSupportedException :: CNotSupportedException (BOOL Bautodelete, uint nresourceid: csimpleexception (bautodelete) {m_nresourceid = nresourceId;} _afx_inline cnotsupportedException :: ~ cNOTSUPPORTEDEXCEPTION () {} _AFX_ INLINE CArchiveException :: CArchiveException (int cause, LPCTSTR lpszFileName / * = NULL * /) {m_cause = cause; m_strFileName = lpszFileName;} _AFX_INLINE CArchiveException :: ~ CArchiveException () {} _AFX_INLINE CFileException :: CFileException (int cause, LONG lOsError, LPCTSTR PSTRFILENAME / * = NULL * /) {m_cause = cause; m_loserror = loserror; m_strfilename = pstrfilename;} _afx_inline cfileException :: ~ cfileException () {}
// CFile_AFX_INLINE CFile :: operator HFILE () const {return m_hFile;} _AFX_INLINE DWORD CFile :: ReadHuge (void * lpBuffer, DWORD dwCount) {return (DWORD) Read (lpBuffer, (UINT) dwCount);} _AFX_INLINE void CFile: : WriteHuge (const void * lpBuffer, DWORD dwCount) {Write (lpBuffer, (UINT) dwCount);} _AFX_INLINE DWORD CFile :: SeekToEnd () {return Seek (0, CFile :: end);} _AFX_INLINE void CFile :: SeekToBegin () {Seek (0, CFile :: begin);} _AFX_INLINE void CFile :: SetFilePath (LPCTSTR lpszNewName) {ASSERT_VALID (this); ASSERT (AfxIsValidString (lpszNewName)); m_strFileName = lpszNewName;} // CFileFind_AFX_INLINE BOOL CFileFind :: IsReadOnly () const {return MatchesMask (FILE_ATTRIBUTE_READONLY);} _AFX_INLINE BOOL CFileFind :: IsDirectory () const {return MatchesMask (FILE_ATTRIBUTE_DIRECTORY);} _AFX_INLINE BOOL CFileFind :: IsCompressed () const {return MatchesMask (FILE_ATTRIBUTE_COMPRESSED);} _AFX_INLINE BOOL CFileFind: : Issystem () const {return matchesmask (file_attribute_system);} _afx_inline bool cfilefind :: iShidden () c onst {return MatchesMask (FILE_ATTRIBUTE_HIDDEN);} _AFX_INLINE BOOL CFileFind :: IsTemporary () const {return MatchesMask (FILE_ATTRIBUTE_TEMPORARY);} _AFX_INLINE BOOL CFileFind :: IsNormal () const {return MatchesMask (FILE_ATTRIBUTE_NORMAL);} _AFX_INLINE BOOL CFileFind :: IsArchived ( ) const {return matchesmask (file_attribute_archive);
// CString_AFX_INLINE CStringData * CString :: GetData () const {ASSERT (m_pchData = NULL!); Return ((CStringData *) m_pchData) -1;} _AFX_INLINE void CString :: Init () {m_pchData = afxEmptyString.m_pchData;} # ifndef _AFXDLL_AFX_INLINE CString :: CString () {m_pchData = afxEmptyString.m_pchData;} #endif_AFX_INLINE CString :: CString (const unsigned char * lpsz) {Init (); * this = (LPCSTR) lpsz;} _AFX_INLINE const CString & CString :: operator = (const unsigned char * lps) {* this = (lpcstr) LPSZ; return * this;} #ifdef _unicode_afx_inline const cstring & cstring :: operator = (char ch) {* this = (tchar) ch; return * this; } _AFX_INLINE const CString & CString :: operator = (char ch) {* this = (TCHAR) ch; return * this;} _AFX_INLINE CString AFXAPI operator (const CString & string, char ch) {return string (TCHAR) ch;} _AFX_INLINE CString AFXAPI operator (char ch, const CString & string) {return (TCHAR) ch string;} #endif_AFX_INLINE int CString :: GetLength () const {return GetData () -> nDataLength;} _AFX_INLINE int CString :: G etAllocLength () const {return GetData () -> nAllocLength;} _AFX_INLINE BOOL CString :: IsEmpty () const {return GetData () -> nDataLength == 0;} _AFX_INLINE CString :: operator LPCTSTR () const {return m_pchData;} _AFX_INLINE INT PASCAL CSTRING :: Safestrlen (LPCTSTR LPSZ) {RETURN (LPSZ == NULL)? 0: lstrlen (lps);
// CString support (windows specific) _AFX_INLINE int CString :: Compare (LPCTSTR lpsz) const {ASSERT (AfxIsValidString (lpsz)); return _tcscmp (m_pchData, lpsz);} // MBCS / Unicode aware_AFX_INLINE int CString :: CompareNoCase (LPCTSTR lpsz) const {ASSERT (AfxIsValidString (lpsz)); return _tcsicmp (m_pchData, lpsz);} // MBCS / Unicode aware // CString :: Collate is often slower than Compare but is MBSC / Unicode // aware as well as locale -sensitive with respect to sort order._AFX_INLINE int CString :: Collate (LPCTSTR lpsz) const {ASSERT (AfxIsValidString (lpsz)); return _tcscoll (m_pchData, lpsz);} // locale sensitive_AFX_INLINE int CString :: CollateNoCase (LPCTSTR lpsz) Const {Assert (AFXISVALIDSTRING (LPSZ)); return_tcsicoll (m_pchdata, lps);} // locale sensitive
_AFX_INLINE TCHAR CSTRING :: Get (int Nindex) const {assert (nindex> = 0); assert (Nindex
S1, Const CSTRING & S2) {RETURN S1.Compare (S2) <= 0;} _afx_inline Bool AFXAPI Operator <= (Const CSTRING & S1, LPCTSTSTSTSTSTST) {Return S1.Compare (S2) <= 0;} _afx_inline Bool AFXAPI Operator <= (LPCTSTSTSTSTSTST.COMPARE (S1)> = 0;} _afx_inline Bool AFXAPI Operator> = (Const CSTRING & S1, Const Cstring & S2) {Return S1.Compare (S2)> = 0; } _AFX_INLINE bool AFXAPI operator> = (const CString & s1, LPCTSTR s2) {return s1.Compare (s2)> = 0;} _AFX_INLINE bool AFXAPI operator> = (LPCTSTR s1, const CString & s2) {return s2.Compare (s1) <= 0;}
! // CTime and CTimeSpan # if defined (_AFX_CORE_IMPL) || defined (_AFXDLL) || defined (_DEBUG) _AFX_INLINE CTimeSpan :: CTimeSpan () {} #endif_AFX_INLINE CTimeSpan :: CTimeSpan (time_t time)! {M_timeSpan = time;} _AFX_INLINE CTimeSpan :: CTimeSpan (LONG lDays, int nHours, int nMins, int nSecs) {m_timeSpan = nSecs 60 * (nMins 60 * (nHours 24 * lDays));} _AFX_INLINE CTimeSpan :: CTimeSpan (const CTimeSpan & timeSpanSrc) {m_timeSpan = timeSpanSrc.m_timeSpan;} _AFX_INLINE const CTimeSpan & CTimeSpan :: operator = (const CTimeSpan & timeSpanSrc) {m_timeSpan = timeSpanSrc.m_timeSpan; return * this;} _AFX_INLINE LONG CTimeSpan :: GetDays () const {return m_timeSpan / (24 * 3600L );} _AFX_INLINE LONG CTimeSpan :: GetTotalHours () const {return m_timeSpan / 3600;} _AFX_INLINE int CTimeSpan :: getHours () const {return (int) (GetTotalHours () - GetDays () * 24);} _AFX_INLINE LONG CTimeSpan: : Gettotalminutes () const {return m_timespan / 60;} _AFX_INLINE INT CTIMESPAN :: getminutes () const {returnus (int) (GettotalMinutes () - Gettotalhou rs () * 60);} _AFX_INLINE LONG CTimeSpan :: GetTotalSeconds () const {return m_timeSpan;} _AFX_INLINE int CTimeSpan :: GetSeconds () const {return (int) (GetTotalSeconds () - GetTotalMinutes () * 60);} _AFX_INLINE CTimeSpan CTimeSpan :: operator- (CTimeSpan timeSpan) const {return CTimeSpan (m_timeSpan - timeSpan.m_timeSpan);} _AFX_INLINE CTimeSpan CTimeSpan :: operator (CTimeSpan timeSpan) const {return CTimeSpan (m_timeSpan timeSpan.m_timeSpan);} _AFX_INLINE const CTimeSpan & CTimeSpan :: Operator = (CTimeSpan Timespan) {m_timespan = timespan.m_timespan; return * this;} _afx_inline const ctimespan & ctimespan :: operator - = (ctimespan timeespan) {m_timespan - =
timeSpan.m_timeSpan; return * this;} _AFX_INLINE BOOL CTimeSpan :: operator == (CTimeSpan timeSpan) const {return m_timeSpan == timeSpan.m_timeSpan;!} _AFX_INLINE BOOL CTimeSpan :: operator = (CTimeSpan timeSpan) const {return m_timeSpan =! timeSpan.m_timeSpan;} _AFX_INLINE BOOL CTimeSpan :: operator <(CTimeSpan timeSpan) const {return m_timeSpan
!! #If defined (_AFX_CORE_IMPL) || defined (_AFXDLL) || defined (_DEBUG) _AFX_INLINE CTime :: CTime () {} #endif_AFX_INLINE CTime :: CTime (time_t time) {m_time = time;}! #If defined ( ! _AFX_CORE_IMPL) || defined (_AFXDLL) || defined (_DEBUG) _AFX_INLINE CTime :: CTime (const CTime & timeSrc) {m_time = timeSrc.m_time;} #endif_AFX_INLINE const CTime & CTime :: operator = (const CTime & timeSrc) {m_time = timeSrc.m_time; return * this;} _AFX_INLINE const CTime & CTime :: operator = (time_t t) {m_time = t; return * this;} _AFX_INLINE time_t CTime :: GetTime () const {return m_time;} _AFX_INLINE int CTime :: GetYear () const {return (getLocaltm (NULL) -> TM_Year) 1900;} _afx_inline int ctime :: getLocaltm (null) -> TM_MON 1;} _afx_inline int ctime :: getday () Const {return GetLocalTm (NULL) -> tm_mday;} _AFX_INLINE int CTime :: GetHour () const {return GetLocalTm (NULL) -> tm_hour;} _AFX_INLINE int CTime :: GetMinute () const {return GetLocalTm (NULL) -> tm_min; } _AFX_INLINE INT CTIME :: GetSecond () const {return g etLocalTm (NULL) -> tm_sec;} _AFX_INLINE int CTime :: GetDayOfWeek () const {return GetLocalTm (NULL) -> tm_wday 1;} _AFX_INLINE CTimeSpan CTime :: operator- (CTime time) const {return CTimeSpan (m_time - time .m_time);} _AFX_INLINE CTime CTime :: operator- (CTimeSpan timeSpan) const {return CTime (m_time - timeSpan.m_timeSpan);} _AFX_INLINE CTime CTime :: operator (CTimeSpan timeSpan) const {return CTime (m_time timeSpan.m_timeSpan) ;} _AFX_INLINE const CTime & CTime :: operator = (CTimeSpan timeSpan) {m_time = timeSpan.m_timeSpan; return * this;} _AFX_INLINE const CTime & CTime :: operator - = (CTimeSpan timeSpan) {m_time - = timeSpan.m_timeSpan;
return * this;} _AFX_INLINE BOOL CTime :: operator == (CTime time) const {return m_time == time.m_time;} _AFX_INLINE BOOL CTime :: operator = (CTime time) const {return m_time = time.m_time!!; } _AFX_INLINE BOOL CTime :: operator <(CTime time) const {return m_time
// CArchive_AFX_INLINE BOOL CArchive :: IsLoading () const {return (m_nMode & CArchive :: load) = 0;!} _AFX_INLINE BOOL CArchive :: IsStoring () const {return (m_nMode & CArchive :: load) == 0;} _AFX_INLINE BOOL CArchive :: IsByteSwapping () const {return (m_nMode & CArchive :: bNoByteSwap) == 0;} _AFX_INLINE BOOL CArchive :: IsBufferEmpty () const {return m_lpBufCur == m_lpBufMax;} _AFX_INLINE CFile * CArchive :: GetFile () const {return m_pFile;} _AFX_INLINE void CArchive :: SetObjectSchema (UINT nSchema) {m_nObjectSchema = nSchema;} _AFX_INLINE void CArchive :: setStoreParams (UINT nHashSize, UINT nBlockSize) {ASSERT (IsStoring ()); ASSERT (m_pStoreMap == NULL) ; // must be before first object written m_nHashSize = nHashSize; m_nGrowSize = nBlockSize;} _ AFX_INLINE void CArchive :: SetLoadParams (UINT nGrowBy) {ASSERT (IsLoading ()); ASSERT (m_pLoadArray == NULL); // must be before first Object read m_ngrowsize = ngrowby;} _ afx_inline care & carchive :: operator << (int i) {return carchive :: operator << ((long) i); } _AFX_INLINE CARCHIVE & CARCHIVE :: Operator << (unsigned u) {return carchive :: operator << ((long) u);} _afx_inline care & carchive :: operator << (short w) {return carchive :: Operator << (Word) W);} _AFX_INLINE CARCHIVE & CARCHIVE :: Operator << (char ch) {return carchive :: operator << (BYTE) CH);} _afx_inline care & carchive :: operator << (Byte by) {ix m_lpBufCur sizeof (BYTE)> m_lpBufMax) Flush (); * (UNALIGNED BYTE *) m_lpBufCur = by; m_lpBufCur = sizeof (BYTE); return * this;} #ifndef _AFX_BYTESWAP_AFX_INLINE CArchive & CArchive :: operator << (WORD w) {IF (M_LPBUFCUR
sizeof (WORD)> m_lpBufMax) Flush (); * (UNALIGNED WORD *) m_lpBufCur = w; m_lpBufCur = sizeof (WORD); return * this;} _AFX_INLINE CArchive & CArchive :: operator << (LONG l) {if (m_lpBufCur sizeof (LONG)> m_lpBufMax) Flush (); * (UNALIGNED LONG *) m_lpBufCur = l; m_lpBufCur = sizeof (LONG); return * this;} _AFX_INLINE CArchive & CArchive :: operator << (DWORD dw) {if ( m_lpBufCur sizeof (DWORD)> m_lpBufMax) Flush (); * (UNALIGNED DWORD *) m_lpBufCur = dw; m_lpBufCur = sizeof (DWORD); return * this;} _AFX_INLINE CArchive & CArchive :: operator << (float f) {if (m_lpBufCur sizeof (float)> m_lpBufMax) Flush (); * (UNALIGNED _AFX_FLOAT *) m_lpBufCur = * (_ AFX_FLOAT *) & f; m_lpBufCur = sizeof (float); return * this;} _AFX_INLINE CArchive & CArchive :: operator << (double d) {if (m_lpBufCur sizeof (double)> m_lpBufMax) Flush (); * (UNALIGNED _AFX_DOUBLE *) m_lpBufCur = * (_ AFX_DOUBLE *) & d; m_lpBufCur = sizeof (double); return * this;} #endif_AFX_INLINE CARCHIVE & CARCHIVE :: Operator >> (INT & I) {RETURN CARCHIVE :: Operator >> ((lon G &) i);} _AFX_INLINE CArchive & CArchive :: operator >> (unsigned & u) {return CArchive :: operator >> ((LONG &) u);} _AFX_INLINE CArchive & CArchive :: operator >> (short & w) {return CArchive: : Operator >> ((Word &) W);} _afx_inline care & carchive :: operator >> (CHAR & Ch) {Return Carchive :: Operator >> (BYTE &) CH);} _afx_inline care & carchive :: operator >> (Byte & BY) {IF (M_LPBUFCUR SIZEOF (BYTE)> M_LPBUFMAX) FillBuffer (SizeOf (Byte) - (M_LPBUFMAX - M_LPBUFCUR); by =
* (UNALIGNED BYTE *) m_lpBufCur; m_lpBufCur = sizeof (BYTE); return * this;} #ifndef _AFX_BYTESWAP_AFX_INLINE CArchive & CArchive :: operator >> (WORD & w) {if (m_lpBufCur sizeof (WORD)> m_lpBufMax) FillBuffer (sizeof (WORD) - (UINT) (m_lpBufMax - m_lpBufCur)); w = * (UNALIGNED WORD *) m_lpBufCur; m_lpBufCur = sizeof (WORD); return * this;} _AFX_INLINE CArchive & CArchive :: operator >> (DWORD & dw) { if (m_lpBufCur sizeof (DWORD)> m_lpBufMax) FillBuffer (sizeof (DWORD) - (UINT) (m_lpBufMax - m_lpBufCur)); dw = * (UNALIGNED DWORD *) m_lpBufCur; m_lpBufCur = sizeof (DWORD); return * this; } _AFX_INLINE CArchive & CArchive :: operator >> (float & f) {if (m_lpBufCur sizeof (float)> m_lpBufMax) FillBuffer (sizeof (float) - (UINT) (m_lpBufMax - m_lpBufCur)); * (_ AFX_FLOAT *) & f = * (UNALIGNED _AFX_FLOAT *) m_lpBufCur; m_lpBufCur = sizeof (float); return * this;} _AFX_INLINE CArchive & CArchive :: operator >> (double & d) {if (m_lpBufCur sizeof (double)> m_lpBufMax) FillBuffer (sizeof (double) - (uint) (M_LPBUFMAX - M_LPBUFC ur)); * (_ AFX_DOUBLE *) & d = * (UNALIGNED _AFX_DOUBLE *) m_lpBufCur; m_lpBufCur = sizeof (double); return * this;} _AFX_INLINE CArchive & CArchive :: operator >> (LONG & l) {if (m_lpBufCur sizeof (LONG)> m_lpBufMax) FillBuffer (sizeof (LONG) - (UINT) (m_lpBufMax - m_lpBufCur)); l = * (UNALIGNED LONG *) m_lpBufCur; m_lpBufCur = sizeof (LONG); return * this;} #endif_AFX_INLINE CArchive: : Carchive (const carchive & / * arsrc * /) {} _afx_inline void care :: operator = (const carchive & / * arsrc * /) {} _afx_inline care & afxapi operator << (CARCHIVE & CARCHIVE & A)
ar, const CObject * pOb) {ar.WriteObject (pOb); return ar;} _AFX_INLINE CArchive & AFXAPI operator >> (CArchive & ar, CObject * & pOb) {pOb = ar.ReadObject (NULL); return ar;} _AFX_INLINE CArchive & AFXAPI operator >> (CArchive & ar, const CObject * & pOb) {pOb = ar.ReadObject (NULL); return ar;} // CDumpContext_AFX_INLINE int CDumpContext :: getDepth () const {return m_nDepth;} _AFX_INLINE void CDumpContext :: SetDepth (int nNewDepth) {m_nDepth = nNewDepth;} _AFX_INLINE CDumpContext :: CDumpContext (const CDumpContext & / * dcSrc * /) {} _AFX_INLINE void CDumpContext :: operator = (const CDumpContext & / * dcSrc * /) {}
/
#ENDIF / / _ AFX_INLINE