Class: Exerb::Win32::Struct::ImageResourceDirectoryEntry
- Inherits:
-
Base
- Object
- Base
- Exerb::Win32::Struct::ImageResourceDirectoryEntry
show all
- Defined in:
- lib/exerb/win32/struct/image_resource_directory_entry.rb
Overview
Constant Summary
collapse
- FORMAT =
'LL'
Instance Attribute Summary collapse
Attributes inherited from Base
#position
Instance Method Summary
collapse
Methods inherited from Base
read, #read, #size, #update
Constructor Details
Returns a new instance of ImageResourceDirectoryEntry.
24
25
26
27
28
|
# File 'lib/exerb/win32/struct/image_resource_directory_entry.rb', line 24
def initialize
super()
@name = 0
@offset_to_data = 0
end
|
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
30
31
32
|
# File 'lib/exerb/win32/struct/image_resource_directory_entry.rb', line 30
def name
@name
end
|
#offset_to_data ⇒ Object
Returns the value of attribute offset_to_data.
30
31
32
|
# File 'lib/exerb/win32/struct/image_resource_directory_entry.rb', line 30
def offset_to_data
@offset_to_data
end
|
Instance Method Details
#data_is_directory? ⇒ Boolean
57
58
59
|
# File 'lib/exerb/win32/struct/image_resource_directory_entry.rb', line 57
def data_is_directory?
return (@offset_to_data & Exerb::Win32::Const::IMAGE_RESOURCE_DATA_IS_DIRECTORY > 0 ? true : false)
end
|
#id ⇒ Object
41
42
43
|
# File 'lib/exerb/win32/struct/image_resource_directory_entry.rb', line 41
def id
return @name & 0xFFFF
end
|
#name_is_string? ⇒ Boolean
45
46
47
|
# File 'lib/exerb/win32/struct/image_resource_directory_entry.rb', line 45
def name_is_string?
return (@name & Exerb::Win32::Const::IMAGE_RESOURCE_NAME_IS_STRING > 0 ? true : false)
end
|
#offset_to_directory ⇒ Object
61
62
63
|
# File 'lib/exerb/win32/struct/image_resource_directory_entry.rb', line 61
def offset_to_directory
return @offset_to_data & ~Exerb::Win32::Const::IMAGE_RESOURCE_DATA_IS_DIRECTORY
end
|
#offset_to_directory=(value) ⇒ Object
65
66
67
|
# File 'lib/exerb/win32/struct/image_resource_directory_entry.rb', line 65
def offset_to_directory=(value)
@offset_to_data = value | Exerb::Win32::Const::IMAGE_RESOURCE_DATA_IS_DIRECTORY
end
|
#offset_to_string ⇒ Object
49
50
51
|
# File 'lib/exerb/win32/struct/image_resource_directory_entry.rb', line 49
def offset_to_string
return @name & ~Exerb::Win32::Const::IMAGE_RESOURCE_NAME_IS_STRING
end
|
#offset_to_string=(value) ⇒ Object
53
54
55
|
# File 'lib/exerb/win32/struct/image_resource_directory_entry.rb', line 53
def offset_to_string=(value)
@name = value | Exerb::Win32::Const::IMAGE_RESOURCE_NAME_IS_STRING
end
|
#pack ⇒ Object
32
33
34
|
# File 'lib/exerb/win32/struct/image_resource_directory_entry.rb', line 32
def pack
return [@name, @offset_to_data].pack(FORMAT)
end
|
#unpack(bin) ⇒ Object
36
37
38
39
|
# File 'lib/exerb/win32/struct/image_resource_directory_entry.rb', line 36
def unpack(bin)
@name, @offset_to_data = bin.unpack(FORMAT)
return self
end
|