Class: FFI::StructLayout::InnerStruct

### Home Classes Methods

### In Files

- lib/ffi/struct.rb

### Parent

Field

### Methods

- #get
- #put

### Files

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

### 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::Function
- FFI::FunctionType
- FFI::Generator
- FFI::Generator::Task
- FFI::IO
- FFI::LastError
- FFI::ManagedStruct
- FFI::MemoryPointer
- FFI::NativeType
- FFI::Platform
- FFI::PlatformError
- FFI::Pointer
- FFI::StrPtrConverter
- FFI::Struct
- FFI::Struct::InlineArray
- 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::Type
- FFI::Type::Builtin
- FFI::TypesGenerator
- FFI::Union
- FFI::VariadicInvoker

No matching classes.

# FFI::StructLayout::InnerStruct

### Public Instance Methods

get(ptr) click to toggle source

    # File lib/ffi/struct.rb, line 63
    def get(ptr)
      type.struct_class.new(ptr.slice(self.offset, self.size))
    end

put(ptr, value) click to toggle source

    # File lib/ffi/struct.rb, line 67
    def put(ptr, value)
      raise TypeError, "wrong value type (expected #{type.struct_class}" unless value.is_a?(type.struct_class)
      ptr.slice(self.offset, self.size).__copy_from__(value.pointer, self.size)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.