2 /* $Id: streamiochannel.h 17 2003-01-22 12:09:02Z murrayc $ */
4 /* Copyright (C) 2002 The gtkmm Development Team
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
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 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library 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.
21 #ifndef _GLIBMM_STREAMIOCHANNEL_H
22 #define _GLIBMM_STREAMIOCHANNEL_H
24 #include <glibmm/iochannel.h>
25 #include <glibmmconfig.h>
28 GLIBMM_USING_STD(istream)
29 GLIBMM_USING_STD(ostream)
30 GLIBMM_USING_STD(iostream)
36 /** This whole class is deprecated in glibmm 2.2.
37 * See the Glib::IOChannel documentation for an explanation.
39 class StreamIOChannel : public Glib::IOChannel
42 virtual ~StreamIOChannel();
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);
49 std::istream* stream_in_;
50 std::ostream* stream_out_;
52 StreamIOChannel(std::istream* stream_in, std::ostream* stream_out);
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);
66 #endif /* _GLIBMM_STREAMIOCHANNEL_H */