Next: , Previous: Inserting And Deleting Objects, Up: Buffer Protocol


18.4.1.4 Getting Objects Out Of The Buffer

— Generic Function: drei-buffer:buffer-object buffer offset

Return the object at the offset in the buffer. The first object has offset 0. If offset is less than zero or greater than or equal to the size of the buffer, a no-such-offset condition is signaled.

— Generic Function: (setf drei-buffer:buffer-object) object buffer offset

Set the object at the offset in the buffer. The first object has offset 0. If offset is less than zero or greater than or equal to the size of the buffer, a no-such-offset condition is signaled.

— Generic Function: drei-buffer:buffer-sequence buffer offset1 offset2

Return the contents of the buffer starting at offset1 and ending at offset2-1 as a sequence. If either of the offsets is less than zero or greater than or equal to the size of the buffer, a no-such-offset condition is signaled. If offset2 is smaller than or equal to offset1, an empty sequence will be returned.

— Generic Function: drei-buffer:object-before mark

Return the object that is immediately before the mark. If mark is at the beginning of the buffer, a no-such-offset condition is signaled. If the mark is at the beginning of a line, but not at the beginning of the buffer, a newline character is returned.

— Generic Function: drei-buffer:object-after mark

Return the object that is immediately after the mark. If mark is at the end of the buffer, a no-such-offset condition is signaled. If the mark is at the end of a line, but not at the end of the buffer, a newline character is returned.

— Generic Function: drei-buffer:region-to-sequence mark1 offset2

Return a freshly allocated sequence of the objects after mark1 and before mark2. An error is signaled if the two marks are positioned in different buffers. If mark1 is positioned at an offset equal to or greater than that of mark2, an empty sequence is returned. It is acceptable to pass an offset in place of one of the marks. This function calls buffer-sequence with the appropriate arguments.