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.

101 lines
2.7 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1991 - 1992.
  5. //
  6. // File: SKREP.CXX
  7. //
  8. // Contents: Search Key Repository
  9. //
  10. // Classes: CSearchKeyRepository
  11. //
  12. // History: 23-Sep-94 BartoszM Created.
  13. //
  14. //----------------------------------------------------------------------------
  15. #include <pch.cxx>
  16. #pragma hdrstop
  17. #include <mapper.hxx>
  18. #include <recogniz.hxx>
  19. #include "skrep.hxx"
  20. //+---------------------------------------------------------------------------
  21. //
  22. // Member: CSearchKeyRepository::CSearchKeyRepository
  23. //
  24. // Synopsis: Creates a key repository
  25. //
  26. // History: 23-Sep-94 BartoszM Created.
  27. //----------------------------------------------------------------------------
  28. CSearchKeyRepository::CSearchKeyRepository( CRecognizer& recog )
  29. : _recog(recog)
  30. {
  31. }
  32. //+---------------------------------------------------------------------------
  33. //
  34. // Member: CSearchKeyRepository::PutKey
  35. //
  36. // Synopsis: Puts a key
  37. //
  38. // Arguments: cNoiseWordsSkipped -- ignored (used by CQueryKeyRepository::PutKey )
  39. //
  40. // History: 23-Sep-94 BartoszM Created.
  41. //
  42. //
  43. //----------------------------------------------------------------------------
  44. void CSearchKeyRepository::PutKey ( ULONG cNoiseWordsSkipped )
  45. {
  46. ciDebugOut(( DEB_WORDS," PutKey:: %.*ws\n",
  47. _key.StrLen(), _key.GetStr() ));
  48. if ( _recog.Match (_key) )
  49. {
  50. FILTERREGION region;
  51. _pMapper->GetSrcRegion ( region, _srcLen, _srcPos );
  52. // there could be more detectors that match this key
  53. do
  54. _recog.Record ( region, _occ );
  55. while ( _recog.Match (_key) );
  56. }
  57. }
  58. //+---------------------------------------------------------------------------
  59. //
  60. // Member: CSearchKeyRepository::GetBuffers
  61. //
  62. // Synopsis: Returns address of repository's input buffers
  63. //
  64. // Arguments: [ppcbInBuf] -- pointer to pointer to size of input buffer
  65. // [ppbInBuf] -- pointer to pointer to recieve address of buffer
  66. // [ppocc] -- pointer to pointer to recieve address of occurrences
  67. //
  68. // History: 23-Sep-94 BartoszM Created.
  69. //
  70. //----------------------------------------------------------------------------
  71. void CSearchKeyRepository::GetBuffers(
  72. UINT** ppcbWordBuf, BYTE** ppbWordBuf, OCCURRENCE** ppocc )
  73. {
  74. _key.SetCount(MAXKEYSIZE);
  75. *ppcbWordBuf = _key.GetCountAddress();
  76. *ppbWordBuf = _key.GetWritableBuf();
  77. *ppocc = &_occ;
  78. }
  79. void CSearchKeyRepository::GetSourcePosBuffers( ULONG** ppSrcPos, ULONG** ppSrcLen)
  80. {
  81. *ppSrcPos = &_srcPos;
  82. *ppSrcLen = &_srcLen;
  83. }
  84. void CSearchKeyRepository::GetFlags ( BOOL** ppRange, CI_RANK** ppRank )
  85. {
  86. *ppRange = 0;
  87. *ppRank = 0;
  88. }