### Home Classes Methods

### In Files

- lib/ffi/tools/struct_generator.rb

### Parent

Object

### Methods

- ::new
- #offset=
- #to_config

### Files

- History.txt
- README.rdoc

### Class/Module Index

Quicksearch

- FFI
- FFI::AutoPointer
- FFI::AutoPointer::CallableReleaser
- FFI::AutoPointer::DefaultReleaser
- FFI::AutoPointer::Releaser
- FFI::ConstGenerator
- FFI::ConstGenerator::Constant
- FFI::Enum
- FFI::Enums
- FFI::Generator
- FFI::Generator::Task
- FFI::IO
- FFI::Library
- FFI::ManagedStruct
- FFI::NotFoundError
- FFI::Platform
- FFI::PlatformError
- FFI::Pointer
- FFI::StrPtrConverter
- FFI::Struct
- FFI::Struct::ManagedStructConverter
- FFI::StructGenerator
- FFI::StructGenerator::Field
- FFI::StructLayout
- FFI::StructLayout::Enum
- FFI::StructLayout::InnerStruct
- FFI::StructLayout::Mapped
- 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.