Class: OCI8::BFILE
Instance Method Summary collapse
- #dir_alias ⇒ Object
- #dir_alias=(dir_alias) ⇒ Object
- #exists? ⇒ Boolean
- #filename ⇒ Object
- #filename=(filename) ⇒ Object
- #initialize(*args) ⇒ Object constructor
- #size=(dummy) ⇒ Object
- #truncate(dummy) ⇒ Object
- #write(dummy) ⇒ Object
Constructor Details
#initialize(*args) ⇒ Object
511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 |
# File 'ext/oci8/lob.c', line 511 static VALUE oci8_bfile_initialize(int argc, VALUE *argv, VALUE self) { oci8_lob_t *lob = DATA_PTR(self); VALUE svc; VALUE dir_alias; VALUE filename; rb_scan_args(argc, argv, "12", &svc, &dir_alias, &filename); TO_SVCCTX(svc); /* check argument type */ oci_lc(OCIDescriptorAlloc(oci8_envhp, &lob->base.hp.ptr, OCI_DTYPE_LOB, 0, NULL)); lob->base.type = OCI_DTYPE_LOB; lob->svc = svc; lob->pos = 0; lob->char_width = 1; lob->csfrm = SQLCS_IMPLICIT; lob->lobtype = OCI_TEMP_BLOB; lob->state = S_BFILE_CLOSE; if (argc != 1) { OCI8SafeStringValue(dir_alias); OCI8SafeStringValue(filename); oci8_bfile_set_name(self, dir_alias, filename); } oci8_link_to_parent((oci8_base_t*)lob, (oci8_base_t*)DATA_PTR(svc)); return Qnil; } |
Instance Method Details
#dir_alias ⇒ Object
537 538 539 540 541 542 543 |
# File 'ext/oci8/lob.c', line 537 static VALUE oci8_bfile_get_dir_alias(VALUE self) { VALUE dir_alias; oci8_bfile_get_name(self, &dir_alias, NULL); return dir_alias; } |
#dir_alias=(dir_alias) ⇒ Object
553 554 555 556 557 558 559 560 561 562 |
# File 'ext/oci8/lob.c', line 553 static VALUE oci8_bfile_set_dir_alias(VALUE self, VALUE dir_alias) { VALUE filename; OCI8SafeStringValue(dir_alias); oci8_bfile_get_name(self, NULL, &filename); oci8_bfile_set_name(self, dir_alias, filename); rb_ivar_set(self, id_dir_alias, dir_alias); return dir_alias; } |
#exists? ⇒ Boolean
575 576 577 578 579 580 581 582 583 |
# File 'ext/oci8/lob.c', line 575 static VALUE oci8_bfile_exists_p(VALUE self) { oci8_lob_t *lob = DATA_PTR(self); oci8_svcctx_t *svcctx = oci8_get_svcctx(lob->svc); boolean flag; oci_lc(OCILobFileExists_nb(svcctx, svcctx->base.hp.svc, oci8_errhp, lob->base.hp.lob, &flag)); return flag ? Qtrue : Qfalse; } |
#filename ⇒ Object
545 546 547 548 549 550 551 |
# File 'ext/oci8/lob.c', line 545 static VALUE oci8_bfile_get_filename(VALUE self) { VALUE filename; oci8_bfile_get_name(self, NULL, &filename); return filename; } |
#filename=(filename) ⇒ Object
564 565 566 567 568 569 570 571 572 573 |
# File 'ext/oci8/lob.c', line 564 static VALUE oci8_bfile_set_filename(VALUE self, VALUE filename) { VALUE dir_alias; OCI8SafeStringValue(filename); oci8_bfile_get_name(self, &dir_alias, NULL); oci8_bfile_set_name(self, dir_alias, filename); rb_ivar_set(self, id_filename, filename); return filename; } |
#size=(dummy) ⇒ Object
585 586 587 588 |
# File 'ext/oci8/lob.c', line 585 static VALUE oci8_bfile_error(VALUE self, VALUE dummy) { rb_raise(rb_eRuntimeError, "cannot modify a read-only BFILE object"); } |
#truncate(dummy) ⇒ Object
585 586 587 588 |
# File 'ext/oci8/lob.c', line 585 static VALUE oci8_bfile_error(VALUE self, VALUE dummy) { rb_raise(rb_eRuntimeError, "cannot modify a read-only BFILE object"); } |
#write(dummy) ⇒ Object
585 586 587 588 |
# File 'ext/oci8/lob.c', line 585 static VALUE oci8_bfile_error(VALUE self, VALUE dummy) { rb_raise(rb_eRuntimeError, "cannot modify a read-only BFILE object"); } |