From 4dc34bc0e052320feebdc3a9aed0df1d3e8af181 Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Sat, 10 May 2014 18:32:33 -0300 Subject: API: Implement buffer_{get,set}_slice --- src/api/buffer.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/api/buffer.h') diff --git a/src/api/buffer.h b/src/api/buffer.h index 3459ce8e45..49379e3bc9 100644 --- a/src/api/buffer.h +++ b/src/api/buffer.h @@ -34,25 +34,34 @@ void buffer_set_line(Buffer buffer, int64_t index, Object line, Error *err); /// /// @param buffer The buffer handle /// @param start The first line index -/// @param end The last line index(exclusive) +/// @param end The last line index +/// @param include_start True if the slice includes the `start` parameter +/// @param include_end True if the slice includes the `end` parameter /// @param[out] err Details of an error that may have occurred /// @return An array of lines StringArray buffer_get_slice(Buffer buffer, int64_t start, int64_t end, + bool include_start, + bool include_end, Error *err); /// Replaces a line range on the buffer /// /// @param buffer The buffer handle /// @param start The first line index -/// @param end The last line index(exclusive) -/// @param lines An array of lines to use as replacement +/// @param end The last line index +/// @param include_start True if the slice includes the `start` parameter +/// @param include_end True if the slice includes the `end` parameter +/// @param lines An array of lines to use as replacement(A 0-length array +/// will simply delete the line range) /// @param[out] err Details of an error that may have occurred void buffer_set_slice(Buffer buffer, int64_t start, int64_t end, - StringArray lines, + bool include_start, + bool include_end, + StringArray replacement, Error *err); /// Gets a buffer variable -- cgit