Sha256: 45e48b7467a8a17a7a7a94e97d244f56cfebba063f9d305f5a164a0fa7f5a846

Contents?: true

Size: 1.58 KB

Versions: 9

Compression:

Stored size: 1.58 KB

Contents

# frozen_string_literal: true

require_relative '../cpl/conv'

module FFI
  module OGR
    module FieldTypes
      class IntegerList < FFI::Struct
        layout :count, :int,
          :list, :pointer
      end

      class Integer64List < FFI::Struct
        layout :count, CPL::Port.find_type(:GIntBig),
          :list, :pointer
      end

      class RealList < FFI::Struct
        layout :count, :int,
          :list, :pointer
      end

      class StringList < FFI::Struct
        layout :count, :int,
          :list, :pointer
      end

      class Binary < FFI::Struct
        layout :count, :int,
          :data, :pointer
      end

      class Set < FFI::Struct
        layout :marker1, :int,
          :marker2, :int
      end

      class Date < FFI::Struct
        layout :year, CPL::Port.find_type(:GInt16),
          :month, CPL::Port.find_type(:GByte),
          :day, CPL::Port.find_type(:GByte),
          :hour, CPL::Port.find_type(:GByte),
          :minute, CPL::Port.find_type(:GByte),
          :second, CPL::Port.find_type(:GByte),
          :tz_flag, CPL::Port.find_type(:GByte)
      end
    end

    class Field < FFI::Union
      include FieldTypes

      layout :integer, :int,
        :integer64, CPL::Port.find_type(:GIntBig),
        :real, :double,
        :string, :pointer,
        :integer_list, FieldTypes::IntegerList,
        :integer64_list, FieldTypes::Integer64List,
        :real_list, FieldTypes::RealList,
        :string_list, FieldTypes::StringList,
        :binary, FieldTypes::Binary,
        :set, FieldTypes::Set,
        :date, FieldTypes::Date
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ffi-gdal-1.0.0.beta16 lib/ffi/ogr/field.rb
ffi-gdal-1.0.0.beta15 lib/ffi/ogr/field.rb
ffi-gdal-1.0.0.beta14 lib/ffi/ogr/field.rb
ffi-gdal-1.0.0.beta13 lib/ffi/ogr/field.rb
ffi-gdal-1.0.0.beta12 lib/ffi/ogr/field.rb
ffi-gdal-1.0.0.beta11 lib/ffi/ogr/field.rb
ffi-gdal-1.0.0.beta10 lib/ffi/ogr/field.rb
ffi-gdal-1.0.0.beta9 lib/ffi/ogr/field.rb
ffi-gdal-1.0.0.beta8 lib/ffi/ogr/field.rb