Class: NWRFC::Structure

Inherits:
DataContainer show all
Includes:
DataContainer
Defined in:
lib/nwrfc.rb,
lib/nwrfc.old.rb

Overview

Represents a structure

Instance Method Summary collapse

Constructor Details

This class inherits a constructor from NWRFC::DataContainer

Instance Method Details

#fieldsObject

Return a list (array) of symbols representing the names of the fields of this structure


TODO: This is not working!



392
393
394
395
396
397
398
399
400
401
402
403
404
405
# File 'lib/nwrfc.rb', line 392

def fields
  fc = FFI::MemoryPointer.new(:uint)
  rc = NWRFCLib.get_field_count(@handle, fc, @error)
  NWRFC.check_error(@error) if rc > 0
  fc = fc.read_uint
  fd = NWRFCLib::RFCFieldDesc.new
  fields = []
  debugger
  fc.times do |index|
    rc = NWRFCLib.get_field_desc_by_index(@handle, index, fd.to_ptr, @error.to_ptr)
    NWRFC.check_error(@error) if rc > 0
    fields << fd[:name].get_str.to_sym
  end
end