summaryrefslogtreecommitdiff
path: root/gio/src/dataoutputstream.hg
blob: c94fbc9af4808006e3cad20bfdc6c1e17c3557a2 (plain)
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
// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-

/* Copyright (C) 2007 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/bufferedoutputstream.h>
#include <giomm/enums.h>

_DEFS(giomm,gio)
_PINCLUDE(giomm/private/bufferedoutputstream_p.h)

namespace Gio
{

/**
 * An implementation of BufferedOutputStream that allows for high-level data
 * manipulation of arbitrary data (including binary operations).
 *
 * @ingroup Streams
 *
 * @newin2p16
 */
class DataOutputStream : public Gio::BufferedOutputStream
{
  _CLASS_GOBJECT(DataOutputStream, GDataOutputStream, G_DATA_OUTPUT_STREAM, Gio::BufferedOutputStream, GBufferedOutputStream)

protected:
  _WRAP_CTOR(DataOutputStream(const Glib::RefPtr<OutputStream>& base_stream), g_data_output_stream_new)

public:

  _WRAP_CREATE(const Glib::RefPtr<OutputStream>& base_stream)

  _WRAP_METHOD(void set_byte_order(DataStreamByteOrder order), g_data_output_stream_set_byte_order)
  _WRAP_METHOD(DataStreamByteOrder get_byte_order() const, g_data_output_stream_get_byte_order)

  _WRAP_METHOD(bool put_byte(guchar data, const Glib::RefPtr<Cancellable>& cancellable), g_data_output_stream_put_byte, errthrow)

  /** non-cancellable version of put_byte()
   */
#ifdef GLIBMM_EXCEPTIONS_ENABLED
  bool put_byte(guchar data);
#else
  bool put_byte(guchar data, std::auto_ptr<Glib::Error>& error);
#endif //GLIBMM_EXCEPTIONS_ENABLED

  _WRAP_METHOD(bool put_int16(gint16 data, const Glib::RefPtr<Cancellable>& cancellable), g_data_output_stream_put_int16, errthrow)
  /** non-cancellable version of put_int16()
   */
#ifdef GLIBMM_EXCEPTIONS_ENABLED
  bool put_int16(gint16 data);
#else
  bool put_int16(gint16 data, std::auto_ptr<Glib::Error>& error);
#endif //GLIBMM_EXCEPTIONS_ENABLED

  _WRAP_METHOD(bool put_uint16(guint16 data, const Glib::RefPtr<Cancellable>& cancellable), g_data_output_stream_put_uint16, errthrow)
  /** non-cancellable version of put_uint16()
   */
#ifdef GLIBMM_EXCEPTIONS_ENABLED
  bool put_uint16(guint16 data);
#else
  bool put_uint16(guint16 data, std::auto_ptr<Glib::Error>& error);
#endif //GLIBMM_EXCEPTIONS_ENABLED

  _WRAP_METHOD(bool put_int32(gint32 data, const Glib::RefPtr<Cancellable>& cancellable), g_data_output_stream_put_int32, errthrow)

  /** non-cancellable version of put_int32()
   */
#ifdef GLIBMM_EXCEPTIONS_ENABLED
  bool put_int32(gint32 data);
#else
  bool put_int32(gint32 data, std::auto_ptr<Glib::Error>& error);
#endif //GLIBMM_EXCEPTIONS_ENABLED

  _WRAP_METHOD(bool put_uint32(guint32 data, const Glib::RefPtr<Cancellable>& cancellable), g_data_output_stream_put_uint32, errthrow)
  /** non-cancellable version of put_uint32()
   */
#ifdef GLIBMM_EXCEPTIONS_ENABLED
  bool put_uint32(guint32 data);
#else
  bool put_uint32(guint32 data, std::auto_ptr<Glib::Error>& error);
#endif //GLIBMM_EXCEPTIONS_ENABLED

  _WRAP_METHOD(bool put_int64(gint64 data, const Glib::RefPtr<Cancellable>& cancellable), g_data_output_stream_put_int64, errthrow)
  /** non-cancellable version of put_int64()
   */
#ifdef GLIBMM_EXCEPTIONS_ENABLED
  bool put_int64(gint64 data);
#else
  bool put_int64(gint64 data, std::auto_ptr<Glib::Error>& error);
#endif //GLIBMM_EXCEPTIONS_ENABLED

  _WRAP_METHOD(bool put_uint64(guint64 data, const Glib::RefPtr<Cancellable>& cancellable), g_data_output_stream_put_uint64, errthrow)

  /** non-cancellable version of put_uint64()
   */
#ifdef GLIBMM_EXCEPTIONS_ENABLED
  bool put_uint64(guint64 data);
#else
  bool put_uint64(guint64 data, std::auto_ptr<Glib::Error>& error);
#endif //GLIBMM_EXCEPTIONS_ENABLED

  _WRAP_METHOD(bool put_string(std::string str, const Glib::RefPtr<Cancellable>& cancellable), g_data_output_stream_put_string, errthrow)

  /** non-cancellable version of put_string()
   */
#ifdef GLIBMM_EXCEPTIONS_ENABLED
  bool put_string(std::string str);
#else
  bool put_string(std::string str, std::auto_ptr<Glib::Error>& error);
#endif //GLIBMM_EXCEPTIONS_ENABLED

};

} // namespace Gio