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.

111 lines
2.5 KiB

  1. /*++
  2. Copyright (C) 1996-1999 Microsoft Corporation
  3. Module Name:
  4. LOCVAR.H
  5. History:
  6. --*/
  7. // Declaration of CLocVariant, our variant class.
  8. //
  9. #ifndef ESPUTIL_LOCVAR_H
  10. #define ESPUTIL_LOCVAR_H
  11. enum LocVariantType
  12. {
  13. lvtNone,
  14. lvtInteger,
  15. lvtString,
  16. lvtIntPlusString,
  17. lvtBOOL,
  18. lvtBlob,
  19. lvtStringList,
  20. lvtFileName, // stores file name and editing extension string
  21. };
  22. typedef CLocThingList<CPascalString> CPasStringList;
  23. UINT StoreToBlob(const CPasStringList &, CLocCOWBlob &, UINT uiOffset);
  24. UINT LoadFromBlob(CPasStringList &, const CLocCOWBlob &, UINT uiOffset);
  25. #pragma warning(disable : 4275 4251)
  26. class LTAPIENTRY CLocVariant : public CObject
  27. {
  28. public:
  29. NOTHROW CLocVariant();
  30. void AssertValid(void) const;
  31. NOTHROW LocVariantType GetVariantType(void) const;
  32. NOTHROW DWORD GetDword(void) const;
  33. NOTHROW BOOL GetBOOL(void) const;
  34. NOTHROW const CPascalString & GetString(void) const;
  35. NOTHROW const CLocId & GetIntPlusString(void) const;
  36. NOTHROW const CLocCOWBlob & GetBlob(void) const;
  37. NOTHROW const CPasStringList & GetStringList(void) const;
  38. NOTHROW const CLString & GetFileExtensions(void) const;
  39. NOTHROW int operator==(const CLocVariant &) const;
  40. NOTHROW int operator!=(const CLocVariant &) const;
  41. NOTHROW void SetDword(const DWORD);
  42. NOTHROW void SetBOOL(const BOOL);
  43. NOTHROW void SetString(const CPascalString &);
  44. NOTHROW void SetIntPlusString(const CLocId &);
  45. NOTHROW void SetBlob(const CLocCOWBlob &);
  46. NOTHROW void SetStringList(const CPasStringList &);
  47. NOTHROW void SetFileName(const CPascalString &, const CLString &);
  48. NOTHROW const CLocVariant & operator=(const CLocVariant &);
  49. BOOL ImportVariant(const VARIANT& var);
  50. BOOL ExportVariant(VARIANT& var) const;
  51. void Serialize(CArchive &);
  52. void Load(CArchive &);
  53. void Store(CArchive &) const;
  54. protected:
  55. NOTHROW BOOL IsEqualTo(const CLocVariant &) const;
  56. private:
  57. CLocVariant(const CLocVariant &);
  58. LocVariantType m_VarType;
  59. //
  60. // Class objects can't be in a union.
  61. //
  62. union
  63. {
  64. DWORD m_dwInteger;
  65. BOOL m_fBOOL;
  66. };
  67. CPascalString m_psString;
  68. CLocId m_IntPlusString;
  69. CLocCOWBlob m_Blob;
  70. CPasStringList m_StringList;
  71. CLString m_strFileExtensions;
  72. };
  73. #pragma warning(default : 4275 4251)
  74. void Store(CArchive &, const CPasStringList &);
  75. void Load(CArchive &, CPasStringList &);
  76. #if !defined(_DEBUG) || defined(IMPLEMENT)
  77. #include "locvar.inl"
  78. #endif
  79. #endif