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.

62 lines
2.0 KiB

  1. /*****************************************************************************
  2. * ftplist.h
  3. *****************************************************************************/
  4. #ifndef _FTPLIST_H
  5. #define _FTPLIST_H
  6. #include "util.h"
  7. #define FLM_ADDED 0
  8. #define FLM_FINALIZE 1
  9. /*****************************************************************************
  10. *
  11. * CFtpList
  12. *
  13. *****************************************************************************/
  14. class CFtpList : public IUnknown
  15. {
  16. public:
  17. //////////////////////////////////////////////////////
  18. // Public Interfaces
  19. //////////////////////////////////////////////////////
  20. // *** IUnknown ***
  21. virtual STDMETHODIMP_(ULONG) AddRef(void);
  22. virtual STDMETHODIMP_(ULONG) Release(void);
  23. virtual STDMETHODIMP QueryInterface(REFIID riid, LPVOID * ppvObj);
  24. public:
  25. CFtpList(PFNDPAENUMCALLBACK fncDestroy);
  26. ~CFtpList(void);
  27. // Public Member Functions
  28. HRESULT AppendItem(LPVOID pv);
  29. HRESULT InsertSorted(LPVOID pv, PFNDPACOMPARE pfnCompare, LPARAM lParam);
  30. LPVOID GetItemPtr(int nIndex) { return DPA_GetPtr(m_hdpa, nIndex); };
  31. LPVOID Find(PFNDPACOMPARE pfn, LPCVOID pv);
  32. void Enum(PFNDPAENUMCALLBACK pfn, LPVOID pv) { DPA_EnumCallback(m_hdpa, pfn, pv); };
  33. void SetItemPtr(int nIndex, LPVOID pv) { DPA_SetPtr(m_hdpa, nIndex, pv); };
  34. void DeleteItemPtr(LPVOID pv);
  35. void DeletePtrByIndex(int nIndex) {DPA_DeletePtr(m_hdpa, nIndex);};
  36. int GetCount(void) { return DPA_GetPtrCount(m_hdpa); };
  37. int SortedSearch(LPVOID pv, PFNDPACOMPARE pfnCompare, LPARAM lParam, UINT options);
  38. // Friend Functions
  39. friend HRESULT CFtpList_Create(int cpvInit, PFNDPAENUMCALLBACK pfn, UINT nGrow, CFtpList ** ppfl);
  40. protected:
  41. // Private Member Variables
  42. int m_cRef;
  43. HDPA m_hdpa;
  44. PFNDPAENUMCALLBACK m_pfnDestroy;
  45. };
  46. #endif // _FTPLIST_H