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.

179 lines
5.6 KiB

  1. //--------------------------------------------------------------------
  2. // Microsoft OLE-DB Monarch
  3. // (C) Copyright 1997 Microsoft Corporation. All Rights Reserved.
  4. //
  5. // @doc
  6. //
  7. // @module PARSER.H | IParserSession object
  8. // definitions
  9. //
  10. //
  11. #ifndef _IPARSERSESSION_H_
  12. #define _IPARSERSESSION_H_
  13. //----------------------------------------------------------------------------
  14. // @class CViewData
  15. //
  16. class CViewData
  17. {
  18. public: //@access public functions
  19. CViewData();
  20. ~CViewData();
  21. LPWSTR m_pwszViewName;
  22. LPWSTR m_pwszCatalogName;
  23. DBCOMMANDTREE* m_pctProjectList;
  24. CScopeData* m_pCScopeData;
  25. CViewData* m_pNextView;
  26. };
  27. //----------------------------------------------------------------------------
  28. // @class CViewList
  29. //
  30. class CViewList
  31. {
  32. public: //@access public functions
  33. CViewList();
  34. ~CViewList();
  35. HRESULT DropViewDefinition( LPWSTR pwszViewName,
  36. LPWSTR pwszCatalogName );
  37. HRESULT SetViewDefinition( CImpIParserSession* pIParsSess,
  38. CImpIParserTreeProperties* pIPTProps,
  39. LPWSTR pwszViewName,
  40. LPWSTR pwszCatalogName,
  41. DBCOMMANDTREE* pctSelectList );
  42. DBCOMMANDTREE* GetViewDefinition( CImpIParserTreeProperties* pIPTProps,
  43. LPWSTR pwszViewName,
  44. LPWSTR pwszCatalogName );
  45. private: //@access private data
  46. CViewData* FindViewDefinition( LPWSTR pwszViewName,
  47. LPWSTR pwszCatalogName );
  48. protected: //@access protected data
  49. CViewData* m_pViewData;
  50. };
  51. //----------------------------------------------------------------------------
  52. // @class CImpIParserSession
  53. //
  54. class CImpIParserSession : public IParserSession
  55. {
  56. private: //@access private member data
  57. LONG m_cRef;
  58. LCID m_lcid;
  59. DWORD m_dwRankingMethod;
  60. GUID m_GuidDialect; // dialect for this session
  61. LPWSTR m_pwszMachine; // provider's current machine
  62. IParserVerify* m_pIPVerify; // unknown part of ParserInput
  63. CViewList* m_pLocalViewList;
  64. CViewList* m_pGlobalViewList;
  65. LPWSTR m_pwszCatalog;
  66. DWORD m_dwSQLDialect;
  67. BOOL m_globalDefinitions;
  68. IColumnMapperCreator* m_pIColMapCreator;
  69. // Critical Section for syncronizing access to session data.
  70. CRITICAL_SECTION m_csSession;
  71. IColumnMapper* m_pColumnMapper;
  72. public: //@access public data
  73. CPropertyList* m_pCPropertyList; // User defined property list
  74. public: //@access public
  75. CImpIParserSession( const GUID* pGuidDialect,
  76. IParserVerify* pIPVerify,
  77. IColumnMapperCreator* pIColMapCreator,
  78. CViewList* pGlobalViewList);
  79. ~CImpIParserSession();
  80. HRESULT FInit(LPCWSTR pwszMachine, CPropertyList** ppGlobalPropertyList);
  81. STDMETHODIMP QueryInterface(
  82. REFIID riid, LPVOID* ppVoid);
  83. STDMETHODIMP_(ULONG) Release (void);
  84. STDMETHODIMP_(ULONG) AddRef (void);
  85. //@cmember ToTree method
  86. STDMETHODIMP ToTree
  87. (
  88. LCID lcid,
  89. LPCWSTR pcwszText,
  90. DBCOMMANDTREE** ppCommandTree,
  91. IParserTreeProperties** ppPTProperties
  92. );
  93. STDMETHODIMP FreeTree
  94. (
  95. DBCOMMANDTREE** ppTree
  96. );
  97. STDMETHODIMP SetCatalog
  98. (
  99. LPCWSTR pcwszCatalog
  100. );
  101. public: //@access public functions
  102. inline IParserVerify* GetIPVerifyPtr()
  103. { return m_pIPVerify; }
  104. inline IColumnMapper* GetColumnMapperPtr()
  105. { return m_pColumnMapper; }
  106. inline void SetColumnMapperPtr(IColumnMapper* pCMapper)
  107. { m_pColumnMapper = pCMapper; }
  108. inline LCID GetLCID()
  109. { return m_lcid; }
  110. inline void SetLCID(LCID lcid)
  111. { m_lcid = lcid; }
  112. inline DWORD GetRankingMethod()
  113. { return m_dwRankingMethod; }
  114. inline void SetRankingMethod(DWORD dwRankingMethod)
  115. { m_dwRankingMethod = dwRankingMethod; }
  116. inline DWORD GetSQLDialect()
  117. { return m_dwSQLDialect; }
  118. inline LPWSTR GetDefaultCatalog()
  119. { return m_pwszCatalog; }
  120. inline LPWSTR GetDefaultMachine()
  121. { return m_pwszMachine; }
  122. inline void SetGlobalDefinition(BOOL fGlobal)
  123. { m_globalDefinitions = fGlobal; }
  124. inline BOOL GetGlobalDefinition()
  125. { return m_globalDefinitions; }
  126. inline CViewList* GetLocalViewList()
  127. { return m_pLocalViewList; }
  128. inline CViewList* GetGlobalViewList()
  129. { return m_pGlobalViewList; }
  130. private: //@access private functions
  131. CImpIParserSession() {};
  132. };
  133. enum DBDIALECTENUM
  134. {
  135. DBDIALECT_UNKNOWN = 0,
  136. DBDIALECT_MSSQLTEXT = 1,
  137. DBDIALECT_MSSQLJAWS = 2
  138. };
  139. #endif