Class: Android::Resource::ResTableType

Inherits:
ChunkHeader show all
Defined in:
lib/android/resource.rb

Instance Attribute Summary collapse

Attributes inherited from ChunkHeader

#header_size, #size, #type

Instance Method Summary collapse

Methods inherited from Chunk

#current_position, #exec_parse, #read_int16, #read_int32, #read_int8

Constructor Details

#initialize(data, offset, pkg) ⇒ ResTableType

Returns a new instance of ResTableType.



285
286
287
288
# File 'lib/android/resource.rb', line 285

def initialize(data, offset, pkg)
  @pkg = pkg
  super(data, offset)
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



282
283
284
# File 'lib/android/resource.rb', line 282

def config
  @config
end

#entry_countObject (readonly)

Returns the value of attribute entry_count.



282
283
284
# File 'lib/android/resource.rb', line 282

def entry_count
  @entry_count
end

#entry_startObject (readonly)

Returns the value of attribute entry_start.



282
283
284
# File 'lib/android/resource.rb', line 282

def entry_start
  @entry_start
end

#idObject (readonly)

Returns the value of attribute id.



282
283
284
# File 'lib/android/resource.rb', line 282

def id
  @id
end

#keysObject (readonly)

Returns the value of attribute keys.



283
284
285
# File 'lib/android/resource.rb', line 283

def keys
  @keys
end

Instance Method Details

#[](index) ⇒ ResTableEntry, ResTableMapEntry

Parameters:

  • index (String)

    key name

  • index (Fixnum)

    key index

Returns:



294
295
296
# File 'lib/android/resource.rb', line 294

def [](index)
  @entries[index]
end

#inspectObject



324
325
326
327
# File 'lib/android/resource.rb', line 324

def inspect
  "<ResTableType offset:0x#{@offset.to_s(16)}, id:#{@id}, " +
  "count:#{@entry_count}, start:0x#{@entry_start.to_s(16)}>"
end