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.

49 lines
1.6 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1991 - 1994.
  5. //
  6. // File: MAPPER.HXX
  7. //
  8. // Contents: Source Mapper
  9. //
  10. // Classes: CSourceMapper
  11. //
  12. // History: 23-Sep-94 BartoszM Created.
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. //+---------------------------------------------------------------------------
  17. //
  18. // Class: CSourceMapper
  19. //
  20. // Purpose: Maps Text Source position into Filter Region
  21. //
  22. // History: 23-Sep-94 BartoszM Created.
  23. //
  24. // Notes: If the chunk is derived property, it can either map directly
  25. // to the source chunk, in which case _ccLen is zero,
  26. // or the mapping is undefined, in which case the source position
  27. // is given by offset zero and length _ccLen.
  28. //
  29. //----------------------------------------------------------------------------
  30. class CSourceMapper
  31. {
  32. public:
  33. CSourceMapper () : _idChunk(0), _offSplit(0), _ccLen(0) {}
  34. void NewChunk ( ULONG idChunk, ULONG ccBegin );
  35. void NewDerivedChunk ( ULONG idChunkSrc, ULONG ccBeginSrc, ULONG ccLen );
  36. void Advance ( ULONG ccProcessed );
  37. void GetSrcRegion ( FILTERREGION& region, ULONG len, ULONG ccOffsetInBuffer );
  38. private:
  39. ULONG _idChunk;
  40. ULONG _offInChunk; // Beginning of buffer is at this offset in chunk
  41. ULONG _offSplit; // Buffer split between two chunks
  42. ULONG _idNewChunk; // the new chunk in split buffer
  43. ULONG _ccLen; // length of src chunk
  44. };