2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GIOMM_MEMORYINPUTSTREAM_H
4 #define _GIOMM_MEMORYINPUTSTREAM_H
9 // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
11 /* Copyright (C) 2007 The gtkmm Development Team
13 * This library is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU Library General Public
15 * License as published by the Free Software Foundation; either
16 * version 2 of the License, or (at your option) any later version.
18 * This library is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * Library General Public License for more details.
23 * You should have received a copy of the GNU Library General Public
24 * License along with this library; if not, write to the Free
25 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 #include <giomm/inputstream.h>
29 #include <giomm/seekable.h>
32 #ifndef DOXYGEN_SHOULD_SKIP_THIS
33 typedef struct _GMemoryInputStream GMemoryInputStream;
34 typedef struct _GMemoryInputStreamClass GMemoryInputStreamClass;
35 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
39 { class MemoryInputStream_Class; } // namespace Gio
43 /** MemoryInputStream implements InputStream for arbitrary memory chunks.
50 class MemoryInputStream
51 : public Gio::InputStream,
55 #ifndef DOXYGEN_SHOULD_SKIP_THIS
58 typedef MemoryInputStream CppObjectType;
59 typedef MemoryInputStream_Class CppClassType;
60 typedef GMemoryInputStream BaseObjectType;
61 typedef GMemoryInputStreamClass BaseClassType;
63 private: friend class MemoryInputStream_Class;
64 static CppClassType memoryinputstream_class_;
68 MemoryInputStream(const MemoryInputStream&);
69 MemoryInputStream& operator=(const MemoryInputStream&);
72 explicit MemoryInputStream(const Glib::ConstructParams& construct_params);
73 explicit MemoryInputStream(GMemoryInputStream* castitem);
75 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
78 virtual ~MemoryInputStream();
80 #ifndef DOXYGEN_SHOULD_SKIP_THIS
81 static GType get_type() G_GNUC_CONST;
82 static GType get_base_type() G_GNUC_CONST;
85 ///Provides access to the underlying C GObject.
86 GMemoryInputStream* gobj() { return reinterpret_cast<GMemoryInputStream*>(gobject_); }
88 ///Provides access to the underlying C GObject.
89 const GMemoryInputStream* gobj() const { return reinterpret_cast<GMemoryInputStream*>(gobject_); }
91 ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
92 GMemoryInputStream* gobj_copy();
99 // TODO: *_new_from_data constructor needs to be fixed?
103 static Glib::RefPtr<MemoryInputStream> create();
106 /** Appends to data that can be read from the input stream.
108 * @param data Input data.
110 void add_data(const std::string& data);
112 /** Appends to data that can be read from the input stream.
114 * @param data Input data.
115 * @param len Length of the data, may be -1 if data is a null-terminated string.
117 void add_data(const void* data, gssize len);
123 //C++ methods used to invoke GTK+ virtual functions:
124 #ifdef GLIBMM_VFUNCS_ENABLED
125 #endif //GLIBMM_VFUNCS_ENABLED
128 //GTK+ Virtual Functions (override these to change behaviour):
129 #ifdef GLIBMM_VFUNCS_ENABLED
130 #endif //GLIBMM_VFUNCS_ENABLED
132 //Default Signal Handlers::
133 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
134 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
144 /** A Glib::wrap() method for this object.
146 * @param object The C instance.
147 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
148 * @result A C++ instance that wraps this C instance.
150 * @relates Gio::MemoryInputStream
152 Glib::RefPtr<Gio::MemoryInputStream> wrap(GMemoryInputStream* object, bool take_copy = false);
156 #endif /* _GIOMM_MEMORYINPUTSTREAM_H */