### Home Classes Methods

### In Files

- lib/ffi/tools/struct_generator.rb

### Parent

Object

### Methods

- ::new
- #offset=
- #to_config

### Files

- Makefile
- LICENSE
- compile
- configure
- depcomp
- stamp-vti
- install-sh
- libtool-version
- mdate-sh
- missing

### Class/Module Index

Quicksearch

- FFI
- FFI::AbstractMemory
- FFI::ArrayType
- FFI::AutoPointer
- FFI::AutoPointer::CallableReleaser
- FFI::AutoPointer::DefaultReleaser
- FFI::AutoPointer::Releaser
- FFI::Buffer
- FFI::ConstGenerator
- FFI::ConstGenerator::Constant
- FFI::DataConverter
- FFI::DynamicLibrary
- FFI::DynamicLibrary::Symbol
- FFI::Enum
- FFI::Enums
- FFI::Function
- FFI::FunctionType
- FFI::Generator
- FFI::Generator::Task
- FFI::IO
- FFI::LastError
- FFI::ManagedStruct
- FFI::MemoryPointer
- FFI::NullPointerError
- FFI::Platform
- FFI::PlatformError
- FFI::Pointer
- FFI::StrPtrConverter
- FFI::Struct
- FFI::Struct::ManagedStructConverter
- FFI::StructByReference
- FFI::StructByValue
- FFI::StructGenerator
- FFI::StructGenerator::Field
- FFI::StructLayout
- FFI::StructLayout::Array
- FFI::StructLayout::Enum
- FFI::StructLayout::Field
- FFI::StructLayout::Function
- FFI::StructLayout::InnerStruct
- FFI::StructLayout::Mapped
- FFI::StructLayout::Number
- FFI::StructLayout::Pointer
- FFI::StructLayout::String
- FFI::StructLayoutBuilder
- FFI::TypesGenerator
- FFI::Union
- FFI::VariadicInvoker

No matching classes.

# FFI::StructGenerator::Field

A field in a Struct.

### Attributes

name[R]
offset[R]
size[RW]
type[R]

### Public Class Methods

new(name, type) click to toggle source

    # File lib/ffi/tools/struct_generator.rb, line 172
    def initialize(name, type)
      @name = name
      @type = type
      @offset = nil
      @size = nil
    end

### Public Instance Methods

offset=(o) click to toggle source

    # File lib/ffi/tools/struct_generator.rb, line 179
    def offset=(o)
      @offset = o
    end

to_config(name) click to toggle source

    # File lib/ffi/tools/struct_generator.rb, line 183
    def to_config(name)
      buf = []
      buf << "rbx.platform.#{name}.#{@name}.offset = #{@offset}"
      buf << "rbx.platform.#{name}.#{@name}.size = #{@size}"
      buf << "rbx.platform.#{name}.#{@name}.type = #{@type}" if @type
      buf
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.