From b7c5d1a50183c1c50033a330a01351d69e2bc438 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Wed, 25 Aug 2010 23:48:20 +0200 Subject: docview: File Information output now contains INF structure version info --- docview/src/HelpFile.pas | 9 +++++++++ docview/src/IPFFileFormatUnit.pas | 6 +++--- docview/src/frm_main.pas | 1 + 3 files changed, 13 insertions(+), 3 deletions(-) (limited to 'docview') diff --git a/docview/src/HelpFile.pas b/docview/src/HelpFile.pas index 4cd36edc..dc9998ed 100644 --- a/docview/src/HelpFile.pas +++ b/docview/src/HelpFile.pas @@ -46,8 +46,11 @@ type end; + { THelpFile } + THelpFile = class(TObject) private + function GetFormatVersion: string; function GetStringResourceIDCount: integer; function GetNumericResourceIDCount: integer; protected @@ -133,6 +136,7 @@ type property NumericResourceIDCount: integer read GetNumericResourceIDCount; property Index: TIndex read GetIndex; property Filename: string read _FileName; + property FormatVersion: string read GetFormatVersion; property ReferencedFiles: TStringList read _ReferencedFiles; @@ -346,6 +350,11 @@ Begin Result := Topic.HelpFile as THelpFile; end; +function THelpFile.GetFormatVersion: string; +begin + Result := Format('%d.%d', [_pHeader^.version_hi, _pHeader^.version_lo]); +end; + function THelpFile.GetStringResourceIDCount: integer; begin Result := _pHeader^.nname; diff --git a/docview/src/IPFFileFormatUnit.pas b/docview/src/IPFFileFormatUnit.pas index b954f4c8..66c52b40 100644 --- a/docview/src/IPFFileFormatUnit.pas +++ b/docview/src/IPFFileFormatUnit.pas @@ -10,9 +10,9 @@ uses SysUtils; type - uint32 = longword; - uint16 = word; - uint8 = byte; + uint32 = longword; // 4 bytes + uint16 = word; // 2 bytes + uint8 = byte; // 1 byte pUInt16 = ^uint16; pUInt32 = ^uint32; pUInt8 = ^uint8; diff --git a/docview/src/frm_main.pas b/docview/src/frm_main.pas index 66996a54..90a86ae9 100644 --- a/docview/src/frm_main.pas +++ b/docview/src/frm_main.pas @@ -492,6 +492,7 @@ begin Add('Filename: ' + f.Filename + ''); Add('Title: ' + f.Title); Add('File size: ' + IntToStr(fpgFileSize(f.Filename)) + ' bytes'); + Add('INF/HLP file version ' + f.FormatVersion); Add('Dictionary count: ' + IntToStr(f.DictionaryCount)); Add('Topic count: ' + IntToStr(f.TopicCount)); Add('Index count: ' + IntToStr(f.Index.Count)); -- cgit v1.2.3-70-g09d2