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.

79 lines
1.7 KiB

  1. //-----------------------------------------------------------------------------
  2. //
  3. // File: FieldVal.h
  4. // Copyright (C) 1994-1997 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. //
  8. //
  9. //-----------------------------------------------------------------------------
  10. #pragma once
  11. #pragma warning(disable : 4251)
  12. class LTAPIENTRY CColumnVal
  13. {
  14. public:
  15. CColumnVal();
  16. explicit CColumnVal(const CColumnVal & val);
  17. explicit CColumnVal(const CPascalString & pasValue);
  18. explicit CColumnVal(long nValue);
  19. explicit CColumnVal(const COleDateTime & dateValue);
  20. explicit CColumnVal(BOOL fValue);
  21. enum ColumnValType
  22. {
  23. cvtNone,
  24. cvtString,
  25. cvtLong,
  26. cvtDate,
  27. cvtBool,
  28. cvtStringList,
  29. cvtLocTerm
  30. };
  31. void Serialize(CArchive &);
  32. const CColumnVal & operator=(const CColumnVal & val);
  33. void SetString(const CPascalString & pasValue);
  34. void SetLong(const long nValue);
  35. void SetDate(const COleDateTime & dateValue);
  36. void SetBool(const BOOL fValue);
  37. void SetStringIndex(const long nValue);
  38. ColumnValType GetType() const;
  39. const CPascalString &GetString() const;
  40. long GetLong() const;
  41. const COleDateTime & GetDate() const;
  42. BOOL GetBool() const;
  43. long GetStringIndex() const;
  44. int operator==(const CColumnVal &);
  45. int operator!=(const CColumnVal &);
  46. #ifdef LTASSERT_ACTIVE
  47. void AssertValid(void) const;
  48. #endif
  49. private:
  50. BOOL Compare(const CColumnVal & valCompare);
  51. void AssignFrom(const CColumnVal & valSrc);
  52. ColumnValType m_cvt;
  53. union
  54. {
  55. long m_long;
  56. BOOL m_bool;
  57. };
  58. CPascalString m_pasString;
  59. COleDateTime m_Time;
  60. };
  61. typedef CColumnVal CCV;
  62. #pragma warning(default : 4251)
  63. #if !defined(_DEBUG) || defined(IMPLEMENT)
  64. #include "FieldVal.inl"
  65. #endif