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.

144 lines
1.7 KiB

  1. //-----------------------------------------------------------------------------
  2. //
  3. // File: schema.inl
  4. // Copyright (C) 1994-1997 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. //
  8. //
  9. //-----------------------------------------------------------------------------
  10. inline
  11. SchemaId::SchemaId()
  12. : _GUID(GUID_NULL)
  13. {}
  14. inline
  15. SchemaId::SchemaId(
  16. const _GUID &guid)
  17. : _GUID(guid)
  18. {}
  19. inline
  20. void
  21. SchemaId::Load(
  22. CArchive &ar)
  23. {
  24. if (ar.Read((_GUID *) this, sizeof(_GUID)) != sizeof(_GUID))
  25. {
  26. AfxThrowArchiveException(CArchiveException::endOfFile);
  27. }
  28. }
  29. inline
  30. void
  31. SchemaId::Store(
  32. CArchive &ar)
  33. const
  34. {
  35. ar.Write((_GUID *) this, sizeof(_GUID));
  36. }
  37. inline
  38. void
  39. SchemaId::Serialize(
  40. CArchive &ar)
  41. {
  42. if (ar.IsStoring())
  43. {
  44. Store(ar);
  45. }
  46. else
  47. {
  48. Load(ar);
  49. }
  50. }
  51. inline
  52. const SchemaId &
  53. SchemaId::operator=(
  54. const SchemaId &other)
  55. {
  56. return operator=((_GUID &)other);
  57. }
  58. inline
  59. const SchemaId &
  60. SchemaId::operator=(
  61. const _GUID &other)
  62. {
  63. (_GUID &)(*this) = other;
  64. return *this;
  65. }
  66. inline
  67. int
  68. SchemaId::operator==(
  69. const SchemaId &other)
  70. {
  71. return Compare(other);
  72. }
  73. inline
  74. int
  75. SchemaId::operator!=(
  76. const SchemaId &other)
  77. {
  78. return !Compare(other);
  79. }
  80. inline
  81. BOOL
  82. SchemaId::Compare(
  83. const SchemaId &other)
  84. {
  85. return ((_GUID &)*this) == ((_GUID &)other);
  86. }
  87. inline
  88. const SchemaId &
  89. CTableSchema::GetSchemaId() const
  90. {
  91. return m_Schema;
  92. }
  93. inline
  94. const CLString &
  95. CTableSchema::GetDescription() const
  96. {
  97. return m_strDescription;
  98. }
  99. inline
  100. const CColDefList &
  101. CTableSchema::GetColDefList() const
  102. {
  103. return m_lstColDefs;
  104. }