[glibmm] split SocketAddressEnumerator into its own file
- From: Jonathon Jongsma <jjongsma src gnome org>
- To: svn-commits-list gnome org
- Subject: [glibmm] split SocketAddressEnumerator into its own file
- Date: Fri, 19 Jun 2009 01:10:28 -0400 (EDT)
commit 95f91e418920359af8eb1c5189d81eabc1bdae83
Author: Jonathon Jongsma <jonathon quotidian org>
Date: Thu Jun 18 23:04:34 2009 -0500
split SocketAddressEnumerator into its own file
.gitignore | 2 +
ChangeLog | 11 +++++
gio/src/Makefile_list_of_hg.am_fragment | 2 +-
gio/src/socketaddressenumerator.ccg | 62 +++++++++++++++++++++++++++++++
gio/src/socketaddressenumerator.hg | 55 +++++++++++++++++++++++++++
gio/src/socketconnectable.ccg | 39 -------------------
gio/src/socketconnectable.hg | 28 +-------------
7 files changed, 132 insertions(+), 67 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index fd7bb74..23c7851 100644
--- a/.gitignore
+++ b/.gitignore
@@ -134,6 +134,8 @@ gio/giomm/seekable.cc
gio/giomm/seekable.h
gio/giomm/socketaddress.h
gio/giomm/socketaddress.cc
+gio/giomm/socketaddressenumerator.h
+gio/giomm/socketaddressenumerator.cc
gio/giomm/socketconnectable.h
gio/giomm/socketconnectable.cc
gio/giomm/srvtarget.cc
diff --git a/ChangeLog b/ChangeLog
index fafd4fe..5c56f8b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
2009-06-18 Jonathon Jongsma <jonathon quotidian org>
+ split SocketAddressEnumerator into its own file
+
+ * .gitignore:
+ * gio/src/Makefile_list_of_hg.am_fragment:
+ * gio/src/socketaddressenumerator.ccg: Copied from gio/src/socketconnectable.ccg.
+ * gio/src/socketaddressenumerator.hg: Copied from gio/src/socketconnectable.hg.
+ * gio/src/socketconnectable.ccg:
+ * gio/src/socketconnectable.hg:
+
+2009-06-18 Jonathon Jongsma <jonathon quotidian org>
+
* glib/src/fileutils.ccg:
* glib/src/fileutils.hg: add Glib::file_set_contents() to match
Glib::file_get_contents(). Fixes Bug #586187
diff --git a/gio/src/Makefile_list_of_hg.am_fragment b/gio/src/Makefile_list_of_hg.am_fragment
index d139537..5575d35 100644
--- a/gio/src/Makefile_list_of_hg.am_fragment
+++ b/gio/src/Makefile_list_of_hg.am_fragment
@@ -9,7 +9,7 @@ files_general_hg = appinfo.hg asyncresult.hg cancellable.hg drive.hg emblem.hg e
fileattributeinfolist.hg fileenumerator.hg fileicon.hg fileinfo.hg fileinputstream.hg fileiostream.hg fileoutputstream.hg \
filemonitor.hg filterinputstream.hg filteroutputstream.hg filenamecompleter.hg \
icon.hg inetaddress.hg inputstream.hg iostream.hg loadableicon.hg memoryoutputstream.hg mount.hg mountoperation.hg outputstream.hg \
- resolver.hg seekable.hg socketaddress.hg socketconnectable.hg srvtarget.hg volume.hg volumemonitor.hg bufferedinputstream.hg \
+ resolver.hg seekable.hg socketaddress.hg socketaddressenumerator.hg socketconnectable.hg srvtarget.hg volume.hg volumemonitor.hg bufferedinputstream.hg \
bufferedoutputstream.hg datainputstream.hg dataoutputstream.hg enums.hg \
memoryinputstream.hg themedicon.hg
diff --git a/gio/src/socketaddressenumerator.ccg b/gio/src/socketaddressenumerator.ccg
new file mode 100644
index 0000000..235f288
--- /dev/null
+++ b/gio/src/socketaddressenumerator.ccg
@@ -0,0 +1,62 @@
+// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+
+/* Copyright (C) 2009 The giomm 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 <gio/gio.h>
+#include <giomm/socketaddress.h>
+#include "slot_async.h"
+
+namespace Gio {
+
+ void
+ SocketAddressEnumerator::next_async(const Glib::RefPtr<Cancellable>& cancellable,
+ const SlotAsyncReady& slot)
+ {
+ // Create a copy of the slot.
+ // A pointer to it will be passed through the callback's data parameter
+ // and deleted in the callback.
+ SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+
+ g_socket_address_enumerator_next_async(gobj(),
+ cancellable->gobj(),
+ &SignalProxy_async_callback,
+ slot_copy);
+ }
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+ Glib::RefPtr<SocketAddress>
+ SocketAddressEnumerator::next()
+#else
+ Glib::RefPtr<SocketAddress>
+ SocketAddressEnumerator::next(std::auto_ptr<Glib::Error>& error)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+ {
+ GError* gerror = 0;
+ Glib::RefPtr<SocketAddress> retvalue = Glib::wrap(g_socket_address_enumerator_next(gobj(), 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;
+
+ }
+} // namespace Gio
diff --git a/gio/src/socketaddressenumerator.hg b/gio/src/socketaddressenumerator.hg
new file mode 100644
index 0000000..1429c3b
--- /dev/null
+++ b/gio/src/socketaddressenumerator.hg
@@ -0,0 +1,55 @@
+// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+
+/* Copyright (C) 2007 The giomm 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 <glibmm/interface.h>
+#include <giomm/cancellable.h>
+#include <giomm/asyncresult.h>
+
+_DEFS(giomm,gio)
+_PINCLUDE(glibmm/private/object_p.h)
+
+namespace Gio
+{
+
+class SocketAddress;
+
+/** Enumerator type for objects that contain or generate SocketAddresses
+ *
+ * @newin2p22
+ */
+class SocketAddressEnumerator : public Glib::Object
+{
+ _CLASS_GOBJECT(SocketAddressEnumerator, GSocketAddressEnumerator, G_SOCKET_ADDRESS_ENUMERATOR, Glib::Object, GObject)
+
+public:
+ _WRAP_METHOD(Glib::RefPtr<SocketAddress> next(const Glib::RefPtr<Cancellable>& cancellable), g_socket_address_enumerator_next, errthrow)
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+ Glib::RefPtr<SocketAddress> next();
+#else
+ Glib::RefPtr<SocketAddress> next(std::auto_ptr<Glib::Error>& error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
+ void next_async(const Glib::RefPtr<Cancellable>& cancellable, const SlotAsyncReady& slot);
+ void next_async(const SlotAsyncReady& slot);
+
+ _WRAP_METHOD(Glib::RefPtr<SocketAddress> next_finish(const Glib::RefPtr<AsyncResult>& result), g_socket_address_enumerator_next_finish, errthrow)
+};
+
+} // namespace Gio
+
diff --git a/gio/src/socketconnectable.ccg b/gio/src/socketconnectable.ccg
index 235f288..27f8f0c 100644
--- a/gio/src/socketconnectable.ccg
+++ b/gio/src/socketconnectable.ccg
@@ -18,45 +18,6 @@
*/
#include <gio/gio.h>
-#include <giomm/socketaddress.h>
-#include "slot_async.h"
namespace Gio {
-
- void
- SocketAddressEnumerator::next_async(const Glib::RefPtr<Cancellable>& cancellable,
- const SlotAsyncReady& slot)
- {
- // Create a copy of the slot.
- // A pointer to it will be passed through the callback's data parameter
- // and deleted in the callback.
- SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
-
- g_socket_address_enumerator_next_async(gobj(),
- cancellable->gobj(),
- &SignalProxy_async_callback,
- slot_copy);
- }
-
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
- Glib::RefPtr<SocketAddress>
- SocketAddressEnumerator::next()
-#else
- Glib::RefPtr<SocketAddress>
- SocketAddressEnumerator::next(std::auto_ptr<Glib::Error>& error)
-#endif //GLIBMM_EXCEPTIONS_ENABLED
- {
- GError* gerror = 0;
- Glib::RefPtr<SocketAddress> retvalue = Glib::wrap(g_socket_address_enumerator_next(gobj(), 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;
-
- }
} // namespace Gio
diff --git a/gio/src/socketconnectable.hg b/gio/src/socketconnectable.hg
index 43d6f8c..3a04ebf 100644
--- a/gio/src/socketconnectable.hg
+++ b/gio/src/socketconnectable.hg
@@ -18,12 +18,10 @@
*/
#include <glibmm/interface.h>
-#include <giomm/cancellable.h>
-#include <giomm/asyncresult.h>
+#include <giomm/socketaddressenumerator.h>
_DEFS(giomm,gio)
_PINCLUDE(glibmm/private/interface_p.h)
-_PINCLUDE(glibmm/private/object_p.h)
#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef struct _GSocketConnectableIface GSocketConnectableIface;
@@ -32,30 +30,6 @@ typedef struct _GSocketConnectableIface GSocketConnectableIface;
namespace Gio
{
-class SocketAddress;
-
-/** Enumerator type for objects that contain or generate SocketAddresses
- *
- * @newin2p22
- */
-class SocketAddressEnumerator : public Glib::Object
-{
- _CLASS_GOBJECT(SocketAddressEnumerator, GSocketAddressEnumerator, G_SOCKET_ADDRESS_ENUMERATOR, Glib::Object, GObject)
-
-public:
- _WRAP_METHOD(Glib::RefPtr<SocketAddress> next(const Glib::RefPtr<Cancellable>& cancellable), g_socket_address_enumerator_next, errthrow)
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
- Glib::RefPtr<SocketAddress> next();
-#else
- Glib::RefPtr<SocketAddress> next(std::auto_ptr<Glib::Error>& error);
-#endif //GLIBMM_EXCEPTIONS_ENABLED
-
- void next_async(const Glib::RefPtr<Cancellable>& cancellable, const SlotAsyncReady& slot);
- void next_async(const SlotAsyncReady& slot);
-
- _WRAP_METHOD(Glib::RefPtr<SocketAddress> next_finish(const Glib::RefPtr<AsyncResult>& result), g_socket_address_enumerator_next_finish, errthrow)
-};
-
/** Interface for potential socket endpoints
*
* @newin2p22
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]