upgrade to glibmm 2.16
[ardour.git] / libs / glibmm2 / glib / glibmm / streamiochannel.h
1 // -*- c++ -*-
2 /* $Id: streamiochannel.h 779 2009-01-19 17:58:50Z murrayc $ */
3
4 /* Copyright (C) 2002 The gtkmm Development Team
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free
18  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  */
20
21 #ifndef _GLIBMM_STREAMIOCHANNEL_H
22 #define _GLIBMM_STREAMIOCHANNEL_H
23
24 #include <glibmm/iochannel.h>
25 #include <glibmmconfig.h>
26 #include <iosfwd>
27
28 GLIBMM_USING_STD(istream)
29 GLIBMM_USING_STD(ostream)
30 GLIBMM_USING_STD(iostream)
31
32
33 namespace Glib
34 {
35
36 /** This whole class is deprecated in glibmm&nbsp;2.2.
37  * See the Glib::IOChannel documentation for an explanation.
38  */
39 class StreamIOChannel : public Glib::IOChannel
40 {
41 public:
42   virtual ~StreamIOChannel();
43
44   static Glib::RefPtr<StreamIOChannel> create(std::istream& stream);
45   static Glib::RefPtr<StreamIOChannel> create(std::ostream& stream);
46   static Glib::RefPtr<StreamIOChannel> create(std::iostream& stream);
47
48 protected:
49   std::istream* stream_in_;
50   std::ostream* stream_out_;
51
52   StreamIOChannel(std::istream* stream_in, std::ostream* stream_out);
53
54   virtual IOStatus read_vfunc(char* buf, gsize count, gsize& bytes_read);
55   virtual IOStatus write_vfunc(const char* buf, gsize count, gsize& bytes_written);
56   virtual IOStatus seek_vfunc(gint64 offset, SeekType type);
57   virtual IOStatus close_vfunc();
58   virtual IOStatus set_flags_vfunc(IOFlags flags);
59   virtual IOFlags  get_flags_vfunc();
60   virtual Glib::RefPtr<Glib::Source> create_watch_vfunc(IOCondition cond);
61 };
62
63 } // namespace Glib
64
65
66 #endif /* _GLIBMM_STREAMIOCHANNEL_H */
67