/usr/include/giomm-2.4/giomm/bufferedinputstream.h is in libglibmm-2.4-dev 2.32.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 | // -*- c++ -*-
// Generated by gtkmmproc -- DO NOT MODIFY!
#ifndef _GIOMM_BUFFEREDINPUTSTREAM_H
#define _GIOMM_BUFFEREDINPUTSTREAM_H
#include <glibmm/ustring.h>
#include <sigc++/sigc++.h>
// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
/* Copyright (C) 2008 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <giomm/filterinputstream.h>
#include <glibmm/object.h>
#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef struct _GBufferedInputStream GBufferedInputStream;
typedef struct _GBufferedInputStreamClass GBufferedInputStreamClass;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
namespace Gio
{ class BufferedInputStream_Class; } // namespace Gio
namespace Gio
{
/** @defgroup Streams Stream Classes
*
*/
/** The buffered input stream implements FilterInputStream and provides for buffered reads.
* By default, BufferedInputStream's buffer size is set at 4 kilobytes, but you can specify
* this to the constructor.
*
* 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.
*
* @ingroup Streams
*
* @newin{2,16}
*/
class BufferedInputStream : public Gio::FilterInputStream
{
#ifndef DOXYGEN_SHOULD_SKIP_THIS
public:
typedef BufferedInputStream CppObjectType;
typedef BufferedInputStream_Class CppClassType;
typedef GBufferedInputStream BaseObjectType;
typedef GBufferedInputStreamClass BaseClassType;
private: friend class BufferedInputStream_Class;
static CppClassType bufferedinputstream_class_;
private:
// noncopyable
BufferedInputStream(const BufferedInputStream&);
BufferedInputStream& operator=(const BufferedInputStream&);
protected:
explicit BufferedInputStream(const Glib::ConstructParams& construct_params);
explicit BufferedInputStream(GBufferedInputStream* castitem);
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
public:
virtual ~BufferedInputStream();
#ifndef DOXYGEN_SHOULD_SKIP_THIS
static GType get_type() G_GNUC_CONST;
static GType get_base_type() G_GNUC_CONST;
#endif
///Provides access to the underlying C GObject.
GBufferedInputStream* gobj() { return reinterpret_cast<GBufferedInputStream*>(gobject_); }
///Provides access to the underlying C GObject.
const GBufferedInputStream* gobj() const { return reinterpret_cast<GBufferedInputStream*>(gobject_); }
///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
GBufferedInputStream* gobj_copy();
private:
protected:
explicit BufferedInputStream(const Glib::RefPtr<InputStream>& base_stream);
//Note that we rename the size parameter to buffer_size because that is the actual name of the property.
explicit BufferedInputStream(const Glib::RefPtr<InputStream>& base_stream, gsize buffer_size);
public:
/** Creates a new InputStream from the given base_stream, with a buffer set to the default size (4 kilobytes).
*
* @param base_stream An InputStream.
* @result an InputStream for the given base_stream.
*/
static Glib::RefPtr<BufferedInputStream> create(const Glib::RefPtr<InputStream>& base_stream);
/** Creates a new InputStream from the given base_stream, with a buffer set to size.
*
* @param base_stream An InputStream.
* @param size A size.
* @result an InputStream for the given base_stream.
*/
static Glib::RefPtr<BufferedInputStream> create_sized(const Glib::RefPtr<InputStream>& base_stream, gsize buffer_size);
/** Gets the size of the input buffer.
* @return The current buffer size.
*/
gsize get_buffer_size() const;
/** Sets the size of the internal buffer of @a stream to @a size, or to the
* size of the contents of the buffer. The buffer can never be resized
* smaller than its current contents.
* @param size A #gsize.
*/
void set_buffer_size(gsize size);
/** Gets the size of the available data within the stream.
* @return Size of the available stream.
*/
gsize get_available() const;
/** Peeks in the buffer, copying data of size @a count into @a buffer,
* offset @a offset bytes.
* @param buffer A pointer to
* an allocated chunk of memory.
* @param offset A #gsize.
* @param count A #gsize.
* @return A #gsize of the number of bytes peeked, or -1 on error.
*/
gsize peek(void* buffer, gsize offset, gsize count) const;
/** Returns the buffer with the currently available bytes. The returned
* buffer must not be modified and will become invalid when reading from
* the stream or filling the buffer.
* @param count A #gsize to get the number of bytes available in the buffer.
* @return Read-only buffer.
*/
const void* peek_buffer(gsize& count) const;
/** Tries to read @a count bytes from the stream into the buffer.
* Will block during this read.
*
* If @a count is zero, returns zero and does nothing. A value of @a count
* larger than MAXSSIZE will cause a Gio::Error to be thrown, with INVALID_ARGUMENT.
*
* 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 @a count is zero), but never otherwise.
*
* The operation can be cancelled by
* triggering the cancellable object from another thread. If the operation
* was cancelled, a Gio::Error will be thrown with CANCELLED. If an
* operation was partially finished when the operation was cancelled the
* partial result will be returned, without an error.
*
*
*
* For the asynchronous, non-blocking, version of this function, see
* g_buffered_input_stream_fill_async().
* @param count The number of bytes that will be read from the stream.
* @param cancellable Cancellable object.
* @return The number of bytes read into @a stream's buffer, up to @a count,
* or -1 on error.
*/
gssize fill(gssize count, const Glib::RefPtr<Cancellable>& cancellable);
/** non-cancellable version of fill()
*/
gssize fill(gssize count);
/** Reads data into the stream's buffer asynchronously, up to @a count size.
* @a io_priority can be used to prioritize reads. For the synchronous version of
* this function, see fill().
*
* @param slot A AsyncReadyCallback.
* @param count The number of bytes to read.
* @param cancellable Cancellable object.
* @param io_priority the I/O priority of the request.
*/
void fill_async(const SlotAsyncReady& slot,
gssize count,
const Glib::RefPtr<Cancellable>& cancellable,
int io_priority = Glib::PRIORITY_DEFAULT);
/** Reads data into the stream's buffer asynchronously, up to @a count size.
* @a io_priority can be used to prioritize reads. For the synchronous version of
* this function, see fill().
*
* @param slot A AsyncReadyCallback.
* @param count The number of bytes to read.
* @param io_priority the I/O priority of the request.
*/
void fill_async(const SlotAsyncReady& slot,
gssize count,
int io_priority = Glib::PRIORITY_DEFAULT);
/** Finishes an asynchronous read.
* @param result A AsyncResult.
* @return A #gssize of the read stream, or %-1 on an error.
*/
gssize fill_finish(const Glib::RefPtr<AsyncResult>& result);
/** 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 @a error is not set.
*
* The operation can be cancelled by
* triggering the cancellable object from another thread. If the operation
* was cancelled, a Gio::Error will be thrown with CANCELLED. If an
* operation was partially finished when the operation was cancelled the
* partial result will be returned, without an error.
* @param cancellable Cancellable object.
* @return The byte read from the @a stream, or -1 on end of stream or error.
*/
int read_byte(const Glib::RefPtr<Cancellable>& cancellable);
/** Non-cancellable version of read_byte().
*/
int read_byte();
#ifdef GLIBMM_PROPERTIES_ENABLED
/** The size of the backend buffer.
*
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
* the value of the property changes.
*/
Glib::PropertyProxy< guint > property_buffer_size() ;
#endif //#GLIBMM_PROPERTIES_ENABLED
#ifdef GLIBMM_PROPERTIES_ENABLED
/** The size of the backend buffer.
*
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
* the value of the property changes.
*/
Glib::PropertyProxy_ReadOnly< guint > property_buffer_size() const;
#endif //#GLIBMM_PROPERTIES_ENABLED
protected:
//_WRAP_VFUNC(gssize fill(gssize count, const Glib::RefPtr<Cancellable>& cancellable, GError** error), "fill")
public:
public:
//C++ methods used to invoke GTK+ virtual functions:
protected:
//GTK+ Virtual Functions (override these to change behaviour):
//Default Signal Handlers::
};
} // namespace Gio
namespace Glib
{
/** A Glib::wrap() method for this object.
*
* @param object The C instance.
* @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
* @result A C++ instance that wraps this C instance.
*
* @relates Gio::BufferedInputStream
*/
Glib::RefPtr<Gio::BufferedInputStream> wrap(GBufferedInputStream* object, bool take_copy = false);
}
#endif /* _GIOMM_BUFFEREDINPUTSTREAM_H */
|