From a9b13b60a5aad726d7d7dd7fdc5153b1561fb591 Mon Sep 17 00:00:00 2001 From: Gian Mario Tagliaretti Date: Sat, 13 Jun 2009 01:25:06 +0200 Subject: Add docs for gio.BufferedInputStream --- docs/Makefile.am | 2 + docs/reference/pygio-bufferedinputstream.xml | 431 +++++++++++++++++++++++++++ docs/reference/pygio-classes.xml | 1 + 3 files changed, 434 insertions(+) create mode 100644 docs/reference/pygio-bufferedinputstream.xml (limited to 'docs') diff --git a/docs/Makefile.am b/docs/Makefile.am index d32d4e9..f9255d1 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -19,6 +19,7 @@ HTML_FILES = \ html/class-gioapplaunchcontext.html \ html/class-gioappinfo.html \ html/class-gioasyncresult.html \ + html/class-giobufferedinputstream.html \ html/class-giocancellable.html \ html/class-giodrive.html \ html/class-gioemblem.html \ @@ -76,6 +77,7 @@ XML_FILES = \ reference/pygio-applaunchcontext.xml \ reference/pygio-appinfo.xml \ reference/pygio-asyncresult.xml \ + reference/pygio-bufferedinputstream.xml \ reference/pygio-cancellable.xml \ reference/pygio-drive.xml \ reference/pygio-emblem.xml \ diff --git a/docs/reference/pygio-bufferedinputstream.xml b/docs/reference/pygio-bufferedinputstream.xml new file mode 100644 index 0000000..97d5046 --- /dev/null +++ b/docs/reference/pygio-bufferedinputstream.xml @@ -0,0 +1,431 @@ + + + + + + gio.BufferedInputStream + Buffered Input Stream + + + + Synopsis + + + gio.BufferedInputStream + gio.FilterInputStream + + + gio.BufferedInputStream + base_stream + + + + fill + count + cancellableNone + + + fill_async + count + callback + io_priorityglib.PRIORITY_DEFAULT + cancellableNone + user_dataNone + + + fill_finish + result + + + get_available + + + + get_buffer_size + + + + read_byte + cancellableNone + + + set_buffer_size + size + + + + + +Functions + + + gio.buffered_input_stream_new_sized + size + + + + + + Ancestry + ++-- gobject.GObject + +-- gio.InputStream + +-- gio.FilterInputStream + +-- gio.BufferedInputStream + + + + + + gio.FilterInputStream Properties + +
+ + + + + + + + "buffer-size" + Read - Write - Construct + The size of the backend buffer. Allowed values: >= 1. Default value: 4096. + + + + +
+ +
+ + + Description + + + gio.BufferedInputStream + implements gio.FilterInputStream + and provides for buffered reads. + + + By default, + gio.BufferedInputStream's + buffer size is set at 4 kilobytes. + + + To create a buffered input stream, use + gio.BufferedInputStream(), + or gio.buffered_input_stream_new_sized() + to specify the buffer's size at construction. + + + To get the size of a buffer within a buffered input stream, use + get_buffer_size(). + To change the size of a buffered input stream's buffer, use + set_buffer_size(). + Note that the buffer's size cannot be reduced below the size of the data within the buffer. + + + + + Methods + + + gio.BufferedInputStream.fill + + + fill + count + cancellableNone + + + + + count : + the number of bytes that will be read from the stream. + + + + cancellable : + optional + gio.Cancellable + object, None to ignore. + + + + Returns : + the number of bytes read into stream's buffer, + up to count, or -1 on error. + + + + + + The fill() method tries to read count bytes + from the stream into the buffer. Will block during this read. + + + If count is zero, returns zero and does nothing. A value of count + larger than G_MAXSSIZE will cause a gio.ERROR_INVALID_ARGUMENT error. + + + On success, the number of bytes read into the buffer is returned. It + is not an error if this is not the same as the requested size, as it can + happen e.g. near the end of a file. Zero is returned on end of file + (or if count is zero), but never otherwise. + + + If count is -1 then the attempted read size is equal to the number + of bytes that are required to fill the buffer. + + + If cancellable is not None, then the operation can + be cancelled by triggering the cancellable object from another thread. + If the operation was cancelled, the error gio.ERROR_CANCELLED will be + returned. If an operation was partially finished when the operation was + cancelled the partial result will be returned, without an error. + + + On error -1 is returned and error is set accordingly. + + + For the asynchronous, non-blocking, version of this function, see + gio.BufferedInputStream.fill_async(). + + + + + gio.BufferedInputStream.fill_async + + + fill_async + count + callback + io_priorityglib.PRIORITY_DEFAULT + cancellableNone + user_dataNone + + + + + count : + the number of bytes that will be read from the stream. + + + + callback : + a GAsyncReadyCallback to call when the request is satisfied. + + + + io_priority : + the + + of the request. + + + + cancellable : + optional + gio.Cancellable + object, None to ignore. + + + user_data : + the data to pass to callback function. + + + + + + The fill_async() method reads data into stream's + buffer asynchronously, up to count size. io_priority can be used to + prioritize reads. + + + For the synchronous version of this function, see + gio.BufferedInputStream.fill(). + + + If cancellable is not None, then the operation can be cancelled + by triggering the cancellable object from another thread. If the operation was + cancelled, the error gio.ERROR_CANCELLED will be set + + + If count is -1 then the attempted read size is equal to the number of bytes + that are required to fill the buffer. + + + + + gio.BufferedInputStream.fill_finish + + + fill_finish + result + + + + + result : + a gio.AsyncResult. + + + + Returns : + the size of the read stream, or -1 on an error. + + + + + + The fill_finish() method finishes an asynchronous + file append operation started with + gio.BufferedInputStream.fill_async(). + + + + + gio.BufferedInputStream.get_available + + + get_available + + + + + + Returns : + size of the available stream. + + + + + + The get_available() method gets the size of + the available data within the stream. + + + + + gio.BufferedInputStream.get_buffer_size + + + get_buffer_size + + + + + + Returns : + the current buffer size. + + + + + + The get_buffer_size() method gets the size + of the input buffer. + + + + + gio.BufferedInputStream.read_byte + + + read_byte + cancellableNone + + + + + cancellable : + optional + gio.Cancellable + object, None to ignore. + + + + Returns : + the byte read from the stream, or -1 on end of stream or error. + + + + + + The read_byte() method tries to read a single + byte from the stream or the buffer. Will block during this read. + + + On success, the byte read from the stream is returned. On end of stream -1 + is returned but it's not an exceptional error and error is not set. + + + If cancellable is not None, then the operation can + be cancelled by triggering the cancellable object from another thread. + If the operation was cancelled, the error gio.ERROR_CANCELLED will be + returned. If an operation was partially finished when the operation was + cancelled the partial result will be returned, without an error. + + + On error -1 is returned and error is set accordingly. + + + + + gio.BufferedInputStream.set_buffer_size + + + set_buffer_size + size + + + + + size : + the new buffer size. + + + + + + The set_buffer_size() method sets the size + of the internal buffer of stream to size, or to the size of the contents + of the buffer. The buffer can never be resized smaller than its current contents. + + + + + + Functions + + + gio.buffered_input_stream_new_sized + + + buffered_input_stream_new_sized + size + + + + + size : + the requested buffer size. + + + + Returns : + A new + gio.InputStream. + + + + + + The buffered_input_stream_new_sized() function creates + a new gio.BufferedInputStream + from the given base_stream, with a buffer set to size. + + + +
diff --git a/docs/reference/pygio-classes.xml b/docs/reference/pygio-classes.xml index f14c592..f9396cb 100644 --- a/docs/reference/pygio-classes.xml +++ b/docs/reference/pygio-classes.xml @@ -10,6 +10,7 @@ + -- cgit