Fix crash on startup if an LV2 plugin has a bad .ttl file.
[ardour.git] / libs / glibmm2 / gio / giomm / memoryinputstream.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GIOMM_MEMORYINPUTSTREAM_H
4 #define _GIOMM_MEMORYINPUTSTREAM_H
5
6
7 #include <glibmm.h>
8
9 // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
10
11 /* Copyright (C) 2007 The gtkmm Development Team
12  *
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.
17  *
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.
22  *
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.
26  */
27
28 #include <giomm/inputstream.h>
29 #include <giomm/seekable.h>
30
31
32 #ifndef DOXYGEN_SHOULD_SKIP_THIS
33 typedef struct _GMemoryInputStream GMemoryInputStream;
34 typedef struct _GMemoryInputStreamClass GMemoryInputStreamClass;
35 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
36
37
38 namespace Gio
39 { class MemoryInputStream_Class; } // namespace Gio
40 namespace Gio
41 {
42
43 /** MemoryInputStream implements InputStream for arbitrary memory chunks.
44  *
45  * @ingroup Streams
46  *
47  * @newin2p16
48  */
49
50 class MemoryInputStream 
51 : public Gio::InputStream, 
52   public Seekable
53 {
54   
55 #ifndef DOXYGEN_SHOULD_SKIP_THIS
56
57 public:
58   typedef MemoryInputStream CppObjectType;
59   typedef MemoryInputStream_Class CppClassType;
60   typedef GMemoryInputStream BaseObjectType;
61   typedef GMemoryInputStreamClass BaseClassType;
62
63 private:  friend class MemoryInputStream_Class;
64   static CppClassType memoryinputstream_class_;
65
66 private:
67   // noncopyable
68   MemoryInputStream(const MemoryInputStream&);
69   MemoryInputStream& operator=(const MemoryInputStream&);
70
71 protected:
72   explicit MemoryInputStream(const Glib::ConstructParams& construct_params);
73   explicit MemoryInputStream(GMemoryInputStream* castitem);
74
75 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
76
77 public:
78   virtual ~MemoryInputStream();
79
80 #ifndef DOXYGEN_SHOULD_SKIP_THIS
81   static GType get_type()      G_GNUC_CONST;
82   static GType get_base_type() G_GNUC_CONST;
83 #endif
84
85   ///Provides access to the underlying C GObject.
86   GMemoryInputStream*       gobj()       { return reinterpret_cast<GMemoryInputStream*>(gobject_); }
87
88   ///Provides access to the underlying C GObject.
89   const GMemoryInputStream* gobj() const { return reinterpret_cast<GMemoryInputStream*>(gobject_); }
90
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();
93
94 private:
95
96   
97 protected:
98   MemoryInputStream();
99   // TODO: *_new_from_data constructor needs to be fixed?
100
101 public:
102   
103   static Glib::RefPtr<MemoryInputStream> create();
104
105
106   /** Appends to data that can be read from the input stream.
107    *
108    * @param data Input data.
109    */
110   void add_data(const std::string& data);
111
112   /** Appends to data that can be read from the input stream.
113    *
114    * @param data Input data.
115    * @param len Length of the data, may be -1 if data is a null-terminated string.
116    */
117   void add_data(const void* data, gssize len);
118
119
120 public:
121
122 public:
123   //C++ methods used to invoke GTK+ virtual functions:
124 #ifdef GLIBMM_VFUNCS_ENABLED
125 #endif //GLIBMM_VFUNCS_ENABLED
126
127 protected:
128   //GTK+ Virtual Functions (override these to change behaviour):
129 #ifdef GLIBMM_VFUNCS_ENABLED
130 #endif //GLIBMM_VFUNCS_ENABLED
131
132   //Default Signal Handlers::
133 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
134 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
135
136
137 };
138
139 } // namespace Gio
140
141
142 namespace Glib
143 {
144   /** A Glib::wrap() method for this object.
145    * 
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.
149    *
150    * @relates Gio::MemoryInputStream
151    */
152   Glib::RefPtr<Gio::MemoryInputStream> wrap(GMemoryInputStream* object, bool take_copy = false);
153 }
154
155
156 #endif /* _GIOMM_MEMORYINPUTSTREAM_H */
157