Lines Matching full:blob
5 #include "blob.h"
9 #include "clinic/blob.c.h"
14 class _sqlite3.Blob "pysqlite_Blob *" "clinic_state()->BlobType"
21 if (self->blob) { in close_blob()
22 sqlite3_blob *blob = self->blob; in close_blob() local
23 self->blob = NULL; in close_blob()
26 sqlite3_blob_close(blob); in close_blob()
62 // Return 1 if the blob object is usable, 0 if not.
70 if (self->blob == NULL) { in check_blob()
73 "Cannot operate on a closed blob."); in check_blob()
81 _sqlite3.Blob.close as blob_close
83 Close the blob.
104 PyObject *blob; in pysqlite_close_all_blobs() local
105 if (!PyWeakref_GetRef(weakref, &blob)) { in pysqlite_close_all_blobs()
108 close_blob((pysqlite_Blob *)blob); in pysqlite_close_all_blobs()
109 Py_DECREF(blob); in pysqlite_close_all_blobs()
126 rc = sqlite3_blob_read(self->blob, (void *)&buf, 1, (int)offset); in read_single()
139 assert(length <= sqlite3_blob_bytes(self->blob)); in read_multiple()
140 assert(offset < sqlite3_blob_bytes(self->blob)); in read_multiple()
150 rc = sqlite3_blob_read(self->blob, raw_buffer, (int)length, (int)offset); in read_multiple()
163 _sqlite3.Blob.read as blob_read
171 If the end of the blob is reached, the data up to end of file will be returned.
172 When length is not specified, or is negative, Blob.read() will read until the
173 end of the blob.
184 /* Make sure we never read past "EOB". Also read the rest of the blob if a in blob_read_impl()
186 int blob_len = sqlite3_blob_bytes(self->blob); in blob_read_impl()
209 Py_ssize_t blob_len = sqlite3_blob_bytes(self->blob); in inner_write()
212 PyErr_SetString(PyExc_ValueError, "data longer than blob length"); in inner_write()
219 rc = sqlite3_blob_write(self->blob, buf, (int)len, (int)offset); in inner_write()
231 _sqlite3.Blob.write as blob_write
238 This function cannot change the blob length. Writing beyond the end of the
239 blob will result in an exception being raised.
260 _sqlite3.Blob.seek as blob_seek
268 The origin argument defaults to os.SEEK_SET (absolute blob positioning).
270 and os.SEEK_END (seek relative to the blob's end).
281 int blob_len = sqlite3_blob_bytes(self->blob); in blob_seek_impl()
305 PyErr_SetString(PyExc_ValueError, "offset out of blob range"); in blob_seek_impl()
319 _sqlite3.Blob.tell as blob_tell
321 Return the current access position for the blob.
336 _sqlite3.Blob.__enter__ as blob_enter
338 Blob context manager enter.
353 _sqlite3.Blob.__exit__ as blob_exit
360 Blob context manager exit.
381 return sqlite3_blob_bytes(self->blob); in blob_length()
391 int blob_len = sqlite3_blob_bytes(self->blob); in get_subscript_index()
396 PyErr_SetString(PyExc_IndexError, "Blob index out of range"); in get_subscript_index()
419 int len = sqlite3_blob_bytes(self->blob); in get_slice_info()
435 PyObject *blob = read_multiple(self, stop - start, start); in subscript_slice() local
436 if (blob == NULL) { in subscript_slice()
441 char *blob_buf = PyBytes_AS_STRING(blob); in subscript_slice()
446 Py_DECREF(blob); in subscript_slice()
465 PyErr_SetString(PyExc_TypeError, "Blob indices must be integers"); in blob_subscript()
474 "Blob doesn't support item deletion"); in ass_subscript_index()
507 "Blob doesn't support slice deletion"); in ass_subscript_slice()
528 "Blob slice assignment is wrong size"); in ass_subscript_slice()
562 PyErr_SetString(PyExc_TypeError, "Blob indices must be integers"); in blob_ass_subscript()
598 .name = MODULE_NAME ".Blob",