Class: Exerb::Win32::Struct::VersionInfoBlock
- Defined in:
- lib/exerb/win32/struct/version_info_block.rb
Overview
#
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#key ⇒ Object
Returns the value of attribute key.
-
#total_length ⇒ Object
Returns the value of attribute total_length.
-
#type ⇒ Object
Returns the value of attribute type.
-
#value_length ⇒ Object
Returns the value of attribute value_length.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize ⇒ VersionInfoBlock
constructor
A new instance of VersionInfoBlock.
- #pack ⇒ Object
- #pack_header ⇒ Object
- #read(io) ⇒ Object
- #unpack ⇒ Object
Methods inherited from Base
Constructor Details
#initialize ⇒ VersionInfoBlock
Returns a new instance of VersionInfoBlock.
22 23 24 25 26 27 28 |
# File 'lib/exerb/win32/struct/version_info_block.rb', line 22 def initialize @total_length = 0 @value_length = 0 @type = 0 @key = "" @data = "" end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
30 31 32 |
# File 'lib/exerb/win32/struct/version_info_block.rb', line 30 def data @data end |
#key ⇒ Object
Returns the value of attribute key.
30 31 32 |
# File 'lib/exerb/win32/struct/version_info_block.rb', line 30 def key @key end |
#total_length ⇒ Object
Returns the value of attribute total_length.
30 31 32 |
# File 'lib/exerb/win32/struct/version_info_block.rb', line 30 def total_length @total_length end |
#type ⇒ Object
Returns the value of attribute type.
30 31 32 |
# File 'lib/exerb/win32/struct/version_info_block.rb', line 30 def type @type end |
#value_length ⇒ Object
Returns the value of attribute value_length.
30 31 32 |
# File 'lib/exerb/win32/struct/version_info_block.rb', line 30 def value_length @value_length end |
Instance Method Details
#pack ⇒ Object
32 33 34 |
# File 'lib/exerb/win32/struct/version_info_block.rb', line 32 def pack return Exerb::Utility.alignment(self.pack_header + self.pack_string, 4) + @data.to_s end |
#pack_header ⇒ Object
36 37 38 |
# File 'lib/exerb/win32/struct/version_info_block.rb', line 36 def pack_header return [@total_length, @value_length, @type].pack('SSS') end |
#read(io) ⇒ Object
49 50 51 52 53 54 55 56 57 |
# File 'lib/exerb/win32/struct/version_info_block.rb', line 49 def read(io) @total_length = io.read(2).unpack('S')[0] @value_length = io.read(2).unpack('S')[0] @type = io.read(2).unpack('S')[0] @key = self.read_string(io) @data = io.read(@value_length) return self end |
#unpack ⇒ Object
45 46 47 |
# File 'lib/exerb/win32/struct/version_info_block.rb', line 45 def unpack raise NotImplementedError end |