Class: Cabriolet::Models::HLPHeader
- Inherits:
-
Object
- Object
- Cabriolet::Models::HLPHeader
- Defined in:
- lib/cabriolet/models/hlp_header.rb
Overview
HLP file header model
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. Testing relies on round-trip compression/decompression and comparison with libmspack tools if available.
Instance Attribute Summary collapse
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#files ⇒ Object
Returns the value of attribute files.
-
#length ⇒ Object
Returns the value of attribute length.
-
#magic ⇒ Object
Returns the value of attribute magic.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(magic: nil, version: nil, filename: nil, length: 0) ⇒ HLPHeader
constructor
Initialize HLP header.
-
#valid? ⇒ Boolean
Check if header is valid.
Constructor Details
#initialize(magic: nil, version: nil, filename: nil, length: 0) ⇒ HLPHeader
Initialize HLP header
21 22 23 24 25 26 27 |
# File 'lib/cabriolet/models/hlp_header.rb', line 21 def initialize(magic: nil, version: nil, filename: nil, length: 0) @magic = magic @version = version @filename = filename @length = length @files = [] end |
Instance Attribute Details
#filename ⇒ Object
Returns the value of attribute filename.
13 14 15 |
# File 'lib/cabriolet/models/hlp_header.rb', line 13 def filename @filename end |
#files ⇒ Object
Returns the value of attribute files.
13 14 15 |
# File 'lib/cabriolet/models/hlp_header.rb', line 13 def files @files end |
#length ⇒ Object
Returns the value of attribute length.
13 14 15 |
# File 'lib/cabriolet/models/hlp_header.rb', line 13 def length @length end |
#magic ⇒ Object
Returns the value of attribute magic.
13 14 15 |
# File 'lib/cabriolet/models/hlp_header.rb', line 13 def magic @magic end |
#version ⇒ Object
Returns the value of attribute version.
13 14 15 |
# File 'lib/cabriolet/models/hlp_header.rb', line 13 def version @version end |
Instance Method Details
#valid? ⇒ Boolean
Check if header is valid
32 33 34 |
# File 'lib/cabriolet/models/hlp_header.rb', line 32 def valid? !@magic.nil? && !@version.nil? end |