Class: Zim::FileHeader
- Inherits:
-
Object
- Object
- Zim::FileHeader
- Defined in:
- lib/zim/structs.rb
Overview
header data of a zim file
Instance Attribute Summary collapse
-
#article_count ⇒ Object
readonly
Returns the value of attribute article_count.
-
#checksum_pos ⇒ Object
readonly
:nodoc:.
-
#cluster_count ⇒ Object
readonly
Returns the value of attribute cluster_count.
-
#cluster_pos ⇒ Object
readonly
:nodoc:.
-
#layout_page ⇒ Object
readonly
layout page index.
-
#magic ⇒ Object
readonly
magic number.
-
#main_page ⇒ Object
readonly
main page index.
-
#mime_list_pos ⇒ Object
readonly
:nodoc:.
-
#title_pos ⇒ Object
readonly
:nodoc:.
-
#url_pos ⇒ Object
readonly
:nodoc:.
-
#uuid ⇒ Object
readonly
uuid.
-
#version ⇒ Object
readonly
zim version.
Instance Method Summary collapse
-
#initialize(f) ⇒ FileHeader
constructor
read file header from a file.
Constructor Details
#initialize(f) ⇒ FileHeader
read file header from a file
29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/zim/structs.rb', line 29 def initialize(f) @magic = f.read_int32 @version = f.read_int32 @uuid = f.read_str(16) @article_count = f.read_int32 @cluster_count = f.read_int32 @url_pos = f.read_int64 @title_pos = f.read_int64 @cluster_pos = f.read_int64 @mime_list_pos = f.read_int64 @main_page = f.read_int32 @layout_page = f.read_int32 @checksum_pos = f.read_int64 end |
Instance Attribute Details
#article_count ⇒ Object (readonly)
Returns the value of attribute article_count.
14 15 16 |
# File 'lib/zim/structs.rb', line 14 def article_count @article_count end |
#checksum_pos ⇒ Object (readonly)
:nodoc:
26 27 28 |
# File 'lib/zim/structs.rb', line 26 def checksum_pos @checksum_pos end |
#cluster_count ⇒ Object (readonly)
Returns the value of attribute cluster_count.
15 16 17 |
# File 'lib/zim/structs.rb', line 15 def cluster_count @cluster_count end |
#cluster_pos ⇒ Object (readonly)
:nodoc:
18 19 20 |
# File 'lib/zim/structs.rb', line 18 def cluster_pos @cluster_pos end |
#layout_page ⇒ Object (readonly)
layout page index
25 26 27 |
# File 'lib/zim/structs.rb', line 25 def layout_page @layout_page end |
#magic ⇒ Object (readonly)
magic number
7 8 9 |
# File 'lib/zim/structs.rb', line 7 def magic @magic end |
#main_page ⇒ Object (readonly)
main page index
22 23 24 |
# File 'lib/zim/structs.rb', line 22 def main_page @main_page end |
#mime_list_pos ⇒ Object (readonly)
:nodoc:
19 20 21 |
# File 'lib/zim/structs.rb', line 19 def mime_list_pos @mime_list_pos end |
#title_pos ⇒ Object (readonly)
:nodoc:
17 18 19 |
# File 'lib/zim/structs.rb', line 17 def title_pos @title_pos end |
#url_pos ⇒ Object (readonly)
:nodoc:
16 17 18 |
# File 'lib/zim/structs.rb', line 16 def url_pos @url_pos end |
#uuid ⇒ Object (readonly)
uuid
13 14 15 |
# File 'lib/zim/structs.rb', line 13 def uuid @uuid end |
#version ⇒ Object (readonly)
zim version
10 11 12 |
# File 'lib/zim/structs.rb', line 10 def version @version end |