Sha256: 4ac43157af9a1fed21d76649cfa3bf5cb3a537bc1b3665316bb1a5fceaf6cebf

Contents?: true

Size: 882 Bytes

Versions: 3

Compression:

Stored size: 882 Bytes

Contents

# frozen_string_literal: true

require "forwardable"
require_relative "../gdal"

module GDAL
  # @return [FFI::GDAL::RPCInfo]
  attr_reader :c_struct

  # Wrapper for FFI::GDAL::RPCInfo.
  class RPCInfo
    extend Forwardable
    def_delegator :@c_struct, :[]

    # @param struct_or_ptr [FFI::GDAL::RPCInfo, FFI::Pointer]
    def initialize(struct_or_ptr = nil)
      @c_struct = case struct_or_ptr
                  when FFI::GDAL::RPCInfo
                    struct_or_ptr
                  when FFI::Pointer
                    FFI::GDAL::RPCInfo.new(struct_or_ptr)
                  else
                    FFI::GDAL::RPCInfo.new
                  end
    end

    # @return [FFI::Pointer]
    def c_pointer
      @c_struct.to_ptr
    end

    # @return [Array<String>]
    def to_metadata
      FFI::GDAL::Alg.RPCInfoToMD(@c_struct).read_array_of_string(0)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ffi-gdal-1.1.0 lib/gdal/rpc_info.rb
ffi-gdal-1.0.4 lib/gdal/rpc_info.rb
ffi-gdal-1.0.3 lib/gdal/rpc_info.rb