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.

105 lines
2.3 KiB

  1. //***************************************************************************
  2. //
  3. // Copyright � Microsoft Corporation. All rights reserved.
  4. //
  5. // analyser.h
  6. //
  7. // Purpose: query analysis support.
  8. //
  9. //***************************************************************************
  10. #if _MSC_VER > 1000
  11. #pragma once
  12. #endif
  13. #ifndef __WBEM_ANALYSER__H_
  14. #define __WBEM_ANALYSER__H_
  15. #include <stdio.h>
  16. #pragma warning(4 : 4275 4800 4786 4251)
  17. #include <wbemidl.h>
  18. #include <GenLex.h>
  19. #include <SQLLex.h>
  20. #include <SQL_1.h> // SQL level 1 tokens and expressions
  21. #include <chstring.h>
  22. #include <chstrarr.h>
  23. #include <comdef.h>
  24. #include <vector>
  25. #define DELETE_ME
  26. //-----------------------------
  27. class CQueryAnalyser
  28. {
  29. public:
  30. static HRESULT WINAPI GetNecessaryQueryForProperty (
  31. IN SQL_LEVEL_1_RPN_EXPRESSION *pExpr,
  32. IN LPCWSTR wszPropName,
  33. DELETE_ME SQL_LEVEL_1_RPN_EXPRESSION *&pNewExpr
  34. ) ;
  35. static HRESULT WINAPI GetValuesForProp (
  36. SQL_LEVEL_1_RPN_EXPRESSION *pExpr,
  37. LPCWSTR wszPropName,
  38. CHStringArray& awsVals
  39. ) ;
  40. // overloaded version in case client wants to use vector of _bstr_t's:
  41. static HRESULT WINAPI GetValuesForProp (
  42. SQL_LEVEL_1_RPN_EXPRESSION *pExpr,
  43. LPCWSTR wszPropName,
  44. std::vector<_bstr_t> &vectorVals
  45. ) ;
  46. static HRESULT WINAPI GetValuesForProp (
  47. SQL_LEVEL_1_RPN_EXPRESSION *pExpr,
  48. LPCWSTR wszPropName,
  49. std::vector<int> &vectorVals
  50. );
  51. static HRESULT WINAPI GetValuesForProp (
  52. SQL_LEVEL_1_RPN_EXPRESSION *pExpr,
  53. LPCWSTR wszPropName,
  54. std::vector<_variant_t> &vectorVals
  55. ) ;
  56. protected:
  57. static BOOL WINAPI IsTokenAboutProperty (
  58. IN SQL_LEVEL_1_TOKEN &Token,
  59. IN LPCWSTR wszPropName
  60. ) ;
  61. static void WINAPI AppendQueryExpression (
  62. IN SQL_LEVEL_1_RPN_EXPRESSION *pDest,
  63. IN SQL_LEVEL_1_RPN_EXPRESSION *pSource
  64. ) ;
  65. static HRESULT WINAPI AndQueryExpressions (
  66. IN SQL_LEVEL_1_RPN_EXPRESSION *pFirst,
  67. IN SQL_LEVEL_1_RPN_EXPRESSION *pSecond,
  68. OUT SQL_LEVEL_1_RPN_EXPRESSION *pNew
  69. ) ;
  70. static HRESULT WINAPI OrQueryExpressions (
  71. IN SQL_LEVEL_1_RPN_EXPRESSION *pFirst,
  72. IN SQL_LEVEL_1_RPN_EXPRESSION *pSecond,
  73. OUT SQL_LEVEL_1_RPN_EXPRESSION *pNew
  74. );
  75. };
  76. #endif