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.

96 lines
3.1 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (c) Microsoft Corporation, 1991-1998.
  5. //
  6. // File: QPARSE.HXX
  7. //
  8. // Contents: Query parser
  9. //
  10. // Classes: CQParse -- query parser
  11. //
  12. // History: 19-Sep-91 BartoszM Implemented.
  13. // 19-Jan-93 KyleP Expression --> Restriction
  14. //
  15. //----------------------------------------------------------------------------
  16. #pragma once
  17. class CLangList;
  18. class CRestriction;
  19. class CPidMapper;
  20. //+---------------------------------------------------------------------------
  21. //
  22. // Class: CQParse
  23. //
  24. // Purpose: Parse Query
  25. //
  26. // Interface:
  27. //
  28. // History: 19-Sep-91 BartoszM Created
  29. // 15-Apr-92 AmyA Changed ConvertOccNode to
  30. // ConvertPhraseNode and added
  31. // ConvertProxNode
  32. // 22-Apr-92 AmyA Added ConvertAndNotNode
  33. // 15-Jul-92 MikeHew Extracted converter class
  34. // Eliminated _pExp
  35. // 11-Sep-92 AmyA Added GetStatus
  36. //
  37. //----------------------------------------------------------------------------
  38. class PKeyRepository;
  39. class CQParse
  40. {
  41. public:
  42. CQParse ( CPidMapper & pidmap, CLangList & langList );
  43. CRestriction* Parse ( CRestriction* pRst );
  44. ULONG GetStatus () { return _flags; }
  45. private:
  46. CRestriction* Leaf ( CRestriction* pRst );
  47. void AddLpwstrHelper( CPropertyRestriction * prstProp,
  48. CInternalPropertyRestriction * prstIProp );
  49. void AddLpwstrVectorHelper( CPropertyRestriction * prstProp,
  50. CInternalPropertyRestriction * prstIProp );
  51. void AddLpstrHelper( CPropertyRestriction * prstProp,
  52. CInternalPropertyRestriction * prstIProp );
  53. ULONG _flags;
  54. CPidMapper & _pidmap;
  55. CLangList & _langList;
  56. LCID _lcidSystemDefault; // Default locale of system
  57. };
  58. enum BreakPhraseStatus
  59. {
  60. BP_OK, // No noise
  61. BP_INVALID_PROPERTY, // Couldn't break text
  62. BP_NOISE // Some noise in phrase
  63. };
  64. BreakPhraseStatus BreakPhrase( WCHAR const * phrase,
  65. const CFullPropSpec & ps,
  66. LCID lcid,
  67. ULONG fuzzy,
  68. PKeyRepository& keyRep,
  69. IPhraseSink *pPhraseSink,
  70. CPidMapper & pidMap,
  71. CLangList & langList );
  72. BreakPhraseStatus BreakPhrase( char const * phrase,
  73. const CFullPropSpec & ps,
  74. LCID lcid,
  75. ULONG fuzzy,
  76. PKeyRepository& keyRep,
  77. IPhraseSink *pPhraseSink,
  78. CPidMapper & pidMap,
  79. CLangList & langList );