Source code of Windows XP (NT5)
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.

195 lines
1.9 KiB

  1. //-----------------------------------------------------------------------------
  2. //
  3. // File: FieldVar.inl
  4. // Copyright (C) 1994-1997 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. //
  8. //
  9. //-----------------------------------------------------------------------------
  10. inline
  11. CColumnVal::CColumnVal()
  12. {
  13. m_cvt = cvtNone;
  14. }
  15. inline
  16. void
  17. CColumnVal::SetString(
  18. const CPascalString &pas)
  19. {
  20. m_cvt = cvtString;
  21. m_pasString = pas;
  22. }
  23. inline
  24. void
  25. CColumnVal::SetLong(
  26. long nValue)
  27. {
  28. m_cvt = cvtLong;
  29. m_long = nValue;
  30. }
  31. inline
  32. void
  33. CColumnVal::SetDate(
  34. const COleDateTime &dt)
  35. {
  36. m_cvt = cvtDate;
  37. m_Time = dt;
  38. }
  39. inline
  40. void
  41. CColumnVal::SetBool(
  42. BOOL b)
  43. {
  44. m_cvt = cvtBool;
  45. m_bool = b;
  46. }
  47. inline
  48. CColumnVal::CColumnVal(
  49. const CColumnVal &other)
  50. {
  51. AssignFrom(other);
  52. }
  53. inline
  54. CColumnVal::CColumnVal(
  55. const CPascalString &pas)
  56. {
  57. SetString(pas);
  58. }
  59. inline
  60. CColumnVal::CColumnVal(
  61. long nValue)
  62. {
  63. SetLong(nValue);
  64. }
  65. inline
  66. CColumnVal::CColumnVal(
  67. const COleDateTime &dt)
  68. {
  69. SetDate(dt);
  70. }
  71. inline
  72. CColumnVal::CColumnVal(
  73. BOOL b)
  74. {
  75. SetBool(b);
  76. }
  77. inline
  78. const CColumnVal &
  79. CColumnVal::operator=(const CColumnVal &other)
  80. {
  81. AssignFrom(other);
  82. return *this;
  83. }
  84. inline
  85. void
  86. CColumnVal::SetStringIndex(
  87. long idxValue)
  88. {
  89. m_cvt = cvtStringList;
  90. m_long = idxValue;
  91. }
  92. inline
  93. CColumnVal::ColumnValType
  94. CColumnVal::GetType()
  95. const
  96. {
  97. return m_cvt;
  98. }
  99. inline
  100. const CPascalString &
  101. CColumnVal::GetString()
  102. const
  103. {
  104. LTASSERT(m_cvt == cvtString);
  105. return m_pasString;
  106. }
  107. inline
  108. long
  109. CColumnVal::GetLong()
  110. const
  111. {
  112. LTASSERT(m_cvt == cvtLong);
  113. return m_long;
  114. }
  115. inline
  116. const COleDateTime &
  117. CColumnVal::GetDate()
  118. const
  119. {
  120. LTASSERT(m_cvt == cvtDate);
  121. return m_Time;
  122. }
  123. inline
  124. BOOL
  125. CColumnVal::GetBool()
  126. const
  127. {
  128. LTASSERT(m_cvt == cvtBool);
  129. return m_bool;
  130. }
  131. inline
  132. long
  133. CColumnVal::GetStringIndex()
  134. const
  135. {
  136. LTASSERT(m_cvt == cvtStringList);
  137. return m_long;
  138. }