Class: Exerb::Win32::Struct::IconDirEntry

Inherits:
Base
  • Object
show all
Defined in:
lib/exerb/win32/struct/icon_dir_entry.rb

Overview

#

Constant Summary collapse

FORMAT =
'CCCCSSLL'

Instance Attribute Summary collapse

Attributes inherited from Base

#position

Instance Method Summary collapse

Methods inherited from Base

read, #read, #size, #update

Constructor Details

#initializeIconDirEntry

Returns a new instance of IconDirEntry



23
24
25
26
27
28
29
30
31
32
# File 'lib/exerb/win32/struct/icon_dir_entry.rb', line 23

def initialize
  @width        = 0
  @height       = 0
  @color_count  = 0
  @reserved     = 0
  @planes       = 0
  @bit_count    = 0
  @bytes_in_res = 0
  @image_offset = 0
end

Instance Attribute Details

#bit_countObject

Returns the value of attribute bit_count



34
35
36
# File 'lib/exerb/win32/struct/icon_dir_entry.rb', line 34

def bit_count
  @bit_count
end

#bytes_in_resObject

Returns the value of attribute bytes_in_res



34
35
36
# File 'lib/exerb/win32/struct/icon_dir_entry.rb', line 34

def bytes_in_res
  @bytes_in_res
end

#color_countObject

Returns the value of attribute color_count



34
35
36
# File 'lib/exerb/win32/struct/icon_dir_entry.rb', line 34

def color_count
  @color_count
end

#heightObject

Returns the value of attribute height



34
35
36
# File 'lib/exerb/win32/struct/icon_dir_entry.rb', line 34

def height
  @height
end

#image_offsetObject

Returns the value of attribute image_offset



34
35
36
# File 'lib/exerb/win32/struct/icon_dir_entry.rb', line 34

def image_offset
  @image_offset
end

#planesObject

Returns the value of attribute planes



34
35
36
# File 'lib/exerb/win32/struct/icon_dir_entry.rb', line 34

def planes
  @planes
end

#reservedObject

Returns the value of attribute reserved



34
35
36
# File 'lib/exerb/win32/struct/icon_dir_entry.rb', line 34

def reserved
  @reserved
end

#widthObject

Returns the value of attribute width



34
35
36
# File 'lib/exerb/win32/struct/icon_dir_entry.rb', line 34

def width
  @width
end

Instance Method Details

#packObject



36
37
38
# File 'lib/exerb/win32/struct/icon_dir_entry.rb', line 36

def pack
  return [@width, @height, @color_count, @reserved, @planes, @bit_count, @bytes_in_res, @image_offset].pack(FORMAT)
end

#unpack(bin) ⇒ Object



40
41
42
43
# File 'lib/exerb/win32/struct/icon_dir_entry.rb', line 40

def unpack(bin)
  @width, @height, @color_count, @reserved, @planes, @bit_count, @bytes_in_res, @image_offset = bin.unpack(FORMAT)
  return self
end