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.

105 lines
2.5 KiB

  1. //-----------------------------------------------------------------------------
  2. //
  3. // File: optvalset.h
  4. // Copyright (C) 1994-1997 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. //
  8. //
  9. //-----------------------------------------------------------------------------
  10. #pragma once
  11. #pragma warning(disable: 4275) // non dll-interface class 'foo' used
  12. // as base for dll-interface class 'bar'
  13. class LTAPIENTRY CLocOptionValEnumCallback : public CObject
  14. {
  15. public:
  16. CLocOptionValEnumCallback() {};
  17. void AssertValid(void) const;
  18. virtual BOOL ProcessOption(CLocOptionVal *) = 0;
  19. virtual BOOL ProcessOption(const CLocOptionVal *) = 0;
  20. private:
  21. CLocOptionValEnumCallback(const CLocOptionValEnumCallback &);
  22. void operator=(int);
  23. };
  24. class LTAPIENTRY CLocOptionValSet;
  25. class LTAPIENTRY CLocOptionValSetList :
  26. public CTypedPtrList<CPtrList, CLocOptionValSet *>
  27. {
  28. public:
  29. NOTHROW CLocOptionValSetList() {};
  30. void AssertValid(void) const;
  31. NOTHROW void ReleaseAll();
  32. NOTHROW ~CLocOptionValSetList();
  33. private:
  34. CLocOptionValSetList(const CLocOptionValSetList &);
  35. void operator=(const CLocOptionValSetList &);
  36. };
  37. class LTAPIENTRY CLocOptionValSet : public CRefCount, public CObject
  38. {
  39. public:
  40. NOTHROW CLocOptionValSet();
  41. void AssertValid(void) const;
  42. NOTHROW void AddOption(CLocOptionVal *);
  43. NOTHROW void AddOptionSet(CLocOptionValSet *);
  44. NOTHROW void SetName(const CLString &);
  45. NOTHROW const CLocOptionValList & GetOptionList(void) const;
  46. NOTHROW const CLocOptionValSetList & GetOptionSets(void) const;
  47. NOTHROW BOOL FindOptionVal(const CLString &, CLocOptionVal *&pOption);
  48. NOTHROW BOOL FindOptionVal(const CLString &, const CLocOptionVal *&pOption) const;
  49. NOTHROW const CLString & GetName(void) const;
  50. NOTHROW BOOL IsEmpty(void) const;
  51. BOOL EnumOptions(CLocOptionValEnumCallback *);
  52. BOOL EnumOptions(CLocOptionValEnumCallback *) const;
  53. //
  54. // Escape hatch.
  55. //
  56. NOTHROW void * GetPExtra(void) const;
  57. NOTHROW DWORD GetDWExtra(void) const;
  58. NOTHROW void SetExtra(void *);
  59. NOTHROW void SetExtra(DWORD);
  60. protected:
  61. NOTHROW virtual ~CLocOptionValSet();
  62. private:
  63. CLocOptionValList m_olOptions;
  64. CLocOptionValSetList m_oslSubOptions;
  65. CLString m_strName;
  66. union
  67. {
  68. void *m_pExtra;
  69. DWORD m_dwExtra;
  70. };
  71. CLocOptionValSet(const CLocOptionValSet &);
  72. void operator=(const CLocOptionValSet &);
  73. };
  74. #pragma warning(default: 4275)
  75. #if !defined(_DEBUG) || defined(IMPLEMENT)
  76. #include "optvalset.inl"
  77. #endif