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.6 KiB

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