diff options
author | Jonathon Jongsma <jonathon@quotidian.org> | 2009-05-18 23:10:01 -0500 |
---|---|---|
committer | Jonathon Jongsma <jonathon@quotidian.org> | 2009-06-17 23:58:52 -0500 |
commit | 7896cdddf7d987a9e06bc05e03864698b306cc43 (patch) | |
tree | 5b6f74efcce859b012d8a127761989815f994810 /gio/src | |
parent | 4c1807c4cfb588597bcd0bb7de3744eb37a09c77 (diff) | |
download | glibmm-7896cdddf7d987a9e06bc05e03864698b306cc43.tar.gz |
wrap Gio::InetAddress
Diffstat (limited to 'gio/src')
-rw-r--r-- | gio/src/Makefile_list_of_hg.am_fragment | 2 | ||||
-rw-r--r-- | gio/src/gio_enums.defs | 45 | ||||
-rw-r--r-- | gio/src/inetaddress.ccg | 25 | ||||
-rw-r--r-- | gio/src/inetaddress.hg | 76 |
4 files changed, 146 insertions, 2 deletions
diff --git a/gio/src/Makefile_list_of_hg.am_fragment b/gio/src/Makefile_list_of_hg.am_fragment index 23a6f938..1c55d046 100644 --- a/gio/src/Makefile_list_of_hg.am_fragment +++ b/gio/src/Makefile_list_of_hg.am_fragment @@ -8,7 +8,7 @@ files_win32_hg = files_general_hg = appinfo.hg asyncresult.hg cancellable.hg drive.hg emblem.hg emblemedicon.hg error.hg file.hg fileattributeinfo.hg \ fileattributeinfolist.hg fileenumerator.hg fileicon.hg fileinfo.hg fileinputstream.hg fileiostream.hg fileoutputstream.hg \ filemonitor.hg filterinputstream.hg filteroutputstream.hg filenamecompleter.hg \ - icon.hg inputstream.hg iostream.hg loadableicon.hg memoryoutputstream.hg mount.hg mountoperation.hg outputstream.hg \ + icon.hg inetaddress.hg inputstream.hg iostream.hg loadableicon.hg memoryoutputstream.hg mount.hg mountoperation.hg outputstream.hg \ seekable.hg volume.hg volumemonitor.hg bufferedinputstream.hg \ bufferedoutputstream.hg datainputstream.hg dataoutputstream.hg enums.hg \ memoryinputstream.hg themedicon.hg diff --git a/gio/src/gio_enums.defs b/gio/src/gio_enums.defs index 967a58be..530231d4 100644 --- a/gio/src/gio_enums.defs +++ b/gio/src/gio_enums.defs @@ -1,4 +1,4 @@ -;; From /home/murrayc/checkouts/gnome224/glib/gio/gioenums.h +;; From /home/jonathon/.jhbuild-prefix/include/glib-2.0/gio/gioenums.h (define-flags-extended AppInfoCreateFlags (in-module "G") @@ -201,6 +201,8 @@ '("would-merge" "G_IO_ERROR_WOULD_MERGE" "29") '("failed-handled" "G_IO_ERROR_FAILED_HANDLED" "30") '("too-many-open-files" "G_IO_ERROR_TOO_MANY_OPEN_FILES" "31") + '("not-initialized" "G_IO_ERROR_NOT_INITIALIZED" "32") + '("address-in-use" "G_IO_ERROR_ADDRESS_IN_USE" "33") ) ) @@ -257,3 +259,44 @@ ) ) +(define-enum-extended ResolverError + (in-module "G") + (c-name "GResolverError") + (values + '("not-found" "G_RESOLVER_ERROR_NOT_FOUND" "0") + '("temporary-failure" "G_RESOLVER_ERROR_TEMPORARY_FAILURE" "1") + '("internal" "G_RESOLVER_ERROR_INTERNAL" "2") + ) +) + +(define-enum-extended SocketFamily + (in-module "G") + (c-name "GSocketFamily") + (values + '("invalid" "G_SOCKET_FAMILY_INVALID" "0") + '("ipv6" "G_SOCKET_FAMILY_IPV6" "3") + ) +) + +(define-enum-extended SocketType + (in-module "G") + (c-name "GSocketType") + (values + '("invalid" "G_SOCKET_TYPE_INVALID" "0") + '("stream" "G_SOCKET_TYPE_STREAM" "1") + '("datagram" "G_SOCKET_TYPE_DATAGRAM" "2") + '("seqpacket" "G_SOCKET_TYPE_SEQPACKET" "3") + ) +) + +(define-enum-extended SocketMsgFlags + (in-module "G") + (c-name "GSocketMsgFlags") + (values + '("none" "G_SOCKET_MSG_NONE" "0") + '("oob" "G_SOCKET_MSG_OOB" "#error") + '("peek" "G_SOCKET_MSG_PEEK" "#error") + '("dontroute" "G_SOCKET_MSG_DONTROUTE" "#error") + ) +) + diff --git a/gio/src/inetaddress.ccg b/gio/src/inetaddress.ccg new file mode 100644 index 00000000..c146baae --- /dev/null +++ b/gio/src/inetaddress.ccg @@ -0,0 +1,25 @@ +// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- + +/* Copyright (C) 2008 Jonathon Jongsma + * + * 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> + +namespace Gio +{ + +} //namespace Gio diff --git a/gio/src/inetaddress.hg b/gio/src/inetaddress.hg new file mode 100644 index 00000000..6ccef071 --- /dev/null +++ b/gio/src/inetaddress.hg @@ -0,0 +1,76 @@ +// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- + +/* Copyright (C) 2009 jonathon jongsma + * + * 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/object.h> + +_DEFS(giomm,gio) +_PINCLUDE(glibmm/private/object_p.h) + +namespace Gio +{ + +_WRAP_ENUM(SocketFamily, GSocketFamily) + +/** An IPv4/IPv6 address + * + * InetAddress represents an IPv4 or IPv6 internet address. Use + * Resolver::lookup_by_name() or Resolver::lookup_by_name_async() to look up + * the InetAddress for a hostname. Use Resolver::lookup_by_address() or + * Resolver::lookup_by_address_async() to look up the hostname for a + * InetAddress. + * + * To actually connect to a remote host, you will need a InetSocketAddress + * (which includes a InetAddress as well as a port number). + * + * @newin2p22 + */ +class InetAddress +: public Glib::Object +{ + _CLASS_GOBJECT(InetAddress, GInetAddress, G_INET_ADDRESS, Glib::Object, GObject) + +protected: + _WRAP_CTOR(InetAddress(const Glib::ustring& string), g_inet_address_new_from_string) + _WRAP_CTOR(InetAddress(const guint8 *bytes, SocketFamily family), g_inet_address_new_from_bytes) + _WRAP_CTOR(InetAddress(SocketFamily family), g_inet_address_new_any) + // TODO: new_loopback has the same signature as new_any + +public: + _WRAP_CREATE(const Glib::ustring& string) + _WRAP_CREATE(const guint8 *bytes, SocketFamily family) + _WRAP_CREATE(SocketFamily family) + // TODO: create for new_loopback + + _WRAP_METHOD(const guint8* to_bytes() const, g_inet_address_to_bytes) + _WRAP_METHOD(Glib::ustring to_string() const, g_inet_address_to_string) + _WRAP_METHOD(SocketFamily get_family() const, g_inet_address_get_family) + _WRAP_METHOD(bool get_is_any() const, g_inet_address_get_is_any) + _WRAP_METHOD(bool get_is_link_local() const, g_inet_address_get_is_link_local) + _WRAP_METHOD(bool get_is_loopback() const, g_inet_address_get_is_loopback) + _WRAP_METHOD(bool get_is_mc_global() const, g_inet_address_get_is_mc_global) + _WRAP_METHOD(bool get_is_mc_link_local() const, g_inet_address_get_is_mc_link_local) + _WRAP_METHOD(bool get_is_mc_node_local() const, g_inet_address_get_is_mc_node_local) + _WRAP_METHOD(bool get_is_mc_org_local() const, g_inet_address_get_is_mc_org_local) + _WRAP_METHOD(bool get_is_mc_site_local() const, g_inet_address_get_is_mc_site_local) + _WRAP_METHOD(bool get_is_multicast() const, g_inet_address_get_is_multicast) + _WRAP_METHOD(bool get_is_site_local() const, g_inet_address_get_is_site_local) + +}; + +} // namespace Gio |