glibmm r568 - in trunk: . gio gio/giomm gio/src
- From: jjongsma svn gnome org
- To: svn-commits-list gnome org
- Subject: glibmm r568 - in trunk: . gio gio/giomm gio/src
- Date: Sun, 3 Feb 2008 04:15:30 +0000 (GMT)
Author: jjongsma
Date: Sun Feb 3 04:15:30 2008
New Revision: 568
URL: http://svn.gnome.org/viewvc/glibmm?rev=568&view=rev
Log:
* gio/src/Makefile_list_of_hg.am_fragment:
* gio/src/datainputstream.hg:
* gio/src/dataoutputstream.hg: add DataOutputStream class
* gio/src/dataoutputstream.ccg:
* gio/src/enums.ccg:
* gio/src/enums.hg: moved the DataStream enums to a common enums header
since they're needed by both the input and output data streams.
* gio/giomm.h: add new headers
Added:
trunk/gio/src/dataoutputstream.ccg
trunk/gio/src/dataoutputstream.hg
trunk/gio/src/enums.ccg
trunk/gio/src/enums.hg
Modified:
trunk/ChangeLog
trunk/gio/giomm/ (props changed)
trunk/gio/giomm.h
trunk/gio/src/Makefile_list_of_hg.am_fragment
trunk/gio/src/datainputstream.hg
Modified: trunk/gio/giomm.h
==============================================================================
--- trunk/gio/giomm.h (original)
+++ trunk/gio/giomm.h Sun Feb 3 04:15:30 2008
@@ -26,7 +26,9 @@
#include <giomm/bufferedoutputstream.h>
#include <giomm/cancellable.h>
#include <giomm/datainputstream.h>
+#include <giomm/dataoutputstream.h>
#include <giomm/drive.h>
+#include <giomm/enums.h>
#include <giomm/error.h>
#include <giomm/fileattributeinfolist.h>
#include <giomm/fileenumerator.h>
Modified: trunk/gio/src/Makefile_list_of_hg.am_fragment
==============================================================================
--- trunk/gio/src/Makefile_list_of_hg.am_fragment (original)
+++ trunk/gio/src/Makefile_list_of_hg.am_fragment Sun Feb 3 04:15:30 2008
@@ -10,7 +10,7 @@
filemonitor.hg filterinputstream.hg filteroutputstream.hg \
icon.hg inputstream.hg loadableicon.hg mount.hg mountoperation.hg outputstream.hg \
seekable.hg simpleasyncresult.hg volume.hg volumemonitor.hg bufferedinputstream.hg \
- bufferedoutputstream.hg datainputstream.hg
+ bufferedoutputstream.hg datainputstream.hg dataoutputstream.hg enums.hg
include $(top_srcdir)/build_shared/Makefile_build_gensrc.am_fragment
Modified: trunk/gio/src/datainputstream.hg
==============================================================================
--- trunk/gio/src/datainputstream.hg (original)
+++ trunk/gio/src/datainputstream.hg Sun Feb 3 04:15:30 2008
@@ -18,6 +18,7 @@
*/
#include <giomm/bufferedinputstream.h>
+#include <giomm/enums.h>
_DEFS(giomm,gio)
_PINCLUDE(giomm/private/bufferedinputstream_p.h)
@@ -25,9 +26,6 @@
namespace Gio
{
-_WRAP_ENUM(DataStreamByteOrder, GDataStreamByteOrder, NO_GTYPE)
-_WRAP_ENUM(DataStreamNewlineType, GDataStreamNewlineType, NO_GTYPE)
-
/**
* An implementation of BufferedInputStream that allows for high-level data
* manipulation of arbitrary data (including binary operations).
Added: trunk/gio/src/dataoutputstream.ccg
==============================================================================
--- (empty file)
+++ trunk/gio/src/dataoutputstream.ccg Sun Feb 3 04:15:30 2008
@@ -0,0 +1,181 @@
+// -*- 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 Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <gio/gio.h>
+
+namespace Gio
+{
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+bool DataOutputStream::put_byte(guchar data)
+#else
+bool DataOutputStream::put_byte(guchar data, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+{
+ GError* gerror = 0;
+ guchar retvalue = g_data_output_stream_put_byte(gobj(), data, NULL, &(gerror));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+ if(gerror)
+ ::Glib::Error::throw_exception(gerror);
+#else
+ if(gerror)
+ error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
+ return retvalue;
+}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+bool DataOutputStream::put_int16(gint16 data)
+#else
+bool DataOutputStream::put_int16(gint16 data, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+{
+ GError* gerror = 0;
+ gint16 retvalue = g_data_output_stream_put_int16(gobj(), data, NULL, &(gerror));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+ if(gerror)
+ ::Glib::Error::throw_exception(gerror);
+#else
+ if(gerror)
+ error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
+ return retvalue;
+}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+bool DataOutputStream::put_uint16(guint16 data)
+#else
+bool DataOutputStream::put_uint16(guint16 data, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+{
+ GError* gerror = 0;
+ guint16 retvalue = g_data_output_stream_put_uint16(gobj(), data, NULL, &(gerror));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+ if(gerror)
+ ::Glib::Error::throw_exception(gerror);
+#else
+ if(gerror)
+ error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
+ return retvalue;
+}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+bool DataOutputStream::put_int32(gint32 data)
+#else
+bool DataOutputStream::put_int32(gint32 data, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+{
+ GError* gerror = 0;
+ gint32 retvalue = g_data_output_stream_put_int32(gobj(), data, NULL, &(gerror));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+ if(gerror)
+ ::Glib::Error::throw_exception(gerror);
+#else
+ if(gerror)
+ error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
+ return retvalue;
+}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+bool DataOutputStream::put_uint32(guint32 data)
+#else
+bool DataOutputStream::put_uint32(guint32 data, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+{
+ GError* gerror = 0;
+ guint32 retvalue = g_data_output_stream_put_uint32(gobj(), data, NULL, &(gerror));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+ if(gerror)
+ ::Glib::Error::throw_exception(gerror);
+#else
+ if(gerror)
+ error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
+ return retvalue;
+}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+bool DataOutputStream::put_int64(gint64 data)
+#else
+bool DataOutputStream::put_int64(gint64 data, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+{
+ GError* gerror = 0;
+ gint64 retvalue = g_data_output_stream_put_int64(gobj(), data, NULL, &(gerror));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+ if(gerror)
+ ::Glib::Error::throw_exception(gerror);
+#else
+ if(gerror)
+ error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
+ return retvalue;
+}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+bool DataOutputStream::put_uint64(guint64 data)
+#else
+bool DataOutputStream::put_uint64(guint64 data, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+{
+ GError* gerror = 0;
+ guint64 retvalue = g_data_output_stream_put_uint64(gobj(), data, NULL, &(gerror));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+ if(gerror)
+ ::Glib::Error::throw_exception(gerror);
+#else
+ if(gerror)
+ error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
+ return retvalue;
+}
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+bool DataOutputStream::put_string(std::string str)
+#else
+bool DataOutputStream::put_string(std::string str, std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+{
+ GError* gerror = 0;
+ bool retval =
+ Glib::convert_return_gchar_ptr_to_stdstring(g_data_output_stream_put_string(gobj(),
+ str.c_str (),
+ NULL,
+ &gerror));
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+ if(gerror)
+ ::Glib::Error::throw_exception(gerror);
+#else
+ if(gerror)
+ error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+ return retval;
+}
+
+
+} // namespace Gio
Added: trunk/gio/src/dataoutputstream.hg
==============================================================================
--- (empty file)
+++ trunk/gio/src/dataoutputstream.hg Sun Feb 3 04:15:30 2008
@@ -0,0 +1,128 @@
+// -*- 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 Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library 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).
+ *
+ * @newin2p16
+ */
+class DataOutputStream : public Gio::BufferedOutputStream
+{
+ _CLASS_GOBJECT(DataOutputStream, GDataOutputStream, G_DATA_OUTPUT_STREAM, Gio::BufferedOutputStream, GBufferedOutputStream)
+
+ _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(void set_newline_type(DataStreamNewlineType type), g_data_output_stream_set_newline_type)
+ _WRAP_METHOD(DataStreamNewlineType get_newline_type() const, g_data_output_stream_get_newline_type)
+
+ _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
+
Added: trunk/gio/src/enums.ccg
==============================================================================
--- (empty file)
+++ trunk/gio/src/enums.ccg Sun Feb 3 04:15:30 2008
@@ -0,0 +1,19 @@
+// -*- 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 Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
Added: trunk/gio/src/enums.hg
==============================================================================
--- (empty file)
+++ trunk/gio/src/enums.hg Sun Feb 3 04:15:30 2008
@@ -0,0 +1,31 @@
+// -*- 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 Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <gio/gio.h>
+
+_DEFS(giomm,gio)
+
+namespace Gio
+{
+
+_WRAP_ENUM(DataStreamByteOrder, GDataStreamByteOrder, NO_GTYPE)
+_WRAP_ENUM(DataStreamNewlineType, GDataStreamNewlineType, NO_GTYPE)
+
+} // namespace Gio
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]