Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

625 lines
28 KiB

  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1995 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. // Inlines for AFXCOLL.H
  11. #ifdef _AFXCOLL_INLINE
  12. // CObject
  13. _AFX_INLINE CObject::CObject()
  14. { }
  15. _AFX_INLINE CObject::~CObject()
  16. { }
  17. //_AFX_INLINE void CObject::Serialize(CArchive&)
  18. // { /* CObject does not serialize anything by default */ }
  19. _AFX_INLINE void* PASCAL CObject::operator new(size_t, void* p)
  20. { return p; }
  21. #ifndef _DEBUG
  22. // _DEBUG versions in memory.cpp
  23. _AFX_INLINE void PASCAL CObject::operator delete(void* p)
  24. { ::operator delete(p); }
  25. _AFX_INLINE void* PASCAL CObject::operator new(size_t nSize)
  26. { return ::operator new(nSize); }
  27. // _DEBUG versions in objcore.cpp
  28. _AFX_INLINE void CObject::AssertValid() const
  29. { /* no asserts in release builds */ }
  30. //_AFX_INLINE void CObject::Dump(CDumpContext&) const
  31. // { /* no dumping in release builds */ }
  32. #endif
  33. _AFX_INLINE const CObject* AFX_CDECL AfxDynamicDownCast(CRuntimeClass* pClass, const CObject* pObject)
  34. { return (const CObject*)AfxDynamicDownCast(pClass, (CObject*)pObject); }
  35. #ifdef _DEBUG
  36. _AFX_INLINE const CObject* AFX_CDECL AfxStaticDownCast(CRuntimeClass* pClass, const CObject* pObject)
  37. { return (const CObject*)AfxStaticDownCast(pClass, (CObject*)pObject); }
  38. #endif
  39. // CString
  40. _AFX_INLINE CStringData* CString::GetData() const
  41. { ASSERT(m_pchData != NULL); return ((CStringData*)m_pchData)-1; }
  42. _AFX_INLINE void CString::Init()
  43. { m_pchData = afxEmptyString.m_pchData; }
  44. _AFX_INLINE CString::CString(const unsigned char* lpsz)
  45. { Init(); *this = (LPCSTR)lpsz; }
  46. _AFX_INLINE const CString& CString::operator=(const unsigned char* lpsz)
  47. { *this = (LPCSTR)lpsz; return *this; }
  48. #ifdef _UNICODE
  49. _AFX_INLINE const CString& CString::operator+=(char ch)
  50. { *this += (TCHAR)ch; return *this; }
  51. _AFX_INLINE const CString& CString::operator=(char ch)
  52. { *this = (TCHAR)ch; return *this; }
  53. _AFX_INLINE CString AFXAPI operator+(const CString& string, char ch)
  54. { return string + (TCHAR)ch; }
  55. _AFX_INLINE CString AFXAPI operator+(char ch, const CString& string)
  56. { return (TCHAR)ch + string; }
  57. #endif
  58. _AFX_INLINE int CString::GetLength() const
  59. { return GetData()->nDataLength; }
  60. _AFX_INLINE int CString::GetAllocLength() const
  61. { return GetData()->nAllocLength; }
  62. _AFX_INLINE BOOL CString::IsEmpty() const
  63. { return GetData()->nDataLength == 0; }
  64. _AFX_INLINE CString::operator LPCTSTR() const
  65. { return m_pchData; }
  66. _AFX_INLINE int PASCAL CString::SafeStrlen(LPCTSTR lpsz)
  67. { return (lpsz == NULL) ? 0 : lstrlen(lpsz); }
  68. // CString support (windows specific)
  69. _AFX_INLINE int CString::Compare(LPCTSTR lpsz) const
  70. { return _tcscmp(m_pchData, lpsz); } // MBCS/Unicode aware
  71. _AFX_INLINE int CString::CompareNoCase(LPCTSTR lpsz) const
  72. { return _tcsicmp(m_pchData, lpsz); } // MBCS/Unicode aware
  73. // CString::Collate is often slower than Compare but is MBSC/Unicode
  74. // aware as well as locale-sensitive with respect to sort order.
  75. _AFX_INLINE int CString::Collate(LPCTSTR lpsz) const
  76. { return _tcscoll(m_pchData, lpsz); } // locale sensitive
  77. _AFX_INLINE TCHAR CString::GetAt(int nIndex) const
  78. {
  79. ASSERT(nIndex >= 0);
  80. ASSERT(nIndex < GetData()->nDataLength);
  81. return m_pchData[nIndex];
  82. }
  83. _AFX_INLINE TCHAR CString::operator[](int nIndex) const
  84. {
  85. // same as GetAt
  86. ASSERT(nIndex >= 0);
  87. ASSERT(nIndex < GetData()->nDataLength);
  88. return m_pchData[nIndex];
  89. }
  90. _AFX_INLINE BOOL AFXAPI operator==(const CString& s1, const CString& s2)
  91. { return s1.Compare(s2) == 0; }
  92. _AFX_INLINE BOOL AFXAPI operator==(const CString& s1, LPCTSTR s2)
  93. { return s1.Compare(s2) == 0; }
  94. _AFX_INLINE BOOL AFXAPI operator==(LPCTSTR s1, const CString& s2)
  95. { return s2.Compare(s1) == 0; }
  96. _AFX_INLINE BOOL AFXAPI operator!=(const CString& s1, const CString& s2)
  97. { return s1.Compare(s2) != 0; }
  98. _AFX_INLINE BOOL AFXAPI operator!=(const CString& s1, LPCTSTR s2)
  99. { return s1.Compare(s2) != 0; }
  100. _AFX_INLINE BOOL AFXAPI operator!=(LPCTSTR s1, const CString& s2)
  101. { return s2.Compare(s1) != 0; }
  102. _AFX_INLINE BOOL AFXAPI operator<(const CString& s1, const CString& s2)
  103. { return s1.Compare(s2) < 0; }
  104. _AFX_INLINE BOOL AFXAPI operator<(const CString& s1, LPCTSTR s2)
  105. { return s1.Compare(s2) < 0; }
  106. _AFX_INLINE BOOL AFXAPI operator<(LPCTSTR s1, const CString& s2)
  107. { return s2.Compare(s1) > 0; }
  108. _AFX_INLINE BOOL AFXAPI operator>(const CString& s1, const CString& s2)
  109. { return s1.Compare(s2) > 0; }
  110. _AFX_INLINE BOOL AFXAPI operator>(const CString& s1, LPCTSTR s2)
  111. { return s1.Compare(s2) > 0; }
  112. _AFX_INLINE BOOL AFXAPI operator>(LPCTSTR s1, const CString& s2)
  113. { return s2.Compare(s1) < 0; }
  114. _AFX_INLINE BOOL AFXAPI operator<=(const CString& s1, const CString& s2)
  115. { return s1.Compare(s2) <= 0; }
  116. _AFX_INLINE BOOL AFXAPI operator<=(const CString& s1, LPCTSTR s2)
  117. { return s1.Compare(s2) <= 0; }
  118. _AFX_INLINE BOOL AFXAPI operator<=(LPCTSTR s1, const CString& s2)
  119. { return s2.Compare(s1) >= 0; }
  120. _AFX_INLINE BOOL AFXAPI operator>=(const CString& s1, const CString& s2)
  121. { return s1.Compare(s2) >= 0; }
  122. _AFX_INLINE BOOL AFXAPI operator>=(const CString& s1, LPCTSTR s2)
  123. { return s1.Compare(s2) >= 0; }
  124. _AFX_INLINE BOOL AFXAPI operator>=(LPCTSTR s1, const CString& s2)
  125. { return s2.Compare(s1) <= 0; }
  126. ////////////////////////////////////////////////////////////////////////////
  127. _AFXCOLL_INLINE int CMapStringToOb::GetCount() const
  128. { return m_nCount; }
  129. _AFXCOLL_INLINE BOOL CMapStringToOb::IsEmpty() const
  130. { return m_nCount == 0; }
  131. _AFXCOLL_INLINE void CMapStringToOb::SetAt(LPCTSTR key, CObject* newValue)
  132. { (*this)[key] = newValue; }
  133. _AFXCOLL_INLINE POSITION CMapStringToOb::GetStartPosition() const
  134. { return (m_nCount == 0) ? NULL : BEFORE_START_POSITION; }
  135. _AFXCOLL_INLINE UINT CMapStringToOb::GetHashTableSize() const
  136. { return m_nHashTableSize; }
  137. ////////////////////////////////////////////////////////////////////////////
  138. _AFXCOLL_INLINE int CMapPtrToPtr::GetCount() const
  139. { return m_nCount; }
  140. _AFXCOLL_INLINE BOOL CMapPtrToPtr::IsEmpty() const
  141. { return m_nCount == 0; }
  142. _AFXCOLL_INLINE void CMapPtrToPtr::SetAt(void* key, void* newValue)
  143. { (*this)[key] = newValue; }
  144. _AFXCOLL_INLINE POSITION CMapPtrToPtr::GetStartPosition() const
  145. { return (m_nCount == 0) ? NULL : BEFORE_START_POSITION; }
  146. _AFXCOLL_INLINE UINT CMapPtrToPtr::GetHashTableSize() const
  147. { return m_nHashTableSize; }
  148. ////////////////////////////////////////////////////////////////////////////
  149. _AFXCOLL_INLINE int CMapStringToPtr::GetCount() const
  150. { return m_nCount; }
  151. _AFXCOLL_INLINE BOOL CMapStringToPtr::IsEmpty() const
  152. { return m_nCount == 0; }
  153. _AFXCOLL_INLINE void CMapStringToPtr::SetAt(LPCTSTR key, void* newValue)
  154. { (*this)[key] = newValue; }
  155. _AFXCOLL_INLINE POSITION CMapStringToPtr::GetStartPosition() const
  156. { return (m_nCount == 0) ? NULL : BEFORE_START_POSITION; }
  157. _AFXCOLL_INLINE UINT CMapStringToPtr::GetHashTableSize() const
  158. { return m_nHashTableSize; }
  159. #ifdef not_this
  160. ////////////////////////////////////////////////////////////////////////////
  161. _AFXCOLL_INLINE int CByteArray::GetSize() const
  162. { return m_nSize; }
  163. _AFXCOLL_INLINE int CByteArray::GetUpperBound() const
  164. { return m_nSize-1; }
  165. _AFXCOLL_INLINE void CByteArray::RemoveAll()
  166. { SetSize(0); }
  167. _AFXCOLL_INLINE BYTE CByteArray::GetAt(int nIndex) const
  168. { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  169. return m_pData[nIndex]; }
  170. _AFXCOLL_INLINE void CByteArray::SetAt(int nIndex, BYTE newElement)
  171. { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  172. m_pData[nIndex] = newElement; }
  173. _AFXCOLL_INLINE BYTE& CByteArray::ElementAt(int nIndex)
  174. { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  175. return m_pData[nIndex]; }
  176. _AFXCOLL_INLINE const BYTE* CByteArray::GetData() const
  177. { return (const BYTE*)m_pData; }
  178. _AFXCOLL_INLINE BYTE* CByteArray::GetData()
  179. { return (BYTE*)m_pData; }
  180. _AFXCOLL_INLINE int CByteArray::Add(BYTE newElement)
  181. { int nIndex = m_nSize;
  182. SetAtGrow(nIndex, newElement);
  183. return nIndex; }
  184. _AFXCOLL_INLINE BYTE CByteArray::operator[](int nIndex) const
  185. { return GetAt(nIndex); }
  186. _AFXCOLL_INLINE BYTE& CByteArray::operator[](int nIndex)
  187. { return ElementAt(nIndex); }
  188. ////////////////////////////////////////////////////////////////////////////
  189. _AFXCOLL_INLINE int CWordArray::GetSize() const
  190. { return m_nSize; }
  191. _AFXCOLL_INLINE int CWordArray::GetUpperBound() const
  192. { return m_nSize-1; }
  193. _AFXCOLL_INLINE void CWordArray::RemoveAll()
  194. { SetSize(0); }
  195. _AFXCOLL_INLINE WORD CWordArray::GetAt(int nIndex) const
  196. { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  197. return m_pData[nIndex]; }
  198. _AFXCOLL_INLINE void CWordArray::SetAt(int nIndex, WORD newElement)
  199. { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  200. m_pData[nIndex] = newElement; }
  201. _AFXCOLL_INLINE WORD& CWordArray::ElementAt(int nIndex)
  202. { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  203. return m_pData[nIndex]; }
  204. _AFXCOLL_INLINE const WORD* CWordArray::GetData() const
  205. { return (const WORD*)m_pData; }
  206. _AFXCOLL_INLINE WORD* CWordArray::GetData()
  207. { return (WORD*)m_pData; }
  208. _AFXCOLL_INLINE int CWordArray::Add(WORD newElement)
  209. { int nIndex = m_nSize;
  210. SetAtGrow(nIndex, newElement);
  211. return nIndex; }
  212. _AFXCOLL_INLINE WORD CWordArray::operator[](int nIndex) const
  213. { return GetAt(nIndex); }
  214. _AFXCOLL_INLINE WORD& CWordArray::operator[](int nIndex)
  215. { return ElementAt(nIndex); }
  216. ////////////////////////////////////////////////////////////////////////////
  217. _AFXCOLL_INLINE int CDWordArray::GetSize() const
  218. { return m_nSize; }
  219. _AFXCOLL_INLINE int CDWordArray::GetUpperBound() const
  220. { return m_nSize-1; }
  221. _AFXCOLL_INLINE void CDWordArray::RemoveAll()
  222. { SetSize(0); }
  223. _AFXCOLL_INLINE DWORD CDWordArray::GetAt(int nIndex) const
  224. { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  225. return m_pData[nIndex]; }
  226. _AFXCOLL_INLINE void CDWordArray::SetAt(int nIndex, DWORD newElement)
  227. { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  228. m_pData[nIndex] = newElement; }
  229. _AFXCOLL_INLINE DWORD& CDWordArray::ElementAt(int nIndex)
  230. { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  231. return m_pData[nIndex]; }
  232. _AFXCOLL_INLINE const DWORD* CDWordArray::GetData() const
  233. { return (const DWORD*)m_pData; }
  234. _AFXCOLL_INLINE DWORD* CDWordArray::GetData()
  235. { return (DWORD*)m_pData; }
  236. _AFXCOLL_INLINE int CDWordArray::Add(DWORD newElement)
  237. { int nIndex = m_nSize;
  238. SetAtGrow(nIndex, newElement);
  239. return nIndex; }
  240. _AFXCOLL_INLINE DWORD CDWordArray::operator[](int nIndex) const
  241. { return GetAt(nIndex); }
  242. _AFXCOLL_INLINE DWORD& CDWordArray::operator[](int nIndex)
  243. { return ElementAt(nIndex); }
  244. ////////////////////////////////////////////////////////////////////////////
  245. _AFXCOLL_INLINE int CUIntArray::GetSize() const
  246. { return m_nSize; }
  247. _AFXCOLL_INLINE int CUIntArray::GetUpperBound() const
  248. { return m_nSize-1; }
  249. _AFXCOLL_INLINE void CUIntArray::RemoveAll()
  250. { SetSize(0); }
  251. _AFXCOLL_INLINE UINT CUIntArray::GetAt(int nIndex) const
  252. { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  253. return m_pData[nIndex]; }
  254. _AFXCOLL_INLINE void CUIntArray::SetAt(int nIndex, UINT newElement)
  255. { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  256. m_pData[nIndex] = newElement; }
  257. _AFXCOLL_INLINE UINT& CUIntArray::ElementAt(int nIndex)
  258. { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  259. return m_pData[nIndex]; }
  260. _AFXCOLL_INLINE const UINT* CUIntArray::GetData() const
  261. { return (const UINT*)m_pData; }
  262. _AFXCOLL_INLINE UINT* CUIntArray::GetData()
  263. { return (UINT*)m_pData; }
  264. _AFXCOLL_INLINE int CUIntArray::Add(UINT newElement)
  265. { int nIndex = m_nSize;
  266. SetAtGrow(nIndex, newElement);
  267. return nIndex; }
  268. _AFXCOLL_INLINE UINT CUIntArray::operator[](int nIndex) const
  269. { return GetAt(nIndex); }
  270. _AFXCOLL_INLINE UINT& CUIntArray::operator[](int nIndex)
  271. { return ElementAt(nIndex); }
  272. ////////////////////////////////////////////////////////////////////////////
  273. _AFXCOLL_INLINE int CPtrArray::GetSize() const
  274. { return m_nSize; }
  275. _AFXCOLL_INLINE int CPtrArray::GetUpperBound() const
  276. { return m_nSize-1; }
  277. _AFXCOLL_INLINE void CPtrArray::RemoveAll()
  278. { SetSize(0); }
  279. _AFXCOLL_INLINE void* CPtrArray::GetAt(int nIndex) const
  280. { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  281. return m_pData[nIndex]; }
  282. _AFXCOLL_INLINE void CPtrArray::SetAt(int nIndex, void* newElement)
  283. { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  284. m_pData[nIndex] = newElement; }
  285. _AFXCOLL_INLINE void*& CPtrArray::ElementAt(int nIndex)
  286. { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  287. return m_pData[nIndex]; }
  288. _AFXCOLL_INLINE const void** CPtrArray::GetData() const
  289. { return (const void**)m_pData; }
  290. _AFXCOLL_INLINE void** CPtrArray::GetData()
  291. { return (void**)m_pData; }
  292. _AFXCOLL_INLINE int CPtrArray::Add(void* newElement)
  293. { int nIndex = m_nSize;
  294. SetAtGrow(nIndex, newElement);
  295. return nIndex; }
  296. _AFXCOLL_INLINE void* CPtrArray::operator[](int nIndex) const
  297. { return GetAt(nIndex); }
  298. _AFXCOLL_INLINE void*& CPtrArray::operator[](int nIndex)
  299. { return ElementAt(nIndex); }
  300. ////////////////////////////////////////////////////////////////////////////
  301. _AFXCOLL_INLINE int CObArray::GetSize() const
  302. { return m_nSize; }
  303. _AFXCOLL_INLINE int CObArray::GetUpperBound() const
  304. { return m_nSize-1; }
  305. _AFXCOLL_INLINE void CObArray::RemoveAll()
  306. { SetSize(0); }
  307. _AFXCOLL_INLINE CObject* CObArray::GetAt(int nIndex) const
  308. { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  309. return m_pData[nIndex]; }
  310. _AFXCOLL_INLINE void CObArray::SetAt(int nIndex, CObject* newElement)
  311. { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  312. m_pData[nIndex] = newElement; }
  313. _AFXCOLL_INLINE CObject*& CObArray::ElementAt(int nIndex)
  314. { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  315. return m_pData[nIndex]; }
  316. _AFXCOLL_INLINE const CObject** CObArray::GetData() const
  317. { return (const CObject**)m_pData; }
  318. _AFXCOLL_INLINE CObject** CObArray::GetData()
  319. { return (CObject**)m_pData; }
  320. _AFXCOLL_INLINE int CObArray::Add(CObject* newElement)
  321. { int nIndex = m_nSize;
  322. SetAtGrow(nIndex, newElement);
  323. return nIndex; }
  324. _AFXCOLL_INLINE CObject* CObArray::operator[](int nIndex) const
  325. { return GetAt(nIndex); }
  326. _AFXCOLL_INLINE CObject*& CObArray::operator[](int nIndex)
  327. { return ElementAt(nIndex); }
  328. ////////////////////////////////////////////////////////////////////////////
  329. _AFXCOLL_INLINE int CStringArray::GetSize() const
  330. { return m_nSize; }
  331. _AFXCOLL_INLINE int CStringArray::GetUpperBound() const
  332. { return m_nSize-1; }
  333. _AFXCOLL_INLINE void CStringArray::RemoveAll()
  334. { SetSize(0); }
  335. _AFXCOLL_INLINE CString CStringArray::GetAt(int nIndex) const
  336. { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  337. return m_pData[nIndex]; }
  338. _AFXCOLL_INLINE void CStringArray::SetAt(int nIndex, LPCTSTR newElement)
  339. { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  340. m_pData[nIndex] = newElement; }
  341. _AFXCOLL_INLINE CString& CStringArray::ElementAt(int nIndex)
  342. { ASSERT(nIndex >= 0 && nIndex < m_nSize);
  343. return m_pData[nIndex]; }
  344. _AFXCOLL_INLINE const CString* CStringArray::GetData() const
  345. { return (const CString*)m_pData; }
  346. _AFXCOLL_INLINE CString* CStringArray::GetData()
  347. { return (CString*)m_pData; }
  348. _AFXCOLL_INLINE int CStringArray::Add(LPCTSTR newElement)
  349. { int nIndex = m_nSize;
  350. SetAtGrow(nIndex, newElement);
  351. return nIndex; }
  352. _AFXCOLL_INLINE CString CStringArray::operator[](int nIndex) const
  353. { return GetAt(nIndex); }
  354. _AFXCOLL_INLINE CString& CStringArray::operator[](int nIndex)
  355. { return ElementAt(nIndex); }
  356. ////////////////////////////////////////////////////////////////////////////
  357. _AFXCOLL_INLINE int CPtrList::GetCount() const
  358. { return m_nCount; }
  359. _AFXCOLL_INLINE BOOL CPtrList::IsEmpty() const
  360. { return m_nCount == 0; }
  361. _AFXCOLL_INLINE void*& CPtrList::GetHead()
  362. { ASSERT(m_pNodeHead != NULL);
  363. return m_pNodeHead->data; }
  364. _AFXCOLL_INLINE void* CPtrList::GetHead() const
  365. { ASSERT(m_pNodeHead != NULL);
  366. return m_pNodeHead->data; }
  367. _AFXCOLL_INLINE void*& CPtrList::GetTail()
  368. { ASSERT(m_pNodeTail != NULL);
  369. return m_pNodeTail->data; }
  370. _AFXCOLL_INLINE void* CPtrList::GetTail() const
  371. { ASSERT(m_pNodeTail != NULL);
  372. return m_pNodeTail->data; }
  373. _AFXCOLL_INLINE POSITION CPtrList::GetHeadPosition() const
  374. { return (POSITION) m_pNodeHead; }
  375. _AFXCOLL_INLINE POSITION CPtrList::GetTailPosition() const
  376. { return (POSITION) m_pNodeTail; }
  377. _AFXCOLL_INLINE void*& CPtrList::GetNext(POSITION& rPosition) // return *Position++
  378. { CNode* pNode = (CNode*) rPosition;
  379. ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  380. rPosition = (POSITION) pNode->pNext;
  381. return pNode->data; }
  382. _AFXCOLL_INLINE void* CPtrList::GetNext(POSITION& rPosition) const // return *Position++
  383. { CNode* pNode = (CNode*) rPosition;
  384. ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  385. rPosition = (POSITION) pNode->pNext;
  386. return pNode->data; }
  387. _AFXCOLL_INLINE void*& CPtrList::GetPrev(POSITION& rPosition) // return *Position--
  388. { CNode* pNode = (CNode*) rPosition;
  389. ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  390. rPosition = (POSITION) pNode->pPrev;
  391. return pNode->data; }
  392. _AFXCOLL_INLINE void* CPtrList::GetPrev(POSITION& rPosition) const // return *Position--
  393. { CNode* pNode = (CNode*) rPosition;
  394. ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  395. rPosition = (POSITION) pNode->pPrev;
  396. return pNode->data; }
  397. _AFXCOLL_INLINE void*& CPtrList::GetAt(POSITION position)
  398. { CNode* pNode = (CNode*) position;
  399. ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  400. return pNode->data; }
  401. _AFXCOLL_INLINE void* CPtrList::GetAt(POSITION position) const
  402. { CNode* pNode = (CNode*) position;
  403. ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  404. return pNode->data; }
  405. _AFXCOLL_INLINE void CPtrList::SetAt(POSITION pos, void* newElement)
  406. { CNode* pNode = (CNode*) pos;
  407. ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  408. pNode->data = newElement; }
  409. ////////////////////////////////////////////////////////////////////////////
  410. _AFXCOLL_INLINE int CObList::GetCount() const
  411. { return m_nCount; }
  412. _AFXCOLL_INLINE BOOL CObList::IsEmpty() const
  413. { return m_nCount == 0; }
  414. _AFXCOLL_INLINE CObject*& CObList::GetHead()
  415. { ASSERT(m_pNodeHead != NULL);
  416. return m_pNodeHead->data; }
  417. _AFXCOLL_INLINE CObject* CObList::GetHead() const
  418. { ASSERT(m_pNodeHead != NULL);
  419. return m_pNodeHead->data; }
  420. _AFXCOLL_INLINE CObject*& CObList::GetTail()
  421. { ASSERT(m_pNodeTail != NULL);
  422. return m_pNodeTail->data; }
  423. _AFXCOLL_INLINE CObject* CObList::GetTail() const
  424. { ASSERT(m_pNodeTail != NULL);
  425. return m_pNodeTail->data; }
  426. _AFXCOLL_INLINE POSITION CObList::GetHeadPosition() const
  427. { return (POSITION) m_pNodeHead; }
  428. _AFXCOLL_INLINE POSITION CObList::GetTailPosition() const
  429. { return (POSITION) m_pNodeTail; }
  430. _AFXCOLL_INLINE CObject*& CObList::GetNext(POSITION& rPosition) // return *Position++
  431. { CNode* pNode = (CNode*) rPosition;
  432. ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  433. rPosition = (POSITION) pNode->pNext;
  434. return pNode->data; }
  435. _AFXCOLL_INLINE CObject* CObList::GetNext(POSITION& rPosition) const // return *Position++
  436. { CNode* pNode = (CNode*) rPosition;
  437. ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  438. rPosition = (POSITION) pNode->pNext;
  439. return pNode->data; }
  440. _AFXCOLL_INLINE CObject*& CObList::GetPrev(POSITION& rPosition) // return *Position--
  441. { CNode* pNode = (CNode*) rPosition;
  442. ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  443. rPosition = (POSITION) pNode->pPrev;
  444. return pNode->data; }
  445. _AFXCOLL_INLINE CObject* CObList::GetPrev(POSITION& rPosition) const // return *Position--
  446. { CNode* pNode = (CNode*) rPosition;
  447. ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  448. rPosition = (POSITION) pNode->pPrev;
  449. return pNode->data; }
  450. _AFXCOLL_INLINE CObject*& CObList::GetAt(POSITION position)
  451. { CNode* pNode = (CNode*) position;
  452. ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  453. return pNode->data; }
  454. _AFXCOLL_INLINE CObject* CObList::GetAt(POSITION position) const
  455. { CNode* pNode = (CNode*) position;
  456. ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  457. return pNode->data; }
  458. _AFXCOLL_INLINE void CObList::SetAt(POSITION pos, CObject* newElement)
  459. { CNode* pNode = (CNode*) pos;
  460. ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  461. pNode->data = newElement; }
  462. ////////////////////////////////////////////////////////////////////////////
  463. _AFXCOLL_INLINE int CStringList::GetCount() const
  464. { return m_nCount; }
  465. _AFXCOLL_INLINE BOOL CStringList::IsEmpty() const
  466. { return m_nCount == 0; }
  467. _AFXCOLL_INLINE CString& CStringList::GetHead()
  468. { ASSERT(m_pNodeHead != NULL);
  469. return m_pNodeHead->data; }
  470. _AFXCOLL_INLINE CString CStringList::GetHead() const
  471. { ASSERT(m_pNodeHead != NULL);
  472. return m_pNodeHead->data; }
  473. _AFXCOLL_INLINE CString& CStringList::GetTail()
  474. { ASSERT(m_pNodeTail != NULL);
  475. return m_pNodeTail->data; }
  476. _AFXCOLL_INLINE CString CStringList::GetTail() const
  477. { ASSERT(m_pNodeTail != NULL);
  478. return m_pNodeTail->data; }
  479. _AFXCOLL_INLINE POSITION CStringList::GetHeadPosition() const
  480. { return (POSITION) m_pNodeHead; }
  481. _AFXCOLL_INLINE POSITION CStringList::GetTailPosition() const
  482. { return (POSITION) m_pNodeTail; }
  483. _AFXCOLL_INLINE CString& CStringList::GetNext(POSITION& rPosition) // return *Position++
  484. { CNode* pNode = (CNode*) rPosition;
  485. ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  486. rPosition = (POSITION) pNode->pNext;
  487. return pNode->data; }
  488. _AFXCOLL_INLINE CString CStringList::GetNext(POSITION& rPosition) const // return *Position++
  489. { CNode* pNode = (CNode*) rPosition;
  490. ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  491. rPosition = (POSITION) pNode->pNext;
  492. return pNode->data; }
  493. _AFXCOLL_INLINE CString& CStringList::GetPrev(POSITION& rPosition) // return *Position--
  494. { CNode* pNode = (CNode*) rPosition;
  495. ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  496. rPosition = (POSITION) pNode->pPrev;
  497. return pNode->data; }
  498. _AFXCOLL_INLINE CString CStringList::GetPrev(POSITION& rPosition) const // return *Position--
  499. { CNode* pNode = (CNode*) rPosition;
  500. ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  501. rPosition = (POSITION) pNode->pPrev;
  502. return pNode->data; }
  503. _AFXCOLL_INLINE CString& CStringList::GetAt(POSITION position)
  504. { CNode* pNode = (CNode*) position;
  505. ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  506. return pNode->data; }
  507. _AFXCOLL_INLINE CString CStringList::GetAt(POSITION position) const
  508. { CNode* pNode = (CNode*) position;
  509. ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  510. return pNode->data; }
  511. _AFXCOLL_INLINE void CStringList::SetAt(POSITION pos, LPCTSTR newElement)
  512. { CNode* pNode = (CNode*) pos;
  513. ASSERT(AfxIsValidAddress(pNode, sizeof(CNode)));
  514. pNode->data = newElement; }
  515. ////////////////////////////////////////////////////////////////////////////
  516. _AFXCOLL_INLINE int CMapWordToPtr::GetCount() const
  517. { return m_nCount; }
  518. _AFXCOLL_INLINE BOOL CMapWordToPtr::IsEmpty() const
  519. { return m_nCount == 0; }
  520. _AFXCOLL_INLINE void CMapWordToPtr::SetAt(WORD key, void* newValue)
  521. { (*this)[key] = newValue; }
  522. _AFXCOLL_INLINE POSITION CMapWordToPtr::GetStartPosition() const
  523. { return (m_nCount == 0) ? NULL : BEFORE_START_POSITION; }
  524. _AFXCOLL_INLINE UINT CMapWordToPtr::GetHashTableSize() const
  525. { return m_nHashTableSize; }
  526. ////////////////////////////////////////////////////////////////////////////
  527. _AFXCOLL_INLINE int CMapPtrToWord::GetCount() const
  528. { return m_nCount; }
  529. _AFXCOLL_INLINE BOOL CMapPtrToWord::IsEmpty() const
  530. { return m_nCount == 0; }
  531. _AFXCOLL_INLINE void CMapPtrToWord::SetAt(void* key, WORD newValue)
  532. { (*this)[key] = newValue; }
  533. _AFXCOLL_INLINE POSITION CMapPtrToWord::GetStartPosition() const
  534. { return (m_nCount == 0) ? NULL : BEFORE_START_POSITION; }
  535. _AFXCOLL_INLINE UINT CMapPtrToWord::GetHashTableSize() const
  536. { return m_nHashTableSize; }
  537. ////////////////////////////////////////////////////////////////////////////
  538. _AFXCOLL_INLINE int CMapWordToOb::GetCount() const
  539. { return m_nCount; }
  540. _AFXCOLL_INLINE BOOL CMapWordToOb::IsEmpty() const
  541. { return m_nCount == 0; }
  542. _AFXCOLL_INLINE void CMapWordToOb::SetAt(WORD key, CObject* newValue)
  543. { (*this)[key] = newValue; }
  544. _AFXCOLL_INLINE POSITION CMapWordToOb::GetStartPosition() const
  545. { return (m_nCount == 0) ? NULL : BEFORE_START_POSITION; }
  546. _AFXCOLL_INLINE UINT CMapWordToOb::GetHashTableSize() const
  547. { return m_nHashTableSize; }
  548. ////////////////////////////////////////////////////////////////////////////
  549. _AFXCOLL_INLINE int CMapStringToString::GetCount() const
  550. { return m_nCount; }
  551. _AFXCOLL_INLINE BOOL CMapStringToString::IsEmpty() const
  552. { return m_nCount == 0; }
  553. _AFXCOLL_INLINE void CMapStringToString::SetAt(LPCTSTR key, LPCTSTR newValue)
  554. { (*this)[key] = newValue; }
  555. _AFXCOLL_INLINE POSITION CMapStringToString::GetStartPosition() const
  556. { return (m_nCount == 0) ? NULL : BEFORE_START_POSITION; }
  557. _AFXCOLL_INLINE UINT CMapStringToString::GetHashTableSize() const
  558. { return m_nHashTableSize; }
  559. #endif //not_this
  560. /////////////////////////////////////////////////////////////////////////////
  561. #endif //_AFXCOLL_INLINE