Class: PGlarge

Inherits:
Object
  • Object
show all
Defined in:
ext/postgres.c,
ext/postgres.c

Overview

******************************************************************

The class to access large objects.
An instance of this class is created as the  result of
PGconn#lo_import, PGconn#lo_create, and PGconn#lo_open.

Constant Summary collapse

INV_WRITE =
INT2FIX(INV_WRITE)
INV_READ =
INT2FIX(INV_READ)
SEEK_SET =
INT2FIX(SEEK_SET)
SEEK_CUR =
INT2FIX(SEEK_CUR)
SEEK_END =
INT2FIX(SEEK_END)

Instance Method Summary collapse

Instance Method Details

#closeObject

Closes a large object. Closed when they are garbage-collected.



2226
2227
2228
# File 'ext/postgres.c', line 2226

static VALUE
pglarge_close(obj)
VALUE obj;

#export(file) ⇒ Object

Saves the large object to a file.



2402
2403
2404
# File 'ext/postgres.c', line 2402

static VALUE
pglarge_export(obj, filename)
VALUE obj, filename;

#oidObject

Returns the large object’s oid.



2177
2178
2179
# File 'ext/postgres.c', line 2177

static VALUE
pglarge_oid(obj)
VALUE obj;

#open([mode]) ⇒ Object

Opens a large object. The mode argument specifies the mode for the opened large object, which is either INV_READ or INV_WRITE.



2194
2195
2196
# File 'ext/postgres.c', line 2194

static VALUE
pglarge_open(argc, argv, obj)
int argc;

#read([length]) ⇒ Object

Attempts to read length bytes from large object. If no length is given, reads all data.



2290
2291
2292
# File 'ext/postgres.c', line 2290

static VALUE
pglarge_read(argc, argv, obj)
int argc;

#seek(offset, whence) ⇒ Object

Move the large object pointer to the offset. Valid values for whence are SEEK_SET, SEEK_CUR, and SEEK_END. (Or 0, 1, or 2.)



2354
2355
2356
# File 'ext/postgres.c', line 2354

static VALUE
pglarge_seek(obj, offset, whence)
VALUE obj, offset, whence;

#sizeObject

Returns the size of the large object.



2374
2375
2376
# File 'ext/postgres.c', line 2374

static VALUE
pglarge_size(obj)
VALUE obj;

#tellObject

Returns the current position of the large object pointer.



2246
2247
2248
# File 'ext/postgres.c', line 2246

static VALUE
pglarge_tell(obj)
VALUE obj;

Deletes the large object.



2423
2424
2425
# File 'ext/postgres.c', line 2423

static VALUE
pglarge_unlink(obj)
VALUE obj;

#write(str) ⇒ Object

Writes the string str to the large object. Returns the number of bytes written.



2326
2327
2328
# File 'ext/postgres.c', line 2326

static VALUE
pglarge_write(obj, buffer)
VALUE obj, buffer;