Class: Cabriolet::HLP::Parser
- Inherits:
-
Object
- Object
- Cabriolet::HLP::Parser
- Defined in:
- lib/cabriolet/hlp/parser.rb
Overview
Parser for HLP (Windows Help) files
NOTE: This implementation is based on the knowledge that HLP files use LZSS compression with MODE_MSHELP, but cannot be fully validated due to lack of test fixtures and incomplete libmspack implementation.
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 an HLP file.
Constructor Details
#initialize(io_system = nil) ⇒ Parser
Initialize parser
17 18 19 |
# File 'lib/cabriolet/hlp/parser.rb', line 17 def initialize(io_system = nil) @io_system = io_system || System::IOSystem.new end |
Instance Attribute Details
#io_system ⇒ Object (readonly)
Returns the value of attribute io_system.
11 12 13 |
# File 'lib/cabriolet/hlp/parser.rb', line 11 def io_system @io_system end |
Instance Method Details
#parse(filename) ⇒ Models::HLPHeader
Parse an HLP file
26 27 28 29 30 31 32 33 34 |
# File 'lib/cabriolet/hlp/parser.rb', line 26 def parse(filename) handle = @io_system.open(filename, Constants::MODE_READ) begin parse_header(handle) ensure @io_system.close(handle) end end |