Class: Zim::FileHeader

Inherits:
Object
  • Object
show all
Defined in:
lib/zim/structs.rb

Overview

header data of a zim file

Instance Attribute Summary collapse

Instance Method Summary collapse

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_countObject (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_posObject (readonly)

:nodoc:



26
27
28
# File 'lib/zim/structs.rb', line 26

def checksum_pos
  @checksum_pos
end

#cluster_countObject (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_posObject (readonly)

:nodoc:



18
19
20
# File 'lib/zim/structs.rb', line 18

def cluster_pos
  @cluster_pos
end

#layout_pageObject (readonly)

layout page index



25
26
27
# File 'lib/zim/structs.rb', line 25

def layout_page
  @layout_page
end

#magicObject (readonly)

magic number



7
8
9
# File 'lib/zim/structs.rb', line 7

def magic
  @magic
end

#main_pageObject (readonly)

main page index



22
23
24
# File 'lib/zim/structs.rb', line 22

def main_page
  @main_page
end

#mime_list_posObject (readonly)

:nodoc:



19
20
21
# File 'lib/zim/structs.rb', line 19

def mime_list_pos
  @mime_list_pos
end

#title_posObject (readonly)

:nodoc:



17
18
19
# File 'lib/zim/structs.rb', line 17

def title_pos
  @title_pos
end

#url_posObject (readonly)

:nodoc:



16
17
18
# File 'lib/zim/structs.rb', line 16

def url_pos
  @url_pos
end

#uuidObject (readonly)

uuid



13
14
15
# File 'lib/zim/structs.rb', line 13

def uuid
  @uuid
end

#versionObject (readonly)

zim version



10
11
12
# File 'lib/zim/structs.rb', line 10

def version
  @version
end