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.

158 lines
4.2 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1991 - 1992.
  5. //
  6. // File: IKREP.HXX
  7. //
  8. // Contents: Index Key Repository
  9. //
  10. // Classes: CIndexKeyRepository
  11. //
  12. // History: 30-May-91 t-WadeR Created.
  13. // 01-July-91 t-WadeR Added PutPropName
  14. //
  15. //----------------------------------------------------------------------------
  16. #pragma once
  17. #ifdef DISPLAY_INCLUDES
  18. #pragma message( "#include <" __FILE__ ">..." )
  19. #endif
  20. #include <plang.hxx>
  21. #include "ebufhdlr.hxx"
  22. //+---------------------------------------------------------------------------
  23. //
  24. // Class: CIndexKeyRepository
  25. //
  26. // Purpose: Key repository for word repository
  27. //
  28. // History: 30-May-91 t-WadeR Created.
  29. // 01-July-91 t-WadeR Added PutPropName
  30. //
  31. // Notes:
  32. //
  33. //----------------------------------------------------------------------------
  34. class CIndexKeyRepository: public PKeyRepository
  35. {
  36. DECLARE_UNWIND;
  37. friend class CFilterDriver;
  38. public:
  39. CIndexKeyRepository( CEntryBufferHandler& entBufHdlr );
  40. ~CIndexKeyRepository() {};
  41. inline BOOL PutPropId ( PROPID pid );
  42. void PutKey( ULONG cNoiseWordsSkipped );
  43. void GetBuffers( UINT** ppcbWordBuf,
  44. BYTE** ppbWordBuf, OCCURRENCE** ppocc );
  45. void GetFlags ( BOOL** ppRange, CI_RANK** ppRank )
  46. {
  47. *ppRange = 0;
  48. *ppRank = 0;
  49. }
  50. inline void PutWorkId ( WORKID wid );
  51. inline BOOL StoreValue( CFullPropSpec const & ps, CStorageVariant const & var );
  52. inline BOOL StoreSecurity( PSECURITY_DESCRIPTOR pSD, ULONG cbSD );
  53. inline const ULONG GetFilteredBlockCount() const
  54. {
  55. return _entryBufHandler.GetFilteredBlockCount();
  56. }
  57. void InitFilteredBlockCount( ULONG ulMaxFilteredBlocks )
  58. {
  59. _entryBufHandler.InitFilteredBlockCount( ulMaxFilteredBlocks );
  60. }
  61. private:
  62. CKeyBuf _key;
  63. WORKID _wid;
  64. CEntryBufferHandler& _entryBufHandler;
  65. OCCURRENCE _occ;
  66. };
  67. //+---------------------------------------------------------------------------
  68. //
  69. // Member: CIndexKeyRepository::PutPropID
  70. //
  71. // Arguments: [pid] -- Property ID
  72. //
  73. // History: 09-June-91 t-WadeR Created.
  74. //
  75. //----------------------------------------------------------------------------
  76. inline BOOL CIndexKeyRepository::PutPropId( PROPID pid )
  77. {
  78. // ciAssert ( pid != pidAll );
  79. _key.SetPid( pid );
  80. return TRUE;
  81. }
  82. //+---------------------------------------------------------------------------
  83. //
  84. // Member: CIndexKeyRepository::PutWorkId
  85. //
  86. // Arguments: [wid] -- Property ID
  87. //
  88. // History: 09-June-91 t-WadeR Created.
  89. // 20-May-92 KyleP Use new WordList::SetWid
  90. //
  91. //----------------------------------------------------------------------------
  92. void CIndexKeyRepository::PutWorkId( WORKID wid )
  93. {
  94. _entryBufHandler.SetWid( wid );
  95. }
  96. //+---------------------------------------------------------------------------
  97. //
  98. // Member: CIndexKeyRepository::StoreValue
  99. //
  100. // Synopsis: Store a property value.
  101. //
  102. // Arguments: [prop] -- Property descriptor
  103. // [var] -- Value
  104. //
  105. // History: 21-Dec-95 KyleP Created
  106. //
  107. //----------------------------------------------------------------------------
  108. BOOL CIndexKeyRepository::StoreValue( CFullPropSpec const & prop,
  109. CStorageVariant const & var )
  110. {
  111. return _entryBufHandler.StoreValue( prop, var );
  112. }
  113. //+---------------------------------------------------------------------------
  114. //
  115. // Member: CIndexKeyRepository::StoreSecurity
  116. //
  117. // Synopsis: Store security information for a file.
  118. //
  119. // Arguments: [pSD] -- pointer to a security descriptor
  120. // [cbSD] -- size in bytes of pSD
  121. //
  122. // History: 07 Feb 96 AlanW Created
  123. //
  124. //----------------------------------------------------------------------------
  125. BOOL CIndexKeyRepository::StoreSecurity( PSECURITY_DESCRIPTOR pSD,
  126. ULONG cbSD )
  127. {
  128. return _entryBufHandler.StoreSecurity( pSD, cbSD );
  129. }