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.

88 lines
2.6 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Copyright (C) 1992 - 1993, Microsoft Corporation.
  4. //
  5. // File: cxxflt.hxx
  6. //
  7. // Contents: C and Cxx filter
  8. //
  9. // Classes: CxxIFilter
  10. //
  11. // History: 07-Oct-93 AmyA Created
  12. //
  13. //----------------------------------------------------------------------------
  14. #pragma once
  15. //+---------------------------------------------------------------------------
  16. //
  17. // Class: CxxIFilter
  18. //
  19. // Purpose: C and Cxx Filter
  20. //
  21. // History: 07-Oct-93 AmyA Created
  22. //
  23. //----------------------------------------------------------------------------
  24. class CxxIFilter: public CxxIFilterBase
  25. {
  26. enum FilterState
  27. {
  28. FilterContents,
  29. FilterProp,
  30. FilterNextProp, // current property text exhausted
  31. FilterValue,
  32. FilterNextValue,
  33. FilterDone
  34. };
  35. public:
  36. CxxIFilter();
  37. ~CxxIFilter();
  38. SCODE STDMETHODCALLTYPE Init( ULONG grfFlags,
  39. ULONG cAttributes,
  40. FULLPROPSPEC const * aAttributes,
  41. ULONG * pFlags );
  42. SCODE STDMETHODCALLTYPE GetChunk( STAT_CHUNK * pStat );
  43. SCODE STDMETHODCALLTYPE GetText( ULONG * pcwcBuffer,
  44. WCHAR * awcBuffer );
  45. SCODE STDMETHODCALLTYPE GetValue( PROPVARIANT ** ppPropValue );
  46. SCODE STDMETHODCALLTYPE BindRegion( FILTERREGION origPos,
  47. REFIID riid,
  48. void ** ppunk );
  49. SCODE STDMETHODCALLTYPE GetClassID(CLSID * pClassID);
  50. SCODE STDMETHODCALLTYPE IsDirty();
  51. SCODE STDMETHODCALLTYPE Load(LPCWSTR pszFileName, DWORD dwMode);
  52. SCODE STDMETHODCALLTYPE Save(LPCWSTR pszFileName, BOOL fRemember);
  53. SCODE STDMETHODCALLTYPE SaveCompleted(LPCWSTR pszFileName);
  54. SCODE STDMETHODCALLTYPE GetCurFile(LPWSTR * ppszFileName);
  55. private:
  56. FilterState _state;
  57. IFilter * _pTextFilt; // Base text IFilter
  58. IPersistFile * _pPersFile; // Base text IPersistFile
  59. CxxParser _cxxParse; // C++ parser
  60. LCID _locale; // Locale (cached from text filter)
  61. ULONG _ulLastTextChunkID; // Id of last text chunk
  62. ULONG _ulChunkID; // Current chunk id
  63. ULONG _cAttrib; // Count of attributes. 0 --> All
  64. CFps * _pAttrib; // Attributes
  65. CFilterTextStream* _pTextStream; // Source text stream for C++ parser
  66. };