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.

102 lines
3.5 KiB

  1. // Copyright (C) Microsoft Corporation 1996-1997, All Rights reserved.
  2. #if _MSC_VER > 1000
  3. #pragma once
  4. #endif
  5. #ifndef _SYSTEM_H_
  6. #define _SYSTEM_H_
  7. #include "..\hhctrl\fs.h"
  8. typedef enum {
  9. TAG_DEFAULT_TOC, // needed if no window definitions
  10. TAG_DEFAULT_INDEX, // needed if no window definitions
  11. TAG_DEFAULT_HTML, // needed if no window definitions
  12. TAG_DEFAULT_CAPTION, // needed if no window definitions
  13. TAG_SYSTEM_FLAGS,
  14. TAG_DEFAULT_WINDOW,
  15. TAG_SHORT_NAME, // short name of title (ex. root filename)
  16. TAG_HASH_BINARY_INDEX,
  17. TAG_INFO_TYPES,
  18. TAG_COMPILER_VERSION, // specifies the version of the compiler used
  19. TAG_TIME, // the time the file was compiled
  20. } SYSTEM_TAG_TYPE;
  21. typedef struct {
  22. WORD tag;
  23. WORD cbTag;
  24. } SYSTEM_TAG;
  25. typedef struct {
  26. LCID lcid;
  27. BOOL fDBCS; // Don't use bitflags! Can't assume byte-order
  28. BOOL fFTI; // full-text search enabled
  29. BOOL fKeywordLinks;
  30. BOOL fALinks;
  31. FILETIME FileTime; // title uniqueness (should match .chi file)
  32. } SYSTEM_FLAGS;
  33. /////////////////////////////////////////////////////////////////////////////////////////////
  34. // CTitleInformation - read in the title informaton file (#SYSTEM) settings for each title
  35. //
  36. class CTitleInformation
  37. {
  38. public:
  39. CTitleInformation( CFileSystem* pFileSystem );
  40. ~CTitleInformation();
  41. inline LPCSTR GetShortName() { Init(); return m_pszShortName; }
  42. inline LPCSTR GetTitleName() { Init(); return m_pszTitleName; }
  43. inline FILETIME GetFileTime() { Init(); return m_Settings.FileTime; }
  44. inline LCID GetLanguage() { Init(); return m_Settings.lcid; }
  45. inline BOOL IsKeywordLinks() { Init(); return m_Settings.fKeywordLinks; }
  46. inline BOOL IsAssociativeLinks() { Init(); return m_Settings.fALinks; }
  47. inline BOOL IsFullTextSearch() { Init(); return m_Settings.fFTI; }
  48. inline BOOL IsDoubleByte() { Init(); return m_Settings.fDBCS; }
  49. inline LPCSTR GetCompilerVersion() { Init(); return m_pszCompilerVersion; }
  50. HRESULT Initialize();
  51. private:
  52. inline BOOL Init() { if( !m_bInit ) Initialize(); return m_bInit; }
  53. BOOL m_bInit; // self-initing class
  54. CFileSystem* m_pFileSystem; // title file system handle
  55. SYSTEM_FLAGS m_Settings; // simple title information settings
  56. LPCSTR m_pszShortName; // short title name
  57. LPCSTR m_pszTitleName; // title name
  58. LPCSTR m_pszCompilerVersion; // compiler version
  59. };
  60. /////////////////////////////////////////////////////////////////////////////////////////////
  61. // CTitleInformation2 - get title informaton without going through the file system
  62. //
  63. class CTitleInformation2
  64. {
  65. public:
  66. CTitleInformation2( LPCTSTR pszPathName );
  67. ~CTitleInformation2();
  68. inline LPCTSTR GetShortName() { Init(); return m_pszShortName; }
  69. inline FILETIME GetFileTime() { Init(); return m_FileTime; }
  70. inline LCID GetLanguage() { Init(); return m_lcid; }
  71. HRESULT Initialize();
  72. private:
  73. inline BOOL Init() { if( !m_bInit ) Initialize(); return m_bInit; }
  74. BOOL m_bInit; // self-initing class
  75. LPCTSTR m_pszPathName; // title pathname
  76. LPCTSTR m_pszShortName; // short title name
  77. LCID m_lcid; // language
  78. FILETIME m_FileTime; // file time
  79. };
  80. HRESULT DumpTitleInformation( CFileSystem* pFileSystem );
  81. HRESULT DumpTitleInformation2( CFileSystem* pFileSystem );
  82. #endif // _SYSTEM_H_