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.

75 lines
1.9 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Copyright (C) 1992 - 1994, Microsoft Corporation.
  4. //
  5. // File: fstrm.hxx
  6. //
  7. // Contents: Stream for taking text from IFilter and transporting it to
  8. // the word breaker
  9. //
  10. // Classes: CFilterTextStream
  11. //
  12. // History: 01-Aug-93 AmyA Created
  13. // 17-Oct-94 BartoszM Rewrote
  14. //
  15. //----------------------------------------------------------------------------
  16. #pragma once
  17. #include <tsource.hxx>
  18. #include <query.h>
  19. #include <mapper.hxx>
  20. //+---------------------------------------------------------------------------
  21. //
  22. // Class: CFilterTextStream
  23. //
  24. // Interface:
  25. //
  26. // History: 01-Nov-94 BartoszM Created
  27. //
  28. //----------------------------------------------------------------------------
  29. class CFilterTextStream: public CTextSource
  30. {
  31. public:
  32. CFilterTextStream(IFilter* pIFilter);
  33. int GetChar ();
  34. void GetRegion ( FILTERREGION& region, int offset, int len )
  35. {
  36. Win4Assert ( offset >= -1 );
  37. _mapper.GetSrcRegion (region, len, offset+ iCur);
  38. }
  39. private:
  40. int GetMore ();
  41. STAT_CHUNK _statChunk;
  42. CSourceMapper _mapper;
  43. };
  44. //+---------------------------------------------------------------------------
  45. //
  46. // Member: CFilterTextStream::GetChar, public
  47. //
  48. // Synopsis: Get the look ahead character
  49. // and swallow the last look ahead
  50. // Replenish the buffer before the last character
  51. // is swallowed.
  52. //
  53. // History: 16-Nov-94 BartoszM Created
  54. //
  55. //----------------------------------------------------------------------------
  56. inline int CFilterTextStream::GetChar()
  57. {
  58. if (iCur >= iEnd - 1)
  59. {
  60. return GetMore();
  61. }
  62. return awcBuffer[iCur++];
  63. }