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.

101 lines
3.1 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. SCODE STDMETHODCALLTYPE Load( IStream * pStm );
  56. SCODE STDMETHODCALLTYPE Save( IStream * pStm, BOOL fClearDirty )
  57. {
  58. return E_FAIL;
  59. }
  60. SCODE STDMETHODCALLTYPE GetSizeMax( ULARGE_INTEGER * pcbSize )
  61. {
  62. return _pPersStream->GetSizeMax( pcbSize );
  63. }
  64. private:
  65. FilterState _state;
  66. IFilter * _pTextFilt; // Base text IFilter
  67. IPersistFile * _pPersFile; // Base text IPersistFile
  68. IPersistStream * _pPersStream; // Base text IPersistStream
  69. CxxParser _cxxParse; // C++ parser
  70. LCID _locale; // Locale (cached from text filter)
  71. ULONG _ulLastTextChunkID; // Id of last text chunk
  72. ULONG _ulChunkID; // Current chunk id
  73. ULONG _cAttrib; // Count of attributes. 0 --> All
  74. CFps * _pAttrib; // Attributes
  75. CFilterTextStream* _pTextStream; // Source text stream for C++ parser
  76. };