Class: Cabriolet::Models::CHMHeader
- Inherits:
-
Object
- Object
- Cabriolet::Models::CHMHeader
- Defined in:
- lib/cabriolet/models/chm_header.rb
Overview
Represents a CHM file header and metadata
Instance Attribute Summary collapse
-
#chunk_cache ⇒ Object
Returns the value of attribute chunk_cache.
-
#chunk_size ⇒ Object
Returns the value of attribute chunk_size.
-
#density ⇒ Object
Returns the value of attribute density.
-
#depth ⇒ Object
Returns the value of attribute depth.
-
#dir_offset ⇒ Object
Returns the value of attribute dir_offset.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#files ⇒ Object
Returns the value of attribute files.
-
#first_pmgl ⇒ Object
Returns the value of attribute first_pmgl.
-
#index_root ⇒ Object
Returns the value of attribute index_root.
-
#language ⇒ Object
Returns the value of attribute language.
-
#last_pmgl ⇒ Object
Returns the value of attribute last_pmgl.
-
#length ⇒ Object
Returns the value of attribute length.
-
#num_chunks ⇒ Object
Returns the value of attribute num_chunks.
-
#sec0 ⇒ Object
Returns the value of attribute sec0.
-
#sec1 ⇒ Object
Returns the value of attribute sec1.
-
#sysfiles ⇒ Object
Returns the value of attribute sysfiles.
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
-
#all_files ⇒ Object
Get all files as an array.
-
#all_sysfiles ⇒ Object
Get all system files as an array.
-
#find_file(filename) ⇒ Object
Find a file by name.
-
#initialize ⇒ CHMHeader
constructor
A new instance of CHMHeader.
Constructor Details
#initialize ⇒ CHMHeader
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/cabriolet/models/chm_header.rb', line 12 def initialize @filename = nil @version = 0 = 0 @language = 0 @length = 0 @files = nil @sysfiles = nil @sec0 = CHMSecUncompressed.new(self) @sec1 = CHMSecMSCompressed.new(self) @dir_offset = 0 @num_chunks = 0 @chunk_size = 0 @density = 0 @depth = 0 @index_root = 0 @first_pmgl = 0 @last_pmgl = 0 @chunk_cache = nil end |
Instance Attribute Details
#chunk_cache ⇒ Object
Returns the value of attribute chunk_cache.
9 10 11 |
# File 'lib/cabriolet/models/chm_header.rb', line 9 def chunk_cache @chunk_cache end |
#chunk_size ⇒ Object
Returns the value of attribute chunk_size.
9 10 11 |
# File 'lib/cabriolet/models/chm_header.rb', line 9 def chunk_size @chunk_size end |
#density ⇒ Object
Returns the value of attribute density.
9 10 11 |
# File 'lib/cabriolet/models/chm_header.rb', line 9 def density @density end |
#depth ⇒ Object
Returns the value of attribute depth.
9 10 11 |
# File 'lib/cabriolet/models/chm_header.rb', line 9 def depth @depth end |
#dir_offset ⇒ Object
Returns the value of attribute dir_offset.
9 10 11 |
# File 'lib/cabriolet/models/chm_header.rb', line 9 def dir_offset @dir_offset end |
#filename ⇒ Object
Returns the value of attribute filename.
9 10 11 |
# File 'lib/cabriolet/models/chm_header.rb', line 9 def filename @filename end |
#files ⇒ Object
Returns the value of attribute files.
9 10 11 |
# File 'lib/cabriolet/models/chm_header.rb', line 9 def files @files end |
#first_pmgl ⇒ Object
Returns the value of attribute first_pmgl.
9 10 11 |
# File 'lib/cabriolet/models/chm_header.rb', line 9 def first_pmgl @first_pmgl end |
#index_root ⇒ Object
Returns the value of attribute index_root.
9 10 11 |
# File 'lib/cabriolet/models/chm_header.rb', line 9 def index_root @index_root end |
#language ⇒ Object
Returns the value of attribute language.
9 10 11 |
# File 'lib/cabriolet/models/chm_header.rb', line 9 def language @language end |
#last_pmgl ⇒ Object
Returns the value of attribute last_pmgl.
9 10 11 |
# File 'lib/cabriolet/models/chm_header.rb', line 9 def last_pmgl @last_pmgl end |
#length ⇒ Object
Returns the value of attribute length.
9 10 11 |
# File 'lib/cabriolet/models/chm_header.rb', line 9 def length @length end |
#num_chunks ⇒ Object
Returns the value of attribute num_chunks.
9 10 11 |
# File 'lib/cabriolet/models/chm_header.rb', line 9 def num_chunks @num_chunks end |
#sec0 ⇒ Object
Returns the value of attribute sec0.
9 10 11 |
# File 'lib/cabriolet/models/chm_header.rb', line 9 def sec0 @sec0 end |
#sec1 ⇒ Object
Returns the value of attribute sec1.
9 10 11 |
# File 'lib/cabriolet/models/chm_header.rb', line 9 def sec1 @sec1 end |
#sysfiles ⇒ Object
Returns the value of attribute sysfiles.
9 10 11 |
# File 'lib/cabriolet/models/chm_header.rb', line 9 def sysfiles @sysfiles end |
#timestamp ⇒ Object
Returns the value of attribute timestamp.
9 10 11 |
# File 'lib/cabriolet/models/chm_header.rb', line 9 def end |
#version ⇒ Object
Returns the value of attribute version.
9 10 11 |
# File 'lib/cabriolet/models/chm_header.rb', line 9 def version @version end |
Instance Method Details
#all_files ⇒ Object
Get all files as an array
34 35 36 37 38 39 40 41 42 |
# File 'lib/cabriolet/models/chm_header.rb', line 34 def all_files result = [] file = files while file result << file file = file.next_file end result end |
#all_sysfiles ⇒ Object
Get all system files as an array
45 46 47 48 49 50 51 52 53 |
# File 'lib/cabriolet/models/chm_header.rb', line 45 def all_sysfiles result = [] file = sysfiles while file result << file file = file.next_file end result end |
#find_file(filename) ⇒ Object
Find a file by name
56 57 58 59 60 61 62 63 64 |
# File 'lib/cabriolet/models/chm_header.rb', line 56 def find_file(filename) file = files while file return file if file.filename == filename file = file.next_file end nil end |