Class: Cabriolet::CHM::Parser
- Inherits:
-
Object
- Object
- Cabriolet::CHM::Parser
- Defined in:
- lib/cabriolet/chm/parser.rb
Overview
Parser for CHM (Compiled HTML Help) files
Constant Summary collapse
- GUID1 =
Expected GUID values in CHM headers
[0x10, 0xFD, 0x01, 0x7C, 0xAA, 0x7B, 0xD0, 0x11, 0x9E, 0x0C, 0x00, 0xA0, 0xC9, 0x22, 0xE6, 0xEC].pack("C*")
- GUID2 =
[0x11, 0xFD, 0x01, 0x7C, 0xAA, 0x7B, 0xD0, 0x11, 0x9E, 0x0C, 0x00, 0xA0, 0xC9, 0x22, 0xE6, 0xEC].pack("C*")
- CONTENT_NAME =
System file names
"::DataSpace/Storage/MSCompressed/Content"- CONTROL_NAME =
"::DataSpace/Storage/MSCompressed/ControlData"- SPANINFO_NAME =
"::DataSpace/Storage/MSCompressed/SpanInfo"- RTABLE_NAME =
"::DataSpace/Storage/MSCompressed/Transform/" \ "{7FC28940-9D31-11D0-9B27-00A0C91E9C7C}/InstanceData/ResetTable"
Instance Attribute Summary collapse
-
#chm ⇒ Object
readonly
Returns the value of attribute chm.
-
#io ⇒ Object
readonly
Returns the value of attribute io.
Instance Method Summary collapse
-
#initialize(io) ⇒ Parser
constructor
A new instance of Parser.
-
#parse(entire: true) ⇒ Models::CHMHeader
Parse the CHM file.
Constructor Details
#initialize(io) ⇒ Parser
Returns a new instance of Parser.
27 28 29 30 |
# File 'lib/cabriolet/chm/parser.rb', line 27 def initialize(io) @io = io @chm = Models::CHMHeader.new end |
Instance Attribute Details
#chm ⇒ Object (readonly)
Returns the value of attribute chm.
25 26 27 |
# File 'lib/cabriolet/chm/parser.rb', line 25 def chm @chm end |
#io ⇒ Object (readonly)
Returns the value of attribute io.
25 26 27 |
# File 'lib/cabriolet/chm/parser.rb', line 25 def io @io end |
Instance Method Details
#parse(entire: true) ⇒ Models::CHMHeader
Parse the CHM file
35 36 37 38 39 40 41 42 43 |
# File 'lib/cabriolet/chm/parser.rb', line 35 def parse(entire: true) read_itsf_header read_header_sections read_directory_header read_file_entries if entire @chm end |