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.

718 lines
22 KiB

  1. #ifndef __COLL_HXX__
  2. #define __COLL_HXX__
  3. #ifdef __cplusplus
  4. #include <map_kv.h>
  5. //#include "clist.hxx"
  6. #include <tchar.h>
  7. // AFX_CDECL is used for rare functions taking variable arguments
  8. #ifndef AFX_CDECL
  9. #define AFX_CDECL __cdecl
  10. #endif
  11. #ifdef unix
  12. #undef ASSERT
  13. #endif /* unix */
  14. #ifdef ALPHA
  15. #undef ASSERT
  16. #endif
  17. #define ASSERT(x)
  18. #define VERIFY(f) (f)
  19. class CObject;
  20. class CString;
  21. class CArchive; // object persistence tool
  22. #include "clist.hxx"
  23. const CString& AFXAPI AfxGetEmptyString();
  24. #define afxEmptyString AfxGetEmptyString()
  25. /////////////////////////////////////////////////////////////////////////////
  26. // class CObject is the root of all compliant objects
  27. struct CRuntimeClass
  28. {
  29. // Attributes
  30. LPCSTR m_lpszClassName;
  31. int m_nObjectSize;
  32. UINT m_wSchema; // schema number of the loaded class
  33. CObject* (PASCAL* m_pfnCreateObject)(); // NULL => abstract class
  34. #ifdef _AFXDLL
  35. CRuntimeClass* (PASCAL* m_pfnGetBaseClass)();
  36. #else
  37. CRuntimeClass* m_pBaseClass;
  38. #endif
  39. // Operations
  40. CObject* CreateObject();
  41. BOOL IsDerivedFrom(const CRuntimeClass* pBaseClass) const;
  42. // Implementation
  43. // void Store(CArchive& ar) const;
  44. // static CRuntimeClass* PASCAL Load(CArchive& ar, UINT* pwSchemaNum);
  45. // CRuntimeClass objects linked together in simple list
  46. CRuntimeClass* m_pNextClass; // linked list of registered classes
  47. };
  48. class CObject
  49. {
  50. public:
  51. // Object model (types, destruction, allocation)
  52. //virtual CRuntimeClass* GetRuntimeClass() const;
  53. virtual ~CObject(); // virtual destructors are necessary
  54. // Diagnostic allocations
  55. void* PASCAL operator new(size_t nSize);
  56. void* PASCAL operator new(size_t, void* p);
  57. void PASCAL operator delete(void* p);
  58. #if defined(_DEBUG) && !defined(_AFX_NO_DEBUG_CRT)
  59. // for file name/line number tracking using DEBUG_NEW
  60. void* PASCAL operator new(size_t nSize, LPCSTR lpszFileName, int nLine);
  61. #endif
  62. // Disable the copy constructor and assignment by default so you will get
  63. // compiler errors instead of unexpected behaviour if you pass objects
  64. // by value or assign objects.
  65. protected:
  66. CObject();
  67. private:
  68. CObject(const CObject& objectSrc); // no implementation
  69. void operator=(const CObject& objectSrc); // no implementation
  70. // Attributes
  71. public:
  72. BOOL IsSerializable() const;
  73. //BOOL IsKindOf(const CRuntimeClass* pClass) const;
  74. // Overridables
  75. // virtual void Serialize(CArchive& ar);
  76. // Diagnostic Support
  77. virtual void AssertValid() const;
  78. // virtual void Dump(CDumpContext& dc) const;
  79. // Implementation
  80. public:
  81. // static const AFX_DATA CRuntimeClass classCObject;
  82. #ifdef _AFXDLL
  83. //static CRuntimeClass* PASCAL _GetBaseClass();
  84. #endif
  85. };
  86. // Helper macros
  87. //#define RUNTIME_CLASS(class_name) ((CRuntimeClass*)(&class_name::class##class_name))
  88. #define ASSERT_KINDOF(class_name, object) \
  89. ASSERT((object)->IsKindOf(RUNTIME_CLASS(class_name)))
  90. /////////////////////////////////////////////////////////////////////////////
  91. class CString; // growable string type
  92. struct CStringData
  93. {
  94. long nRefs; // reference count
  95. int nDataLength;
  96. int nAllocLength;
  97. // TCHAR data[nAllocLength]
  98. TCHAR* data()
  99. { return (TCHAR*)(this+1); }
  100. };
  101. class CString
  102. {
  103. public:
  104. // Constructors
  105. CString();
  106. CString(const CString& stringSrc);
  107. CString(TCHAR ch, int nRepeat = 1);
  108. CString(LPCSTR lpsz);
  109. CString(LPCWSTR lpsz);
  110. CString(LPCTSTR lpch, int nLength);
  111. CString(const unsigned char* psz);
  112. // Attributes & Operations
  113. // as an array of characters
  114. int GetLength() const;
  115. BOOL IsEmpty() const;
  116. void Empty(); // free up the data
  117. TCHAR GetAt(int nIndex) const; // 0 based
  118. TCHAR operator[](int nIndex) const; // same as GetAt
  119. void SetAt(int nIndex, TCHAR ch);
  120. operator LPCTSTR() const; // as a C string
  121. // overloaded assignment
  122. const CString& operator=(const CString& stringSrc);
  123. const CString& operator=(TCHAR ch);
  124. #ifdef _UNICODE
  125. const CString& operator=(char ch);
  126. #endif
  127. const CString& operator=(LPCSTR lpsz);
  128. const CString& operator=(LPCWSTR lpsz);
  129. const CString& operator=(const unsigned char* psz);
  130. // string concatenation
  131. const CString& operator+=(const CString& string);
  132. const CString& operator+=(TCHAR ch);
  133. #ifdef _UNICODE
  134. const CString& operator+=(char ch);
  135. #endif
  136. const CString& operator+=(LPCTSTR lpsz);
  137. friend CString AFXAPI operator+(const CString& string1,
  138. const CString& string2);
  139. friend CString AFXAPI operator+(const CString& string, TCHAR ch);
  140. friend CString AFXAPI operator+(TCHAR ch, const CString& string);
  141. #ifdef _UNICODE
  142. friend CString AFXAPI operator+(const CString& string, char ch);
  143. friend CString AFXAPI operator+(char ch, const CString& string);
  144. #endif
  145. friend CString AFXAPI operator+(const CString& string, LPCTSTR lpsz);
  146. friend CString AFXAPI operator+(LPCTSTR lpsz, const CString& string);
  147. // string comparison
  148. int Compare(LPCTSTR lpsz) const; // straight character
  149. int CompareNoCase(LPCTSTR lpsz) const; // ignore case
  150. int Collate(LPCTSTR lpsz) const; // NLS aware
  151. // simple sub-string extraction
  152. CString Mid(int nFirst, int nCount) const;
  153. CString Mid(int nFirst) const;
  154. CString Left(int nCount) const;
  155. CString Right(int nCount) const;
  156. CString SpanIncluding(LPCTSTR lpszCharSet) const;
  157. CString SpanExcluding(LPCTSTR lpszCharSet) const;
  158. // upper/lower/reverse conversion
  159. void MakeUpper();
  160. void MakeLower();
  161. void MakeReverse();
  162. // trimming whitespace (either side)
  163. void TrimRight();
  164. void TrimLeft();
  165. // searching (return starting index, or -1 if not found)
  166. // look for a single character match
  167. int Find(TCHAR ch) const; // like "C" strchr
  168. int ReverseFind(TCHAR ch) const;
  169. int FindOneOf(LPCTSTR lpszCharSet) const;
  170. // look for a specific sub-string
  171. int Find(LPCTSTR lpszSub) const; // like "C" strstr
  172. // simple formatting
  173. void AFX_CDECL Format(LPCTSTR lpszFormat, ...);
  174. void AFX_CDECL Format(UINT nFormatID, ...);
  175. // formatting for localization (uses FormatMessage API)
  176. void AFX_CDECL FormatMessage(LPCTSTR lpszFormat, ...);
  177. void AFX_CDECL FormatMessage(UINT nFormatID, ...);
  178. // input and output
  179. #ifdef _DEBUG
  180. // friend CDumpContext& AFXAPI operator<<(CDumpContext& dc, const CString& string);
  181. #endif
  182. // friend CArchive& AFXAPI operator<<(CArchive& ar, const CString& string);
  183. // friend CArchive& AFXAPI operator>>(CArchive& ar, CString& string);
  184. // Windows support
  185. //BOOL LoadString(UINT nID); // load from string resource
  186. // 255 chars max
  187. #ifndef _UNICODE
  188. // ANSI <-> OEM support (convert string in place)
  189. void AnsiToOem();
  190. void OemToAnsi();
  191. #endif
  192. #ifndef _AFX_NO_BSTR_SUPPORT
  193. // OLE BSTR support (use for OLE automation)
  194. BSTR AllocSysString() const;
  195. BSTR SetSysString(BSTR* pbstr) const;
  196. #endif
  197. // Access to string implementation buffer as "C" character array
  198. LPTSTR GetBuffer(int nMinBufLength);
  199. void ReleaseBuffer(int nNewLength = -1);
  200. LPTSTR GetBufferSetLength(int nNewLength);
  201. void FreeExtra();
  202. // Use LockBuffer/UnlockBuffer to turn refcounting off
  203. LPTSTR LockBuffer();
  204. void UnlockBuffer();
  205. // Implementation
  206. public:
  207. ~CString();
  208. int GetAllocLength() const;
  209. protected:
  210. LPTSTR m_pchData; // pointer to ref counted string data
  211. // implementation helpers
  212. CStringData* GetData() const;
  213. void Init();
  214. //{ m_pchData = afxEmptyString.m_pchData; }
  215. void AllocCopy(CString& dest, int nCopyLen, int nCopyIndex, int nExtraLen) const;
  216. void AllocBuffer(int nLen);
  217. void AssignCopy(int nSrcLen, LPCTSTR lpszSrcData);
  218. void ConcatCopy(int nSrc1Len, LPCTSTR lpszSrc1Data, int nSrc2Len, LPCTSTR lpszSrc2Data);
  219. void ConcatInPlace(int nSrcLen, LPCTSTR lpszSrcData);
  220. void FormatV(LPCTSTR lpszFormat, va_list argList);
  221. void CopyBeforeWrite();
  222. void AllocBeforeWrite(int nLen);
  223. void Release();
  224. static void PASCAL Release(CStringData* pData);
  225. static int PASCAL SafeStrlen(LPCTSTR lpsz);
  226. };
  227. // Compare helpers
  228. inline BOOL AFXAPI operator==(const CString& s1, const CString& s2);
  229. inline BOOL AFXAPI operator==(const CString& s1, LPCTSTR s2);
  230. inline BOOL AFXAPI operator==(LPCTSTR s1, const CString& s2);
  231. inline BOOL AFXAPI operator!=(const CString& s1, const CString& s2);
  232. inline BOOL AFXAPI operator!=(const CString& s1, LPCTSTR s2);
  233. inline BOOL AFXAPI operator!=(LPCTSTR s1, const CString& s2);
  234. inline BOOL AFXAPI operator<(const CString& s1, const CString& s2);
  235. inline BOOL AFXAPI operator<(const CString& s1, LPCTSTR s2);
  236. inline BOOL AFXAPI operator<(LPCTSTR s1, const CString& s2);
  237. inline BOOL AFXAPI operator>(const CString& s1, const CString& s2);
  238. inline BOOL AFXAPI operator>(const CString& s1, LPCTSTR s2);
  239. inline BOOL AFXAPI operator>(LPCTSTR s1, const CString& s2);
  240. inline BOOL AFXAPI operator<=(const CString& s1, const CString& s2);
  241. inline BOOL AFXAPI operator<=(const CString& s1, LPCTSTR s2);
  242. inline BOOL AFXAPI operator<=(LPCTSTR s1, const CString& s2);
  243. inline BOOL AFXAPI operator>=(const CString& s1, const CString& s2);
  244. inline BOOL AFXAPI operator>=(const CString& s1, LPCTSTR s2);
  245. inline BOOL AFXAPI operator>=(LPCTSTR s1, const CString& s2);
  246. class CMapStringToPtr //: public CObject
  247. {
  248. //DECLARE_DYNAMIC(CMapStringToPtr)
  249. protected:
  250. // Association
  251. struct CAssoc
  252. {
  253. CAssoc* pNext;
  254. UINT nHashValue; // needed for efficient iteration
  255. CString key;
  256. void* value;
  257. };
  258. public:
  259. // Construction
  260. CMapStringToPtr(int nBlockSize = 10);
  261. // Attributes
  262. // number of elements
  263. int GetCount() const;
  264. BOOL IsEmpty() const;
  265. // Lookup
  266. BOOL Lookup(LPCTSTR key, void*& rValue) const;
  267. BOOL LookupKey(LPCTSTR key, LPCTSTR& rKey) const;
  268. // Operations
  269. // Lookup and add if not there
  270. void*& operator[](LPCTSTR key);
  271. // add a new (key, value) pair
  272. void SetAt(LPCTSTR key, void* newValue);
  273. // removing existing (key, ?) pair
  274. BOOL RemoveKey(LPCTSTR key);
  275. void RemoveAll();
  276. // iterating all (key, value) pairs
  277. POSITION GetStartPosition() const;
  278. void GetNextAssoc(POSITION& rNextPosition, CString& rKey, void*& rValue) const;
  279. // advanced features for derived classes
  280. UINT GetHashTableSize() const;
  281. void InitHashTable(UINT hashSize, BOOL bAllocNow = TRUE);
  282. // Overridables: special non-virtual (see map implementation for details)
  283. // Routine used to user-provided hash keys
  284. UINT HashKey(LPCTSTR key) const;
  285. // Implementation
  286. protected:
  287. CAssoc** m_pHashTable;
  288. UINT m_nHashTableSize;
  289. int m_nCount;
  290. CAssoc* m_pFreeList;
  291. struct CPlex* m_pBlocks;
  292. int m_nBlockSize;
  293. CAssoc* NewAssoc();
  294. void FreeAssoc(CAssoc*);
  295. CAssoc* GetAssocAt(LPCTSTR, UINT&) const;
  296. public:
  297. ~CMapStringToPtr();
  298. #ifdef _DEBUG
  299. // void Dump(CDumpContext&) const;
  300. void AssertValid() const;
  301. #endif
  302. protected:
  303. // local typedefs for CTypedPtrMap class template
  304. typedef CString BASE_KEY;
  305. typedef LPCTSTR BASE_ARG_KEY;
  306. typedef void* BASE_VALUE;
  307. typedef void* BASE_ARG_VALUE;
  308. };
  309. /////////////////////////////////////////////////////////////////////////////
  310. class CMapStringToOb : public CObject
  311. {
  312. // DECLARE_SERIAL(CMapStringToOb)
  313. protected:
  314. // Association
  315. struct CAssoc
  316. {
  317. CAssoc* pNext;
  318. UINT nHashValue; // needed for efficient iteration
  319. CString key;
  320. CObject* value;
  321. };
  322. public:
  323. // Construction
  324. CMapStringToOb(int nBlockSize = 10);
  325. // Attributes
  326. // number of elements
  327. int GetCount() const;
  328. BOOL IsEmpty() const;
  329. // Lookup
  330. BOOL Lookup(LPCTSTR key, CObject*& rValue) const;
  331. BOOL LookupKey(LPCTSTR key, LPCTSTR& rKey) const;
  332. // Operations
  333. // Lookup and add if not there
  334. CObject*& operator[](LPCTSTR key);
  335. // add a new (key, value) pair
  336. void SetAt(LPCTSTR key, CObject* newValue);
  337. // removing existing (key, ?) pair
  338. BOOL RemoveKey(LPCTSTR key);
  339. void RemoveAll();
  340. // iterating all (key, value) pairs
  341. POSITION GetStartPosition() const;
  342. void GetNextAssoc(POSITION& rNextPosition, CString& rKey, CObject*& rValue) const;
  343. // advanced features for derived classes
  344. UINT GetHashTableSize() const;
  345. void InitHashTable(UINT hashSize, BOOL bAllocNow = TRUE);
  346. // Overridables: special non-virtual (see map implementation for details)
  347. // Routine used to user-provided hash keys
  348. UINT HashKey(LPCTSTR key) const;
  349. // Implementation
  350. protected:
  351. CAssoc** m_pHashTable;
  352. UINT m_nHashTableSize;
  353. int m_nCount;
  354. CAssoc* m_pFreeList;
  355. struct CPlex* m_pBlocks;
  356. int m_nBlockSize;
  357. CAssoc* NewAssoc();
  358. void FreeAssoc(CAssoc*);
  359. CAssoc* GetAssocAt(LPCTSTR, UINT&) const;
  360. public:
  361. ~CMapStringToOb();
  362. // void Serialize(CArchive&);
  363. #ifdef _DEBUG
  364. // void Dump(CDumpContext&) const;
  365. void AssertValid() const;
  366. #endif
  367. protected:
  368. // local typedefs for CTypedPtrMap class template
  369. typedef CString BASE_KEY;
  370. typedef LPCTSTR BASE_ARG_KEY;
  371. typedef CObject* BASE_VALUE;
  372. typedef CObject* BASE_ARG_VALUE;
  373. };
  374. /////////////////////////////////////////////////////////////////////////////
  375. class CMapPtrToPtr //: public CObject
  376. {
  377. //DECLARE_DYNAMIC(CMapPtrToPtr)
  378. #ifndef unix
  379. protected:
  380. #else
  381. // If this is not made public we get:
  382. // "map_pp.cxx", line 114: Warning (Anachronism): CMapPtrToPtr::CAssoc is not accessible from file level.
  383. public:
  384. #endif /* unix */
  385. // Association
  386. struct CAssoc
  387. {
  388. CAssoc* pNext;
  389. void* key;
  390. void* value;
  391. };
  392. public:
  393. // Construction
  394. CMapPtrToPtr(int nBlockSize = 10);
  395. // Attributes
  396. // number of elements
  397. int GetCount() const;
  398. BOOL IsEmpty() const;
  399. // Lookup
  400. BOOL Lookup(void* key, void*& rValue) const;
  401. // Operations
  402. // Lookup and add if not there
  403. void*& operator[](void* key);
  404. // add a new (key, value) pair
  405. void SetAt(void* key, void* newValue);
  406. // removing existing (key, ?) pair
  407. BOOL RemoveKey(void* key);
  408. void RemoveAll();
  409. // iterating all (key, value) pairs
  410. POSITION GetStartPosition() const;
  411. void GetNextAssoc(POSITION& rNextPosition, void*& rKey, void*& rValue) const;
  412. // advanced features for derived classes
  413. UINT GetHashTableSize() const;
  414. void InitHashTable(UINT hashSize, BOOL bAllocNow = TRUE);
  415. // Overridables: special non-virtual (see map implementation for details)
  416. // Routine used to user-provided hash keys
  417. UINT HashKey(void* key) const;
  418. // Implementation
  419. protected:
  420. CAssoc** m_pHashTable;
  421. UINT m_nHashTableSize;
  422. int m_nCount;
  423. CAssoc* m_pFreeList;
  424. struct CPlex* m_pBlocks;
  425. int m_nBlockSize;
  426. CAssoc* NewAssoc();
  427. void FreeAssoc(CAssoc*);
  428. CAssoc* GetAssocAt(void*, UINT&) const;
  429. public:
  430. ~CMapPtrToPtr();
  431. #ifdef _DEBUG
  432. // void Dump(CDumpContext&) const;
  433. void AssertValid() const;
  434. #endif
  435. void* GetValueAt(void* key) const;
  436. protected:
  437. // local typedefs for CTypedPtrMap class template
  438. typedef void* BASE_KEY;
  439. typedef void* BASE_ARG_KEY;
  440. typedef void* BASE_VALUE;
  441. typedef void* BASE_ARG_VALUE;
  442. };
  443. class CArchive
  444. {
  445. public:
  446. // Flag values
  447. enum Mode { store = 0, load = 1, bNoFlushOnDelete = 2, bNoByteSwap = 4 };
  448. //CArchive(CFile* pFile, UINT nMode, int nBufSize = 4096, void* lpBuf = NULL);
  449. ~CArchive();
  450. // Attributes
  451. #ifndef unix
  452. BOOL IsLoading() const;
  453. BOOL IsStoring() const;
  454. BOOL IsByteSwapping() const;
  455. BOOL IsBufferEmpty() const;
  456. #else
  457. // In UNIX all the member functions which are defined here somehow
  458. // referenced by notifictn/notifhlp.cxx. WIthout these we get undefined symbol
  459. // references on UNIX. So I added these. -Pravin.
  460. BOOL IsLoading() const { return TRUE; }
  461. BOOL IsStoring() const { return TRUE; }
  462. BOOL IsByteSwapping() const { return TRUE;}
  463. BOOL IsBufferEmpty() const { return TRUE; }
  464. #endif /* !unix */
  465. //CFile* GetFile() const;
  466. UINT GetObjectSchema(); // only valid when reading a CObject*
  467. void SetObjectSchema(UINT nSchema);
  468. // pointer to document being serialized -- must set to serialize
  469. // COleClientItems in a document!
  470. //CDocument* m_pDocument;
  471. // Operations
  472. #ifndef unix
  473. UINT Read(void* lpBuf, UINT nMax);
  474. void Write(const void* lpBuf, UINT nMax);
  475. #else
  476. UINT Read(void* lpBuf, UINT nMax) { return 0; }
  477. void Write(const void* lpBuf, UINT nMax) { return; }
  478. #endif /* !unix */
  479. void Flush();
  480. void Close();
  481. void Abort(); // close and shutdown without exceptions
  482. // reading and writing strings
  483. void WriteString(LPCTSTR lpsz);
  484. LPTSTR ReadString(LPTSTR lpsz, UINT nMax);
  485. BOOL ReadString(CString& rString);
  486. public:
  487. // Object I/O is pointer based to avoid added construction overhead.
  488. // Use the Serialize member function directly for embedded objects.
  489. friend CArchive& AFXAPI operator<<(CArchive& ar, const CObject* pOb);
  490. friend CArchive& AFXAPI operator>>(CArchive& ar, CObject*& pOb);
  491. friend CArchive& AFXAPI operator>>(CArchive& ar, const CObject*& pOb);
  492. // insertion operations
  493. CArchive& operator<<(BYTE by);
  494. CArchive& operator<<(WORD w);
  495. CArchive& operator<<(LONG l);
  496. CArchive& operator<<(DWORD dw);
  497. CArchive& operator<<(float f);
  498. CArchive& operator<<(double d);
  499. CArchive& operator<<(int i);
  500. CArchive& operator<<(short w);
  501. CArchive& operator<<(char ch);
  502. CArchive& operator<<(unsigned u);
  503. // extraction operations
  504. CArchive& operator>>(BYTE& by);
  505. CArchive& operator>>(WORD& w);
  506. CArchive& operator>>(DWORD& dw);
  507. CArchive& operator>>(LONG& l);
  508. CArchive& operator>>(float& f);
  509. CArchive& operator>>(double& d);
  510. CArchive& operator>>(int& i);
  511. CArchive& operator>>(short& w);
  512. CArchive& operator>>(char& ch);
  513. CArchive& operator>>(unsigned& u);
  514. // object read/write
  515. CObject* ReadObject(const CRuntimeClass* pClass);
  516. void WriteObject(const CObject* pOb);
  517. // advanced object mapping (used for forced references)
  518. void MapObject(const CObject* pOb);
  519. // advanced versioning support
  520. void WriteClass(const CRuntimeClass* pClassRef);
  521. CRuntimeClass* ReadClass(const CRuntimeClass* pClassRefRequested = NULL,
  522. UINT* pSchema = NULL, DWORD* pObTag = NULL);
  523. void SerializeClass(const CRuntimeClass* pClassRef);
  524. // advanced operations (used when storing/loading many objects)
  525. void SetStoreParams(UINT nHashSize = 2053, UINT nBlockSize = 128);
  526. void SetLoadParams(UINT nGrowBy = 1024);
  527. // Implementation
  528. public:
  529. BOOL m_bForceFlat; // for COleClientItem implementation (default TRUE)
  530. BOOL m_bDirectBuffer; // TRUE if m_pFile supports direct buffering
  531. void FillBuffer(UINT nBytesNeeded);
  532. void CheckCount(); // throw exception if m_nMapCount is too large
  533. // special functions for reading and writing (16-bit compatible) counts
  534. #ifndef unix
  535. DWORD ReadCount();
  536. void WriteCount(DWORD dwCount);
  537. #else
  538. DWORD ReadCount() { return 0; }
  539. void WriteCount(DWORD dwCount) { return; }
  540. #endif /* !unix */
  541. // public for advanced use
  542. UINT m_nObjectSchema;
  543. CString m_strFileName;
  544. protected:
  545. // archive objects cannot be copied or assigned
  546. CArchive(const CArchive& arSrc);
  547. void operator=(const CArchive& arSrc);
  548. BOOL m_nMode;
  549. BOOL m_bUserBuf;
  550. int m_nBufSize;
  551. //CFile* m_pFile;
  552. BYTE* m_lpBufCur;
  553. BYTE* m_lpBufMax;
  554. BYTE* m_lpBufStart;
  555. // array/map for CObject* and CRuntimeClass* load/store
  556. UINT m_nMapCount;
  557. union
  558. {
  559. //CPtrArray* m_pLoadArray;
  560. CMapPtrToPtr* m_pStoreMap;
  561. };
  562. // map to keep track of mismatched schemas
  563. CMapPtrToPtr* m_pSchemaMap;
  564. // advanced parameters (controls performance with large archives)
  565. UINT m_nGrowSize;
  566. UINT m_nHashSize;
  567. };
  568. /////////////////////////////////////////////////////////////////////////////
  569. // Inline function declarations
  570. #define _AFX_ENABLE_INLINES
  571. #ifdef _AFX_ENABLE_INLINES
  572. #define _AFXCOLL_INLINE inline
  573. #define _AFX_INLINE inline
  574. #include "collinl.hxx"
  575. #endif
  576. #include "afxtempl.h"
  577. #endif // __cplusplus
  578. #endif // __COLL_HXX__