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.

100 lines
2.0 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 2001
  5. //
  6. // File: gen.hxx
  7. //
  8. // Contents: Generic filter code
  9. //
  10. // History: 1-May-2001 kumarp created
  11. //
  12. //--------------------------------------------------------------------------
  13. #pragma once
  14. class CStorageVariant;
  15. #define genDebugOut( x )
  16. #define MAXIDENTIFIER 80
  17. #define MAX_LINE_SIZE 512
  18. class GenScanner
  19. {
  20. public:
  21. GenScanner();
  22. void Init(CFilterTextStream* pStream);
  23. int GetLine( PWSTR pszBuf, UINT BufSize, FILTERREGION* pRegion );
  24. ULONG Lines() { return _cLines; }
  25. private:
  26. FILTERREGION _region; // region where the identifier was found
  27. CFilterTextStream* _pStream; // stream
  28. ULONG _cLines;
  29. };
  30. class GenParser
  31. {
  32. enum TokenType
  33. {
  34. ttFunction
  35. };
  36. public:
  37. GenParser();
  38. ~GenParser();
  39. void Init( CFilterTextStream * pStream );
  40. BOOL Parse();
  41. PROPSPEC GetAttribute() { return _attribute; }
  42. void GetRegion ( FILTERREGION& region );
  43. BOOL GetTokens( ULONG * pcwcBuffer, WCHAR * awcBuffer);
  44. BOOL GetValueAttribute( PROPSPEC & ps );
  45. PROPVARIANT * GetValue();
  46. void SkipValue() { _iVal++; };
  47. private:
  48. void DefineTag();
  49. GenScanner _scanner; // the scanner
  50. WCHAR _strName [MAXIDENTIFIER+1]; // buffer for identifier
  51. FILTERREGION _regionName;
  52. TokenType _tokenType; // class, function, method?
  53. PROPSPEC _attribute;
  54. ULONG _cwcCopiedName;
  55. enum CxxVal
  56. {
  57. Function,
  58. Lines
  59. };
  60. unsigned _iVal;
  61. PROPSPEC _psVal[2];
  62. CStorageVariant * _aVal[2];
  63. WCHAR _buf[MAX_LINE_SIZE+1]; // buffer for lines
  64. };
  65. #define GENFLT_PERL_SUPPORT
  66. //#define GENFLT_FILE_INIT