class HMap::HMapHeader

HMapHeader structure. @see clang.llvm.org/doxygen/structclang_1_1HMapHeader.html @abstract

Constants

FORMAT
SIZEOF

@see HMapStructure::SIZEOF @api private

Attributes

magic[R]

@return [HMap::HMapView, nil] the raw view associated with the load command,

or nil if the HMapHeader was created via {create}.
max_value_length[R]

@return [HMap::HMapView, nil] the raw view associated with the load command,

or nil if the HMapHeader was created via {create}.
num_buckets[R]

@return [HMap::HMapView, nil] the raw view associated with the load command,

or nil if the HMapHeader was created via {create}.
num_entries[R]

@return [HMap::HMapView, nil] the raw view associated with the load command,

or nil if the HMapHeader was created via {create}.
reserved[R]

@return [HMap::HMapView, nil] the raw view associated with the load command,

or nil if the HMapHeader was created via {create}.
strings_offset[R]

@return [HMap::HMapView, nil] the raw view associated with the load command,

or nil if the HMapHeader was created via {create}.
version[R]

@return [HMap::HMapView, nil] the raw view associated with the load command,

or nil if the HMapHeader was created via {create}.

Public Class Methods

new(magic, version, reserved, strings_offset, num_entries, num_buckets, max_value_length) click to toggle source

@api private

Calls superclass method
# File lib/cocoapods-hmap/hmap_struct.rb, line 78
def initialize(magic, version, reserved, strings_offset, num_entries, num_buckets, max_value_length)
  @magic = magic
  @version = version
  @reserved = reserved
  @strings_offset = strings_offset
  @num_entries = num_entries
  @num_buckets = num_buckets
  @max_value_length = max_value_length
  super()
end

Public Instance Methods

description() click to toggle source
# File lib/cocoapods-hmap/hmap_struct.rb, line 95
    def description
      <<-DESC
        Hash bucket count: #{@num_buckets}
        String table entry count: #{@num_entries}
        Max value length: #{@max_value_length}
      DESC
    end
serialize() click to toggle source

@return [String] the serialized fields of the mafile

# File lib/cocoapods-hmap/hmap_struct.rb, line 90
def serialize
  format = Utils.specialize_format(FORMAT, SWAPPED)
  [magic, version, reserved, strings_offset, num_entries, num_buckets, max_value_length].pack(format)
end
to_h() click to toggle source
Calls superclass method HMap::HMapStructure#to_h
# File lib/cocoapods-hmap/hmap_struct.rb, line 103
def to_h
  {
    'magic' => magic,
    'version' => version,
    'reserved' => reserved,
    'strings_offset' => strings_offset,
    'num_entries' => num_entries,
    'num_buckets' => num_buckets,
    'max_value_length' => max_value_length
  }.merge super
end