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.

103 lines
2.7 KiB

  1. //-----------------------------------------------------------------------------
  2. //
  3. // File: var.h
  4. // Copyright (C) 1994-1997 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. //
  8. //
  9. //-----------------------------------------------------------------------------
  10. #ifndef ESPUTIL__VAR_H
  11. #define ESPUTIL__VAR_H
  12. //
  13. // variant object, represents a VARIANT
  14. //
  15. #pragma warning(disable: 4275) // non dll-interface class 'foo' used
  16. // as base for dll-interface class 'bar'
  17. class LTAPIENTRY CVar : public CObject
  18. {
  19. public:
  20. CVar();
  21. CVar(const CVar&);
  22. CVar(VARIANT);
  23. CVar(const CPascalString&);
  24. CVar(PWSTR);
  25. CVar(PCWSTR);
  26. CVar(PSTR);
  27. CVar(PCSTR);
  28. CVar(SHORT);
  29. CVar(WCHAR);
  30. CVar(UINT);
  31. CVar(BOOL);
  32. CVar(BYTE);
  33. CVar(LONG);
  34. CVar(DATE);
  35. CVar(DWORD);
  36. CVar(tm*); // build from a date in tm format
  37. ~CVar();
  38. NOTHROW const CVar& operator = (const CVar &);
  39. NOTHROW const CVar& operator = (VARIANT);
  40. NOTHROW const CVar& operator = (const CPascalString&);
  41. NOTHROW const CVar& operator = (PWSTR);
  42. NOTHROW const CVar& operator = (PCWSTR);
  43. NOTHROW const CVar& operator = (PSTR);
  44. NOTHROW const CVar& operator = (PCSTR);
  45. NOTHROW const CVar& operator = (SHORT);
  46. NOTHROW const CVar& operator = (WCHAR);
  47. NOTHROW const CVar& operator = (UINT);
  48. NOTHROW const CVar& operator = (BOOL);
  49. NOTHROW const CVar& operator = (BYTE);
  50. NOTHROW const CVar& operator = (LONG);
  51. NOTHROW const CVar& operator = (DATE);
  52. NOTHROW const CVar& operator = (DWORD);
  53. NOTHROW operator COleVariant (VOID) const;
  54. NOTHROW operator LPVARIANT (VOID);
  55. NOTHROW operator CPascalString (VOID) const;
  56. NOTHROW operator SHORT (VOID) const;
  57. NOTHROW operator WCHAR (VOID) const;
  58. NOTHROW operator UINT (VOID) const;
  59. NOTHROW operator BOOL (VOID) const;
  60. NOTHROW operator BYTE (VOID) const;
  61. NOTHROW operator LONG (VOID) const;
  62. NOTHROW operator DATE (VOID) const;
  63. NOTHROW operator DWORD (VOID) const;
  64. NOTHROW operator PSTR (VOID) const;
  65. NOTHROW operator PCSTR (VOID) const;
  66. NOTHROW operator PWSTR (VOID) const;
  67. NOTHROW operator PCWSTR (VOID) const;
  68. void AnsiToWide();
  69. void WideToAnsi();
  70. void SetBSTR(BSTR);
  71. void SetStringByteLen(const char * sz, unsigned int ui);
  72. NOTHROW int GetLength();
  73. NOTHROW BOOL IsNull() const;
  74. NOTHROW VOID SetNull();
  75. NOTHROW VOID SetError();
  76. NOTHROW BOOL operator==(const CVar& v) const;
  77. NOTHROW BOOL operator!=(const CVar& v) const;
  78. //
  79. // debug routines
  80. //
  81. virtual void AssertValid() const;
  82. private:
  83. VARIANT m_var;
  84. };
  85. #pragma warning(default: 4275)
  86. #endif //ESPUTIL_VAR_H