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.

113 lines
2.3 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. schemaextensions.h
  5. Abstract:
  6. This file contains the definition of the CSchemaExtensions class.
  7. This is the only class that talks to the catalog.
  8. Author:
  9. MarcelV
  10. Revision History:
  11. Mohit Srivastava 28-Nov-00
  12. --*/
  13. #ifndef _schemaextensions_h_
  14. #define _schemaextensions_h_
  15. #include "catalog.h"
  16. #include "catmeta.h"
  17. #include <atlbase.h>
  18. //forward decl
  19. struct CTableMeta;
  20. struct CColumnMeta
  21. {
  22. CColumnMeta() {paTags = 0; cbDefaultValue = 0; cNrTags = 0;}
  23. ~CColumnMeta() {delete [] paTags;}
  24. tCOLUMNMETARow ColumnMeta;
  25. ULONG cbDefaultValue;
  26. ULONG cNrTags;
  27. tTAGMETARow **paTags;
  28. };
  29. struct CTableMeta
  30. {
  31. CTableMeta () {paColumns=0;}
  32. ~CTableMeta () {delete []paColumns;}
  33. ULONG ColCount () const
  34. {
  35. return *(TableMeta.pCountOfColumns);
  36. }
  37. tTABLEMETARow TableMeta;
  38. CColumnMeta **paColumns;
  39. };
  40. typedef tTAGMETARow * LPtTAGMETA;
  41. typedef CColumnMeta * LPCColumnMeta;
  42. class CSchemaExtensions
  43. {
  44. public:
  45. CSchemaExtensions ();
  46. ~CSchemaExtensions ();
  47. HRESULT Initialize (bool i_bUseExtensions = true);
  48. CTableMeta* EnumTables(ULONG *io_idx);
  49. HRESULT GetMbSchemaTimeStamp(FILETIME* io_pFileTime) const;
  50. private:
  51. HRESULT GenerateIt ();
  52. HRESULT GetTables ();
  53. HRESULT GetColumns ();
  54. HRESULT GetTags ();
  55. HRESULT GetRelations ();
  56. HRESULT BuildInternalStructures ();
  57. CComPtr<ISimpleTableDispenser2> m_spDispenser;
  58. CComPtr<IMetabaseSchemaCompiler> m_spIMbSchemaComp;
  59. CComPtr<ISimpleTableRead2> m_spISTTableMeta;
  60. CComPtr<ISimpleTableRead2> m_spISTColumnMeta;
  61. CComPtr<ISimpleTableRead2> m_spISTTagMeta;
  62. CComPtr<ISimpleTableRead2> m_spISTRelationMeta;
  63. LPWSTR m_wszBinFileName;
  64. LPTSTR m_tszBinFilePath;
  65. CTableMeta* m_paTableMetas; // all table information
  66. ULONG m_cNrTables;
  67. CColumnMeta* m_paColumnMetas; // all column information
  68. ULONG m_cNrColumns;
  69. tTAGMETARow* m_paTags; // all tag information
  70. ULONG m_cNrTags;
  71. ULONG m_cQueryCells;
  72. STQueryCell* m_pQueryCells;
  73. bool m_bBinFileLoaded;
  74. };
  75. #endif // _schemaextensions_h_