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.

72 lines
2.2 KiB

  1. //
  2. // MODULE: CHMFileReader.CPP
  3. //
  4. // PURPOSE: interface for CHM file reading class CCHMFileReader
  5. //
  6. // COMPANY: Saltmine Creative, Inc. (206)-284-7511 [email protected]
  7. //
  8. // AUTHOR: Joe Mabel
  9. //
  10. // ORIGINAL DATE: 01-18-99
  11. //
  12. // NOTES:
  13. //
  14. // Version Date By Comments
  15. //--------------------------------------------------------------------
  16. // V3.1 01-18-99 JM
  17. //
  18. #if !defined(AFX_CHMFILEREADER_H__1A2C05D6_AEFC_11D2_9658_00C04FC22ADD__INCLUDED_)
  19. #define AFX_CHMFILEREADER_H__1A2C05D6_AEFC_11D2_9658_00C04FC22ADD__INCLUDED_
  20. #if _MSC_VER > 1000
  21. #pragma once
  22. #endif // _MSC_VER > 1000
  23. #include "fileread.h"
  24. class CFileSystem;
  25. class CSubFileSystem;
  26. class CCHMFileReader : public CPhysicalFileReader
  27. {
  28. private:
  29. CString m_strCHMPath; // full path and name of CHM
  30. CString m_strStreamName; // name of stream within CHM
  31. CFileSystem* m_pFileSystem;
  32. CSubFileSystem* m_pSubFileSystem;
  33. private:
  34. CCHMFileReader(); // do not instantiate
  35. public:
  36. CCHMFileReader(CString strCHMPath, CString strStreamName);
  37. CCHMFileReader( CString strFullCHMname );
  38. virtual ~CCHMFileReader();
  39. protected:
  40. // only CFileReader can access these functions !!!
  41. virtual bool CloseHandle(); // doesn't throw exception, therefore may be used by exception class.
  42. virtual void Open();
  43. virtual void ReadData(LPTSTR * ppBuf);
  44. public:
  45. // return full file path and its components
  46. CString GetPathName() const;
  47. CString GetJustPath() const {return m_strCHMPath;}
  48. CString GetJustName() const {return m_strStreamName;}
  49. CString GetJustNameWithoutExtension() const;
  50. CString GetJustExtension() const;
  51. bool GetFileTime(CAbstractFileReader::EFileTime type, time_t& out) const;
  52. CString GetNameToLog() const;
  53. static bool IsCHMfile( const CString& strPath ); // Returns true if the first few
  54. // characters of the path specification
  55. // match a given sequence.
  56. static bool IsPathToCHMfile( const CString& strPath ); // returns true if this is
  57. // a full path to a CHM file
  58. static CString FormCHMPath( const CString strPathToCHMfile ); // forms mk:@msitstore:path::/stream
  59. // string
  60. };
  61. #endif // !defined(AFX_CHMFILEREADER_H__1A2C05D6_AEFC_11D2_9658_00C04FC22ADD__INCLUDED_)