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.

71 lines
1.8 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. //+---------------------------------------------------------------------------
  18. //
  19. // Class: CFilterTextStream
  20. //
  21. // Interface:
  22. //
  23. // History: 01-Nov-94 BartoszM Created
  24. //
  25. //----------------------------------------------------------------------------
  26. class CFilterTextStream: public CTextSource
  27. {
  28. public:
  29. CFilterTextStream(IFilter* pIFilter);
  30. int GetChar ();
  31. void GetRegion ( FILTERREGION& region, int offset, int len )
  32. {
  33. Win4Assert ( offset >= -1 );
  34. _mapper.GetSrcRegion (region, len, offset+ iCur);
  35. }
  36. private:
  37. int GetMore ();
  38. STAT_CHUNK _statChunk;
  39. CSourceMapper _mapper;
  40. };
  41. //+---------------------------------------------------------------------------
  42. //
  43. // Member: CFilterTextStream::GetChar, public
  44. //
  45. // Synopsis: Get the look ahead character
  46. // and swallow the last look ahead
  47. // Replenish the buffer before the last character
  48. // is swallowed.
  49. //
  50. // History: 16-Nov-94 BartoszM Created
  51. //
  52. //----------------------------------------------------------------------------
  53. inline int CFilterTextStream::GetChar()
  54. {
  55. if (iCur >= iEnd - 1)
  56. {
  57. return GetMore();
  58. }
  59. return awcBuffer[iCur++];
  60. }