Class: FFI::StructLayout::CharArray
- Inherits:
-
StructClass::InlineArray
- Object
- StructClass::InlineArray
- FFI::StructLayout::CharArray
- Defined in:
- ext/ffi_c/Struct.c
Instance Method Summary (collapse)
- - (Object) to_s (also: #to_str)
Methods inherited from StructClass::InlineArray
#[], #[]=, #each, #initialize, #size, #to_a, #to_ptr
Constructor Details
This class inherits a constructor from StructClass::InlineArray
Instance Method Details
- (Object) to_s Also known as: to_str
611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 |
# File 'ext/ffi_c/Struct.c', line 611
static VALUE
inline_array_to_s(VALUE self)
{
InlineArray* array;
VALUE argv[2];
Data_Get_Struct(self, InlineArray, array);
if (array->componentType->nativeType != NATIVE_INT8 && array->componentType->nativeType != NATIVE_UINT8) {
VALUE dummy = Qnil;
return rb_call_super(0, &dummy);
}
argv[0] = UINT2NUM(array->field->offset);
argv[1] = UINT2NUM(array->length);
return rb_funcall2(array->rbMemory, rb_intern("get_string"), 2, argv);
}
|