class BinParser

Public Class Methods

parse(uint8_array, config) click to toggle source
# File lib/binp.rb, line 5
def self.parse(uint8_array, config)
  config.flat_map { |e|
    # ビットフラグかどうかを確認
    if e['type'] == BinParserElement::Type::FLAGS
      e = BinParserElement.get_flags(uint8_array, e)
    else
      e['value'] = BinParserElement.get_value(uint8_array, e['offset'], e['size'], e['type'], e['endianness'], e['value_label'])
    end
    e
  }
end