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.

92 lines
2.5 KiB

  1. //
  2. // MODULE: DSCREAD.H
  3. //
  4. // PURPOSE: dsc reading classes
  5. //
  6. // COMPANY: Saltmine Creative, Inc. (206)-284-7511 [email protected]
  7. //
  8. // AUTHOR: Oleg Kalosha
  9. //
  10. // ORIGINAL DATE: 8-19-98
  11. //
  12. // NOTES:
  13. // >>> TBD: must deal with case where DSC file is in a CHM. I assume we must unpack it
  14. // from CHM into a normal directory, then read it with BReadModel. Exception handling scheme
  15. // must cope correctly with the fact that the error may be either from the CHM file or the
  16. // DSC file. Maybe use CFileReader to read from the CHM file and write the copy
  17. // to disk? JM 1/7/99
  18. //
  19. // Version Date By Comments
  20. //--------------------------------------------------------------------
  21. // V3.0 08-04-98 OK
  22. //
  23. #ifndef __DSCREAD_H_
  24. #define __DSCREAD_H_
  25. #include "BaseException.h"
  26. #include "stateless.h"
  27. #include "bnts.h"
  28. ////////////////////////////////////////////////////////////////////////////////////
  29. // CDSCReaderException
  30. ////////////////////////////////////////////////////////////////////////////////////
  31. class CDSCReader;
  32. class CDSCReaderException : public CBaseException
  33. {
  34. public:
  35. enum eErr {
  36. eErrRead,
  37. eErrGetDateTime,
  38. eErrUnpackCHM // for Local Troubleshooter only
  39. } m_eErr;
  40. protected:
  41. CDSCReader* m_pDSCReader;
  42. public:
  43. // source_file is LPCSTR rather than LPCTSTR because __FILE__ is char[35]
  44. CDSCReaderException(CDSCReader* reader, eErr err, LPCSTR source_file, int line);
  45. virtual ~CDSCReaderException();
  46. public:
  47. virtual void Clear();
  48. };
  49. ////////////////////////////////////////////////////////////////////////////////////
  50. // CDSCReader
  51. // This handles just the reading of BNTS. CBN packages it up for public consumption.
  52. ////////////////////////////////////////////////////////////////////////////////////
  53. class CPhysicalFileReader;
  54. class CDSCReader : public CStateless
  55. {
  56. protected:
  57. CPhysicalFileReader* m_pPhysicalFileReader;
  58. CString m_strName; // network name
  59. CString m_strPath; // full path and name of dsc file
  60. BNTS m_Network;
  61. bool m_bIsRead; // network has been loaded
  62. SYSTEMTIME m_stimeLastWrite; // when the DSC file was last written to
  63. bool m_bDeleteFile; // Set to true when a temporary file originating from a
  64. // CHM file needs to be deleted in the destructor.
  65. public:
  66. CDSCReader(CPhysicalFileReader*);
  67. ~CDSCReader();
  68. public:
  69. bool IsRead() const;
  70. bool IsValid() const;
  71. public:
  72. // These functions to be ONLY public interface.
  73. bool Read();
  74. void Clear();
  75. #ifdef LOCAL_TROUBLESHOOTER
  76. private:
  77. bool CHMfileHandler( LPCTSTR path );
  78. #endif
  79. };
  80. #endif