Class: Cabriolet::HLP::QuickHelp::Parser
- Inherits:
-
Object
- Object
- Cabriolet::HLP::QuickHelp::Parser
- Defined in:
- lib/cabriolet/hlp/quickhelp/parser.rb
Overview
Parser for QuickHelp (.HLP) files
Parses the QuickHelp binary format as specified in the DosHelp project. Structure:
-
Signature (2 bytes)
-
File Header (68 bytes)
-
Topic Index (variable)
-
Context Strings (variable)
-
Context Map (variable)
-
Keywords (optional)
-
Huffman Tree (optional)
-
Topic Texts (compressed)
Instance Attribute Summary collapse
-
#io_system ⇒ Object
readonly
Returns the value of attribute io_system.
Instance Method Summary collapse
-
#initialize(io_system = nil) ⇒ Parser
constructor
Initialize parser.
-
#parse(filename) ⇒ Models::HLPHeader
Parse a QuickHelp file.
Constructor Details
Instance Attribute Details
#io_system ⇒ Object (readonly)
Returns the value of attribute io_system.
22 23 24 |
# File 'lib/cabriolet/hlp/quickhelp/parser.rb', line 22 def io_system @io_system end |
Instance Method Details
#parse(filename) ⇒ Models::HLPHeader
Parse a QuickHelp file
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/cabriolet/hlp/quickhelp/parser.rb', line 36 def parse(filename) handle = @io_system.open(filename, Constants::MODE_READ) begin header = parse_file(handle) header.filename = filename header ensure @io_system.close(handle) end end |