[libsoupmm] Add Soup::Address
- From: Siavash Safi <siavashs src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [libsoupmm] Add Soup::Address
- Date: Wed, 26 Aug 2009 15:34:08 +0000 (UTC)
commit 556172cd6a8132c231fc63420b023512994228a2
Author: Siavash Safi <siavash siavashs org>
Date: Wed Aug 26 19:59:10 2009 +0430
Add Soup::Address
* libsoup/.gitignore:
* libsoup/libsoupmm.h:
* libsoup/src/address.ccg:
* libsoup/src/address.hg:
* libsoup/src/filelist.am: Add Soup::Address
libsoup/.gitignore | 2 +
libsoup/libsoupmm.h | 1 +
libsoup/src/address.ccg | 22 ++++++++++++++++++
libsoup/src/address.hg | 56 +++++++++++++++++++++++++++++++++++++++++++++++
libsoup/src/filelist.am | 2 +-
5 files changed, 82 insertions(+), 1 deletions(-)
---
diff --git a/libsoup/.gitignore b/libsoup/.gitignore
index 91c5313..24a47f5 100644
--- a/libsoup/.gitignore
+++ b/libsoup/.gitignore
@@ -1,4 +1,6 @@
/libsoupmm-*.pc
+/libsoupmm/address.cc
+/libsoupmm/address.h
/libsoupmm/auth.cc
/libsoupmm/auth.h
/libsoupmm/message.h
diff --git a/libsoup/libsoupmm.h b/libsoup/libsoupmm.h
index fc8802c..93fc917 100644
--- a/libsoup/libsoupmm.h
+++ b/libsoup/libsoupmm.h
@@ -27,6 +27,7 @@ extern const int libsoupmm_micro_version;
#include <glibmm.h>
+#include <libsoupmm/address.h>
#include <libsoupmm/auth.h>
#include <libsoupmm/message.h>
#include <libsoupmm/message-body.h>
diff --git a/libsoup/src/address.ccg b/libsoup/src/address.ccg
new file mode 100644
index 0000000..602b24d
--- /dev/null
+++ b/libsoup/src/address.ccg
@@ -0,0 +1,22 @@
+/* Copyright (c) 2009 Siavash Safi <siavashs siavashs org>
+ *
+ * This file is part of libsoupmm.
+ *
+ * libsoupmm 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.
+ *
+ * libsoupmm 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 program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+namespace Soup
+{
+
+} // namespace Soup
diff --git a/libsoup/src/address.hg b/libsoup/src/address.hg
new file mode 100644
index 0000000..130067a
--- /dev/null
+++ b/libsoup/src/address.hg
@@ -0,0 +1,56 @@
+/* Copyright (c) 2009 Siavash Safi <siavashs siavashs org>
+ *
+ * This file is part of libsoupmm.
+ *
+ * libsoupmm 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.
+ *
+ * libsoupmm 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 program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <glibmm/object.h>
+#include <giomm/cancellable.h>
+#include <libsoup/soup-address.h>
+
+_DEFS(libsoupmm,libsoup)
+_PINCLUDE(glibmm/private/object_p.h)
+
+namespace Soup
+{
+
+_WRAP_ENUM(AddressFamily, SoupAddressFamily, NO_GTYPE)
+
+class Address : public Glib::Object
+{
+ _CLASS_GOBJECT(Address, SoupAddress, SOUP_ADDRESS, Glib::Object, GObject)
+ _STRUCT_NOT_HIDDEN
+
+protected:
+ _WRAP_CTOR(Address(const std::string& name, guint port), soup_address_new)
+
+public:
+ _WRAP_CREATE(const std::string& name, guint port)
+
+ _WRAP_METHOD(std::string get_name() const, soup_address_get_name)
+ _WRAP_METHOD(std::string get_physical() const, soup_address_get_physical)
+ _WRAP_METHOD(guint get_port() const, soup_address_get_port)
+ _WRAP_METHOD(bool is_resolved() const, soup_address_is_resolved)
+
+#m4 _CONVERSION(`const Glib::RefPtr<Gio::Cancellable>&', `GCancellable*', __CONVERT_REFPTR_TO_P)
+ _WRAP_METHOD(guint resolve_sync(const Glib::RefPtr<Gio::Cancellable>& cancellable), soup_address_resolve_sync)
+
+ _WRAP_PROPERTY("family", AddressFamily)
+ _WRAP_PROPERTY("name", std::string)
+ _WRAP_PROPERTY("physical", std::string)
+ _WRAP_PROPERTY("port", int)
+};
+
+} // namespace Soup
diff --git a/libsoup/src/filelist.am b/libsoup/src/filelist.am
index 5707122..bb94a0f 100644
--- a/libsoup/src/filelist.am
+++ b/libsoup/src/filelist.am
@@ -8,5 +8,5 @@ files_defs = \
libsoup_docs.xml \
libsoup_docs_override.xml
-files_hg = auth.hg message.hg message-body.hg session.hg uri.hg
+files_hg = address.hg auth.hg message.hg message-body.hg session.hg uri.hg
files_ccg = $(files_hg:.hg=.ccg)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]