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.

196 lines
1.9 KiB

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