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.

705 lines
20 KiB

  1. /*++
  2. Copyright (C) 1992-2001 Microsoft Corporation
  3. Module Name:
  4. MINIAFX.H
  5. Abstract:
  6. MFC Subset declarations.
  7. CString, CWordArray, CDWordArray, CPtrArray, CStringArray, CPtrList
  8. History:
  9. 09/25/94 TSE
  10. --*/
  11. #ifndef _MINIAFX_H_
  12. #define _MINIAFX_H_
  13. #include <stdio.h>
  14. #include <string.h>
  15. typedef void* POSITION; // abstract iteration position
  16. #ifndef DWORD
  17. typedef unsigned char BYTE; // 8-bit unsigned entity
  18. typedef unsigned short WORD; // 16-bit unsigned number
  19. typedef unsigned int UINT; // machine sized unsigned number (preferred)
  20. typedef long LONG; // 32-bit signed number
  21. typedef unsigned long DWORD; // 32-bit unsigned number
  22. typedef int BOOL; // BOOLean (0 or !=0)
  23. typedef char * LPSTR; // far pointer to a string
  24. typedef const char * LPCSTR; // far pointer to a read-only string
  25. #endif
  26. #ifndef NULL
  27. #define NULL 0
  28. #endif
  29. #ifndef TRUE
  30. #define TRUE 1
  31. #endif
  32. #ifndef FALSE
  33. #define FALSE 0
  34. #endif
  35. ////////////////////////////////////////////////////////////////////////////
  36. class CString
  37. {
  38. public:
  39. // Constructors
  40. CString();
  41. CString(const CString& stringSrc);
  42. CString(char ch, int nRepeat = 1);
  43. CString(const char* psz);
  44. CString(const char* pch, int nLength);
  45. ~CString();
  46. // Attributes & Operations
  47. // as an array of characters
  48. int GetLength() const { return m_nDataLength; }
  49. BOOL IsEmpty() const;
  50. void Empty(); // free up the data
  51. char GetAt(int nIndex) const; // 0 based
  52. char operator[](int nIndex) const; // same as GetAt
  53. void SetAt(int nIndex, char ch);
  54. operator const char*() const // as a C string
  55. { return (const char*)m_pchData; }
  56. // overloaded assignment
  57. const CString& operator=(const CString& stringSrc);
  58. const CString& operator=(char ch);
  59. const CString& operator=(const char* psz);
  60. // string concatenation
  61. const CString& operator+=(const CString& string);
  62. const CString& operator+=(char ch);
  63. const CString& operator+=(const char* psz);
  64. friend CString operator+(const CString& string1,
  65. const CString& string2);
  66. friend CString operator+(const CString& string, char ch);
  67. friend CString operator+(char ch, const CString& string);
  68. friend CString operator+(const CString& string, const char* psz);
  69. friend CString operator+(const char* psz, const CString& string);
  70. // string comparison
  71. int Compare(const char* psz) const; // straight character
  72. int CompareNoCase(const char* psz) const; // ignore case
  73. int Collate(const char* psz) const; // NLS aware
  74. // simple sub-string extraction
  75. CString Mid(int nFirst, int nCount) const;
  76. CString Mid(int nFirst) const;
  77. CString Left(int nCount) const;
  78. CString Right(int nCount) const;
  79. CString SpanIncluding(const char* pszCharSet) const;
  80. CString SpanExcluding(const char* pszCharSet) const;
  81. // upper/lower/reverse conversion
  82. void MakeUpper();
  83. void MakeLower();
  84. void MakeReverse();
  85. // searching (return starting index, or -1 if not found)
  86. // look for a single character match
  87. int Find(char ch) const; // like "C" strchr
  88. int ReverseFind(char ch) const;
  89. int FindOneOf(const char* pszCharSet) const;
  90. // look for a specific sub-string
  91. int Find(const char* pszSub) const; // like "C" strstr
  92. // Windows support
  93. #ifdef _WINDOWS
  94. BOOL LoadString(UINT nID); // load from string resource
  95. // 255 chars max
  96. // ANSI<->OEM support (convert string in place)
  97. void AnsiToOem();
  98. void OemToAnsi();
  99. #endif //_WINDOWS
  100. // Access to string implementation buffer as "C" character array
  101. char* GetBuffer(int nMinBufLength);
  102. void ReleaseBuffer(int nNewLength = -1);
  103. char* GetBufferSetLength(int nNewLength);
  104. // Implementation
  105. public:
  106. int GetAllocLength() const;
  107. protected:
  108. // lengths/sizes in characters
  109. // (note: an extra character is always allocated)
  110. char* m_pchData; // actual string (zero terminated)
  111. int m_nDataLength; // does not include terminating 0
  112. int m_nAllocLength; // does not include terminating 0
  113. // implementation helpers
  114. void Init();
  115. void AllocCopy(CString& dest, int nCopyLen, int nCopyIndex, int nExtraLen) const;
  116. void AllocBuffer(int nLen);
  117. void AssignCopy(int nSrcLen, const char* pszSrcData);
  118. void ConcatCopy(int nSrc1Len, const char* pszSrc1Data, int nSrc2Len, const char* pszSrc2Data);
  119. void ConcatInPlace(int nSrcLen, const char* pszSrcData);
  120. static void SafeDelete(char* pch);
  121. static int SafeStrlen(const char* psz);
  122. };
  123. // Compare helpers
  124. BOOL operator==(const CString& s1, const CString& s2);
  125. BOOL operator==(const CString& s1, const char* s2);
  126. BOOL operator==(const char* s1, const CString& s2);
  127. BOOL operator!=(const CString& s1, const CString& s2);
  128. BOOL operator!=(const CString& s1, const char* s2);
  129. BOOL operator!=(const char* s1, const CString& s2);
  130. BOOL operator<(const CString& s1, const CString& s2);
  131. BOOL operator<(const CString& s1, const char* s2);
  132. BOOL operator<(const char* s1, const CString& s2);
  133. BOOL operator>(const CString& s1, const CString& s2);
  134. BOOL operator>(const CString& s1, const char* s2);
  135. BOOL operator>(const char* s1, const CString& s2);
  136. BOOL operator<=(const CString& s1, const CString& s2);
  137. BOOL operator<=(const CString& s1, const char* s2);
  138. BOOL operator<=(const char* s1, const CString& s2);
  139. BOOL operator>=(const CString& s1, const CString& s2);
  140. BOOL operator>=(const CString& s1, const char* s2);
  141. BOOL operator>=(const char* s1, const CString& s2);
  142. ////////////////////////////////////////////////////////////////////////////
  143. class CDWordArray
  144. {
  145. public:
  146. // Construction
  147. CDWordArray();
  148. // Attributes
  149. int GetSize() const { return m_nSize; }
  150. int GetUpperBound() const;
  151. void SetSize(int nNewSize, int nGrowBy = -1);
  152. // Operations
  153. // Clean up
  154. void FreeExtra();
  155. void RemoveAll();
  156. // Accessing elements
  157. DWORD GetAt(int nIndex) const { return m_pData[nIndex]; }
  158. void SetAt(int nIndex, DWORD newElement)
  159. { m_pData[nIndex] = newElement; }
  160. DWORD& ElementAt(int nIndex);
  161. // Potentially growing the array
  162. void SetAtGrow(int nIndex, DWORD newElement);
  163. int Add(DWORD newElement);
  164. // overloaded operator helpers
  165. DWORD operator[](int nIndex) const;
  166. DWORD& operator[](int nIndex);
  167. // Operations that move elements around
  168. void InsertAt(int nIndex, DWORD newElement, int nCount = 1);
  169. void RemoveAt(int nIndex, int nCount = 1);
  170. void InsertAt(int nStartIndex, CDWordArray* pNewArray);
  171. // Implementation
  172. protected:
  173. DWORD* m_pData; // the actual array of data
  174. int m_nSize; // # of elements (upperBound - 1)
  175. int m_nMaxSize; // max allocated
  176. int m_nGrowBy; // grow amount
  177. public:
  178. ~CDWordArray();
  179. };
  180. ////////////////////////////////////////////////////////////////////////////
  181. class CPtrArray
  182. {
  183. public:
  184. // Construction
  185. CPtrArray();
  186. // Attributes
  187. int GetSize() const { return m_nSize; }
  188. int GetUpperBound() const;
  189. BOOL SetSize(int nNewSize, int nGrowBy = -1);
  190. // Operations
  191. // Clean up
  192. void FreeExtra();
  193. void RemoveAll();
  194. // Accessing elements
  195. void* GetAt(int nIndex) const { return m_pData[nIndex]; }
  196. void SetAt(int nIndex, void* newElement)
  197. { m_pData[nIndex] = newElement; }
  198. void*& ElementAt(int nIndex);
  199. // Potentially growing the array
  200. BOOL SetAtGrow(int nIndex, void* newElement);
  201. int Add(void* newElement)
  202. { int nIndex = m_nSize;
  203. if(SetAtGrow(nIndex, newElement))
  204. return nIndex;
  205. else
  206. return -1;
  207. }
  208. // overloaded operator helpers
  209. void* operator[](int nIndex) const;
  210. void*& operator[](int nIndex);
  211. // Operations that move elements around
  212. void InsertAt(int nIndex, void* newElement, int nCount = 1);
  213. void RemoveAt(int nIndex, int nCount = 1);
  214. void InsertAt(int nStartIndex, CPtrArray* pNewArray);
  215. // Implementation
  216. protected:
  217. void** m_pData; // the actual array of data
  218. int m_nSize; // # of elements (upperBound - 1)
  219. int m_nMaxSize; // max allocated
  220. int m_nGrowBy; // grow amount
  221. public:
  222. ~CPtrArray();
  223. };
  224. ////////////////////////////////////////////////////////////////////////////
  225. class CStringArray
  226. {
  227. public:
  228. // Construction
  229. CStringArray();
  230. // Attributes
  231. int GetSize() const { return m_nSize; }
  232. int GetUpperBound() const;
  233. void SetSize(int nNewSize, int nGrowBy = -1);
  234. // Operations
  235. // Clean up
  236. void FreeExtra();
  237. void RemoveAll();
  238. // Accessing elements
  239. CString GetAt(int nIndex) const { return m_pData[nIndex]; }
  240. void SetAt(int nIndex, const char* newElement)
  241. { m_pData[nIndex] = newElement; }
  242. CString& ElementAt(int nIndex)
  243. { return m_pData[nIndex]; }
  244. // Potentially growing the array
  245. void SetAtGrow(int nIndex, const char* newElement);
  246. int Add(const char* newElement)
  247. { int nIndex = m_nSize;
  248. SetAtGrow(nIndex, newElement);
  249. return nIndex; }
  250. // overloaded operator helpers
  251. CString operator[](int nIndex) const
  252. { return GetAt(nIndex); }
  253. CString& operator[](int nIndex)
  254. { return ElementAt(nIndex); }
  255. // Operations that move elements around
  256. void InsertAt(int nIndex, const char* newElement, int nCount = 1);
  257. void RemoveAt(int nIndex, int nCount = 1);
  258. void InsertAt(int nStartIndex, CStringArray* pNewArray);
  259. // Implementation
  260. protected:
  261. CString* m_pData; // the actual array of data
  262. int m_nSize; // # of elements (upperBound - 1)
  263. int m_nMaxSize; // max allocated
  264. int m_nGrowBy; // grow amount
  265. public:
  266. ~CStringArray();
  267. };
  268. ////////////////////////////////////////////////////////////////////////////
  269. class CWordArray
  270. {
  271. public:
  272. // Construction
  273. CWordArray();
  274. // Attributes
  275. int GetSize() const { return m_nSize; }
  276. int GetUpperBound() const;
  277. void SetSize(int nNewSize, int nGrowBy = -1);
  278. // Operations
  279. // Clean up
  280. void FreeExtra();
  281. void RemoveAll();
  282. // Accessing elements
  283. WORD GetAt(int nIndex) const { return m_pData[nIndex]; }
  284. void SetAt(int nIndex, WORD newElement)
  285. { m_pData[nIndex] = newElement; }
  286. WORD& ElementAt(int nIndex);
  287. // Potentially growing the array
  288. void SetAtGrow(int nIndex, WORD newElement);
  289. int Add(WORD newElement);
  290. // overloaded operator helpers
  291. WORD operator[](int nIndex) const;
  292. WORD& operator[](int nIndex);
  293. // Operations that move elements around
  294. void InsertAt(int nIndex, WORD newElement, int nCount = 1);
  295. void RemoveAt(int nIndex, int nCount = 1);
  296. void InsertAt(int nStartIndex, CWordArray* pNewArray);
  297. // Implementation
  298. protected:
  299. WORD* m_pData; // the actual array of data
  300. int m_nSize; // # of elements (upperBound - 1)
  301. int m_nMaxSize; // max allocated
  302. int m_nGrowBy; // grow amount
  303. public:
  304. ~CWordArray();
  305. };
  306. /////////////////////////////////////////////////////////////////////////////
  307. class CPtrList
  308. {
  309. protected:
  310. struct CNode
  311. {
  312. CNode* pNext;
  313. CNode* pPrev;
  314. void* data;
  315. };
  316. public:
  317. // Construction
  318. CPtrList(int nBlockSize=10);
  319. // Attributes (head and tail)
  320. // count of elements
  321. int GetCount() const;
  322. BOOL IsEmpty() const;
  323. // peek at head or tail
  324. void*& GetHead();
  325. void* GetHead() const;
  326. void*& GetTail();
  327. void* GetTail() const;
  328. // Operations
  329. // get head or tail (and remove it) - don't call on empty list !
  330. void* RemoveHead();
  331. void* RemoveTail();
  332. // add before head or after tail
  333. POSITION AddHead(void* newElement);
  334. POSITION AddTail(void* newElement);
  335. // add another list of elements before head or after tail
  336. void AddHead(CPtrList* pNewList);
  337. void AddTail(CPtrList* pNewList);
  338. // remove all elements
  339. void RemoveAll();
  340. // iteration
  341. POSITION GetHeadPosition() const;
  342. POSITION GetTailPosition() const;
  343. void*& GetNext(POSITION& rPosition); // return *Position++
  344. void* GetNext(POSITION& rPosition) const; // return *Position++
  345. void*& GetPrev(POSITION& rPosition); // return *Position--
  346. void* GetPrev(POSITION& rPosition) const; // return *Position--
  347. // getting/modifying an element at a given position
  348. void*& GetAt(POSITION position);
  349. void* GetAt(POSITION position) const;
  350. void SetAt(POSITION pos, void* newElement);
  351. void RemoveAt(POSITION position);
  352. // inserting before or after a given position
  353. POSITION InsertBefore(POSITION position, void* newElement);
  354. POSITION InsertAfter(POSITION position, void* newElement);
  355. // helper functions (note: O(n) speed)
  356. POSITION Find(void* searchValue, POSITION startAfter = NULL) const;
  357. // defaults to starting at the HEAD
  358. // return NULL if not found
  359. POSITION FindIndex(int nIndex) const;
  360. // get the 'nIndex'th element (may return NULL)
  361. // Implementation
  362. protected:
  363. CNode* m_pNodeHead;
  364. CNode* m_pNodeTail;
  365. int m_nCount;
  366. CNode* m_pNodeFree;
  367. struct CPlex* m_pBlocks;
  368. int m_nBlockSize;
  369. CNode* NewNode(CNode*, CNode*);
  370. void FreeNode(CNode*);
  371. public:
  372. ~CPtrList();
  373. };
  374. //-----------------------------------------------------------------
  375. // Inlines from AFX.INL and AFXCOLL.INL
  376. //
  377. #define _AFX_INLINE inline
  378. #define _AFXCOLL_INLINE inline
  379. // CString
  380. _AFX_INLINE int CString::GetAllocLength() const
  381. { return m_nAllocLength; }
  382. _AFX_INLINE BOOL CString::IsEmpty() const
  383. { return m_nDataLength == 0; }
  384. //_AFX_INLINE int CString::SafeStrlen(const char* psz)
  385. // { return (psz == NULL) ? NULL : strlen(psz); }
  386. #ifndef _WINDOWS
  387. _AFX_INLINE int CString::Compare(const char* psz) const
  388. { return strcmp(m_pchData, psz); }
  389. _AFX_INLINE int CString::CompareNoCase(const char* psz) const
  390. { return stricmp(m_pchData, psz); }
  391. _AFX_INLINE int CString::Collate(const char* psz) const
  392. { return strcoll(m_pchData, psz); }
  393. _AFX_INLINE void CString::MakeUpper()
  394. { strupr(m_pchData); }
  395. _AFX_INLINE void CString::MakeLower()
  396. { strlwr(m_pchData); }
  397. // Windows version in AFXWIN.H
  398. #endif //!_WINDOWS
  399. _AFX_INLINE void CString::MakeReverse()
  400. { strrev(m_pchData); }
  401. _AFX_INLINE char CString::GetAt(int nIndex) const
  402. {
  403. return m_pchData[nIndex];
  404. }
  405. _AFX_INLINE char CString::operator[](int nIndex) const
  406. {
  407. return m_pchData[nIndex];
  408. }
  409. _AFX_INLINE void CString::SetAt(int nIndex, char ch)
  410. {
  411. m_pchData[nIndex] = ch;
  412. }
  413. _AFX_INLINE BOOL operator==(const CString& s1, const CString& s2)
  414. { return s1.Compare(s2) == 0; }
  415. _AFX_INLINE BOOL operator==(const CString& s1, const char* s2)
  416. { return s1.Compare(s2) == 0; }
  417. _AFX_INLINE BOOL operator==(const char* s1, const CString& s2)
  418. { return s2.Compare(s1) == 0; }
  419. _AFX_INLINE BOOL operator!=(const CString& s1, const CString& s2)
  420. { return s1.Compare(s2) != 0; }
  421. _AFX_INLINE BOOL operator!=(const CString& s1, const char* s2)
  422. { return s1.Compare(s2) != 0; }
  423. _AFX_INLINE BOOL operator!=(const char* s1, const CString& s2)
  424. { return s2.Compare(s1) != 0; }
  425. _AFX_INLINE BOOL operator<(const CString& s1, const CString& s2)
  426. { return s1.Compare(s2) < 0; }
  427. _AFX_INLINE BOOL operator<(const CString& s1, const char* s2)
  428. { return s1.Compare(s2) < 0; }
  429. _AFX_INLINE BOOL operator<(const char* s1, const CString& s2)
  430. { return s2.Compare(s1) > 0; }
  431. _AFX_INLINE BOOL operator>(const CString& s1, const CString& s2)
  432. { return s1.Compare(s2) > 0; }
  433. _AFX_INLINE BOOL operator>(const CString& s1, const char* s2)
  434. { return s1.Compare(s2) > 0; }
  435. _AFX_INLINE BOOL operator>(const char* s1, const CString& s2)
  436. { return s2.Compare(s1) < 0; }
  437. _AFX_INLINE BOOL operator<=(const CString& s1, const CString& s2)
  438. { return s1.Compare(s2) <= 0; }
  439. _AFX_INLINE BOOL operator<=(const CString& s1, const char* s2)
  440. { return s1.Compare(s2) <= 0; }
  441. _AFX_INLINE BOOL operator<=(const char* s1, const CString& s2)
  442. { return s2.Compare(s1) >= 0; }
  443. _AFX_INLINE BOOL operator>=(const CString& s1, const CString& s2)
  444. { return s1.Compare(s2) >= 0; }
  445. _AFX_INLINE BOOL operator>=(const CString& s1, const char* s2)
  446. { return s1.Compare(s2) >= 0; }
  447. _AFX_INLINE BOOL operator>=(const char* s1, const CString& s2)
  448. { return s2.Compare(s1) <= 0; }
  449. /////////////////////////////////////////////////////////////////////
  450. ////////////////////////////////////////////////////////////////////////////
  451. _AFXCOLL_INLINE int CWordArray::GetUpperBound() const
  452. { return m_nSize-1; }
  453. _AFXCOLL_INLINE void CWordArray::RemoveAll()
  454. { SetSize(0); }
  455. _AFXCOLL_INLINE WORD& CWordArray::ElementAt(int nIndex)
  456. { return m_pData[nIndex]; }
  457. _AFXCOLL_INLINE int CWordArray::Add(WORD newElement)
  458. { int nIndex = m_nSize;
  459. SetAtGrow(nIndex, newElement);
  460. return nIndex; }
  461. _AFXCOLL_INLINE WORD CWordArray::operator[](int nIndex) const
  462. { return GetAt(nIndex); }
  463. _AFXCOLL_INLINE WORD& CWordArray::operator[](int nIndex)
  464. { return ElementAt(nIndex); }
  465. ////////////////////////////////////////////////////////////////////////////
  466. _AFXCOLL_INLINE int CDWordArray::GetUpperBound() const
  467. { return m_nSize-1; }
  468. _AFXCOLL_INLINE void CDWordArray::RemoveAll()
  469. { SetSize(0); }
  470. _AFXCOLL_INLINE DWORD& CDWordArray::ElementAt(int nIndex)
  471. { return m_pData[nIndex]; }
  472. _AFXCOLL_INLINE int CDWordArray::Add(DWORD newElement)
  473. { int nIndex = m_nSize;
  474. SetAtGrow(nIndex, newElement);
  475. return nIndex; }
  476. _AFXCOLL_INLINE DWORD CDWordArray::operator[](int nIndex) const
  477. { return GetAt(nIndex); }
  478. _AFXCOLL_INLINE DWORD& CDWordArray::operator[](int nIndex)
  479. { return ElementAt(nIndex); }
  480. ////////////////////////////////////////////////////////////////////////////
  481. ////////////////////////////////////////////////////////////////////////////
  482. _AFXCOLL_INLINE int CPtrArray::GetUpperBound() const
  483. { return m_nSize-1; }
  484. _AFXCOLL_INLINE void CPtrArray::RemoveAll()
  485. { SetSize(0); }
  486. _AFXCOLL_INLINE void*& CPtrArray::ElementAt(int nIndex)
  487. { return m_pData[nIndex]; }
  488. _AFXCOLL_INLINE void* CPtrArray::operator[](int nIndex) const
  489. { return GetAt(nIndex); }
  490. _AFXCOLL_INLINE void*& CPtrArray::operator[](int nIndex)
  491. { return ElementAt(nIndex); }
  492. ////////////////////////////////////////////////////////////////////////////
  493. ////////////////////////////////////////////////////////////////////////////
  494. _AFXCOLL_INLINE int CStringArray::GetUpperBound() const
  495. { return m_nSize-1; }
  496. _AFXCOLL_INLINE void CStringArray::RemoveAll()
  497. { SetSize(0); }
  498. ////////////////////////////////////////////////////////////////////////////
  499. _AFXCOLL_INLINE int CPtrList::GetCount() const
  500. { return m_nCount; }
  501. _AFXCOLL_INLINE BOOL CPtrList::IsEmpty() const
  502. { return m_nCount == 0; }
  503. _AFXCOLL_INLINE void*& CPtrList::GetHead()
  504. { return m_pNodeHead->data; }
  505. _AFXCOLL_INLINE void* CPtrList::GetHead() const
  506. { return m_pNodeHead->data; }
  507. _AFXCOLL_INLINE void*& CPtrList::GetTail()
  508. { return m_pNodeTail->data; }
  509. _AFXCOLL_INLINE void* CPtrList::GetTail() const
  510. { return m_pNodeTail->data; }
  511. _AFXCOLL_INLINE POSITION CPtrList::GetHeadPosition() const
  512. { return (POSITION) m_pNodeHead; }
  513. _AFXCOLL_INLINE POSITION CPtrList::GetTailPosition() const
  514. { return (POSITION) m_pNodeTail; }
  515. _AFXCOLL_INLINE void*& CPtrList::GetNext(POSITION& rPosition) // return *Position++
  516. { CNode* pNode = (CNode*) rPosition;
  517. rPosition = (POSITION) pNode->pNext;
  518. return pNode->data; }
  519. _AFXCOLL_INLINE void* CPtrList::GetNext(POSITION& rPosition) const // return *Position++
  520. { CNode* pNode = (CNode*) rPosition;
  521. rPosition = (POSITION) pNode->pNext;
  522. return pNode->data; }
  523. _AFXCOLL_INLINE void*& CPtrList::GetPrev(POSITION& rPosition) // return *Position--
  524. { CNode* pNode = (CNode*) rPosition;
  525. rPosition = (POSITION) pNode->pPrev;
  526. return pNode->data; }
  527. _AFXCOLL_INLINE void* CPtrList::GetPrev(POSITION& rPosition) const // return *Position--
  528. { CNode* pNode = (CNode*) rPosition;
  529. rPosition = (POSITION) pNode->pPrev;
  530. return pNode->data; }
  531. _AFXCOLL_INLINE void*& CPtrList::GetAt(POSITION position)
  532. { CNode* pNode = (CNode*) position;
  533. return pNode->data; }
  534. _AFXCOLL_INLINE void* CPtrList::GetAt(POSITION position) const
  535. { CNode* pNode = (CNode*) position;
  536. return pNode->data; }
  537. _AFXCOLL_INLINE void CPtrList::SetAt(POSITION pos, void* newElement)
  538. { CNode* pNode = (CNode*) pos;
  539. pNode->data = newElement; }
  540. ////////////////////////////////////////////////////////////////////////////
  541. #endif