Class: Aws::Crt::Native::PropertyList

Inherits:
FFI::ManagedStruct
  • Object
show all
Defined in:
lib/aws-crt/native.rb

Overview

Managed PropertyList Struct (for outputs)

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.release(ptr) ⇒ Object



45
46
47
# File 'lib/aws-crt/native.rb', line 45

def self.release(ptr)
  Aws::Crt::Native.aws_crt_property_list_release(ptr)
end

Instance Method Details

#propsObject



31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/aws-crt/native.rb', line 31

def props
  return nil if to_ptr.null?

  return {} unless (self[:len]).positive?

  out = {}
  names_p = self[:names].get_array_of_pointer(0, self[:len])
  values_p = self[:values].get_array_of_pointer(0, self[:len])
  names_p.zip(values_p).each do |name_p, value_p|
    out[name_p.read_string.dup] = value_p.read_string.dup
  end
  out
end