Class: HMap::MapFile
- Inherits:
-
Object
- Object
- HMap::MapFile
- Defined in:
- lib/cocoapods-hmap/mapfile.rb
Overview
hmap file writer
Instance Attribute Summary collapse
-
#buckets ⇒ Array<HMap::HMapBucketStr>
readonly
An array of the file’s bucktes.
-
#string_table ⇒ Object
readonly
Mapfile string_table.
Instance Method Summary collapse
-
#initialize(strings, buckets) ⇒ MapFile
constructor
private
A new instance of MapFile.
-
#serialize ⇒ String
The serialized fields of the mafile.
-
#write(path) ⇒ void
Write all mafile data to the given filename.
Constructor Details
#initialize(strings, buckets) ⇒ MapFile
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of MapFile.
14 15 16 17 18 |
# File 'lib/cocoapods-hmap/mapfile.rb', line 14 def initialize(strings, buckets) @string_table = strings @buckets = buckets @map_data = HMapData.new(buckets) end |
Instance Attribute Details
#buckets ⇒ Array<HMap::HMapBucketStr> (readonly)
Note:
bucktes are provided in order of ascending offset.
Returns an array of the file’s bucktes.
11 12 13 |
# File 'lib/cocoapods-hmap/mapfile.rb', line 11 def buckets @buckets end |
#string_table ⇒ Object (readonly)
Returns mapfile string_table.
7 8 9 |
# File 'lib/cocoapods-hmap/mapfile.rb', line 7 def string_table @string_table end |
Instance Method Details
#serialize ⇒ String
Returns the serialized fields of the mafile.
21 22 23 |
# File 'lib/cocoapods-hmap/mapfile.rb', line 21 def serialize @map_data.serialize + @string_table end |
#write(path) ⇒ void
This method returns an undefined value.
Write all mafile data to the given filename.
28 29 30 31 |
# File 'lib/cocoapods-hmap/mapfile.rb', line 28 def write(path) contents = serialize Utils.update_changed_file(path, contents) end |