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.

98 lines
2.4 KiB

  1. //-----------------------------------------------------------------------------
  2. //
  3. // File: pinfo.h
  4. // Copyright (C) 1994-1997 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // Class that holds information about a parser.
  8. //
  9. //-----------------------------------------------------------------------------
  10. #ifndef PINFO_H
  11. #define PINFO_H
  12. class CLocParserManager;
  13. class CLocParserInfo;
  14. typedef CTypedPtrList<CPtrList, CLocParserInfo *> CLocParserList;
  15. #pragma warning(disable : 4251)
  16. interface ILocParser;
  17. interface ILocStringValidation;
  18. class LTAPIENTRY CLocParserInfo : public CLObject
  19. {
  20. public:
  21. void AssertValid(void) const;
  22. const CLString &GetParserName(void) const;
  23. const CLString &GetParserDescription(void) const;
  24. const CLString &GetParserHelp(void) const;
  25. ParserId GetParserId(void) const;
  26. BOOL GetDllVersion(CLString &) const;
  27. const CLocExtensionList &GetExtensionList() const;
  28. const CLocParserList &GetSubParserList(void) const;
  29. ~CLocParserInfo();
  30. protected:
  31. friend CLocParserManager;
  32. CLocParserInfo();
  33. HINSTANCE GetParserHandle(void) const;
  34. ILocParser * GetParserPointer(void) const;
  35. ILocStringValidation *GetValidationPointer(void);
  36. BOOL LoadParserDll(void);
  37. BOOL InitSubParsers(ILocParser *);
  38. BOOL FreeParserDll(void);
  39. BOOL AttemptUnload(void);
  40. BOOL IsLoaded(void) const;
  41. void SetParserName(const CLString &);
  42. void SetParserDescription(const CLString &);
  43. void SetParserHelp(const CLString &);
  44. void SetParserId(ParserId);
  45. BOOL SetExtensionList(const CLString &);
  46. void AddSubParser(CLocParserInfo *);
  47. void AddExtensions(const CLocExtensionList &);
  48. CLocParserList &GetSubParserList(void);
  49. clock_t GetLastAccessTime(void) const;
  50. static BOOL LoadParserDll(const CLString &strFileName,
  51. CReporter *pReporter, HMODULE &hDll, ILocParser *&pLocParser);
  52. static BOOL GetParserObjects(CReporter *, CLoadLibrary &, ILocParser *&);
  53. private:
  54. CLString m_strParserName;
  55. CLString m_strParserDescription;
  56. CLString m_strParserHelp;
  57. CLocExtensionList m_elExtList;
  58. ParserId m_pidParserId;
  59. HINSTANCE m_hParserDll;
  60. ILocParser *m_pParserObject;
  61. ILocStringValidation *m_pValidationObject;
  62. BOOL m_fLoadAttempted;
  63. BOOL m_fValidationTried;
  64. UINT m_uiSubParserUsageCount;
  65. mutable clock_t m_tLastAccess;
  66. CLocParserList m_pSubParsers;
  67. };
  68. #pragma warning(default : 4251)
  69. #endif // PINFO_H