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