Class: Exerb::FileTable::Entry

Inherits:
Object
  • Object
show all
Defined in:
lib/exerb/file_table.rb

Overview

#

Defined Under Namespace

Classes: Header

Constant Summary collapse

FLAG_TYPE_RUBY_SCRIPT =
0x01
FLAG_TYPE_EXTENSION_LIBRARY =
0x02
FLAG_TYPE_DYNAMIC_LIBRARY =
0x03
FLAG_TYPE_RESOURCE_LIBRARY =
0x04
FLAG_TYPE_DATA_BINARY =
0x05
FLAG_TYPE_COMPILED_SCRIPT =
0x06
FLAG_NO_REPLACE_FUNCTION =
0x08

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, data, flag, zipd) ⇒ Entry

Returns a new instance of Entry.



142
143
144
145
146
147
# File 'lib/exerb/file_table.rb', line 142

def initialize(id, data, flag, zipd)
  @id   = id
  @data = data
  @flag = flag
  @zipd = zipd
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



149
150
151
# File 'lib/exerb/file_table.rb', line 149

def data
  @data
end

#flagObject (readonly)

Returns the value of attribute flag.



149
150
151
# File 'lib/exerb/file_table.rb', line 149

def flag
  @flag
end

#idObject (readonly)

Returns the value of attribute id.



149
150
151
# File 'lib/exerb/file_table.rb', line 149

def id
  @id
end

Instance Method Details

#pack_header(pool) ⇒ Object



151
152
153
154
155
156
157
158
159
160
# File 'lib/exerb/file_table.rb', line 151

def pack_header(pool)
  entry_header = Exerb::FileTable::Entry::Header.new
  entry_header.id             = @id
  entry_header.offset_of_file = pool.size
  entry_header.size_of_file   = @data.size
  entry_header.flag_of_file   = @flag
  entry_header.zipd           = @zipd

  return entry_header.pack
end

#pack_poolObject



162
163
164
# File 'lib/exerb/file_table.rb', line 162

def pack_pool
  return Exerb::Utility.alignment16(@data)
end