Class: OSX::Boxed
- Inherits:
-
Object
- Object
- OSX::Boxed
- Defined in:
- src/objc/BridgeSupport.m,
src/objc/BridgeSupport.m
Overview
Representaion of C-types and C-structures in Ruby world.
Information of types are described in bridgesupport files located under frameworks.
Class Method Summary (collapse)
-
+ (String) encoding
Returns type encoding.
-
+ (Array) fields
Returns field names.
-
+ (Boolean) opaque?
Returns opaque or not.
-
+ (Number) size
Returns allocation size.
Class Method Details
+ (String) encoding
Returns type encoding.
398 399 400 401 402 |
# File 'src/objc/BridgeSupport.m', line 398
static VALUE
rb_bs_boxed_get_encoding (VALUE rcv)
{
return rb_ivar_get(rcv, ivarEncodingID);
}
|
+ (Array) fields
Returns field names.
432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 |
# File 'src/objc/BridgeSupport.m', line 432
static VALUE
rb_bs_boxed_get_fields (VALUE rcv)
{
struct bsBoxed *boxed;
VALUE ary;
unsigned i;
boxed = find_bs_boxed_for_klass(rcv);
ary = rb_ary_new();
if (boxed->type != bsBoxedStructType)
return ary;
for (i = 0; i < boxed->opt.s.field_count; i++) {
struct bsStructField * field;
field = &boxed->opt.s.fields[i];
rb_ary_push(ary, ID2SYM(rb_intern(field->name)));
}
return ary;
}
|
+ (Boolean) opaque?
Returns opaque or not.
463 464 465 466 467 468 469 470 471 472 473 |
# File 'src/objc/BridgeSupport.m', line 463
static VALUE
rb_bs_boxed_is_opaque (VALUE rcv)
{
struct bsBoxed *boxed;
BOOL opaque;
boxed = find_bs_boxed_for_klass(rcv);
opaque = boxed->type == bsBoxedStructType ? boxed->opt.s.opaque : YES;
return opaque ? Qtrue : Qfalse;
}
|
+ (Number) size
Returns allocation size.
413 414 415 416 417 418 419 420 421 |
# File 'src/objc/BridgeSupport.m', line 413
static VALUE
rb_bs_boxed_get_size (VALUE rcv)
{
struct bsBoxed *boxed;
boxed = find_bs_boxed_for_klass(rcv);
return LONG2NUM(bs_boxed_size(boxed));
}
|