00001
00002
00003 #ifndef _LIBGNOMEVFSMM_ADDRESS_H
00004 #define _LIBGNOMEVFSMM_ADDRESS_H
00005
00006 #include <glibmm.h>
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include <libgnomevfs/gnome-vfs-address.h>
00026
00027 #include <libgnomevfsmm/enums.h>
00028 #include <libgnomevfsmm/exception.h>
00029
00030
00031 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00032 extern "C" { typedef struct _GnomeVFSAddress GnomeVFSAddress; }
00033 #endif
00034
00035 namespace Gnome
00036 {
00037
00038 namespace Vfs
00039 {
00040
00041 class Address
00042 {
00043 public:
00044 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00045 typedef Address CppObjectType;
00046 typedef GnomeVFSAddress BaseObjectType;
00047
00048 static GType get_type() G_GNUC_CONST;
00049 #endif
00050
00051 Address();
00052
00053 explicit Address(GnomeVFSAddress* gobject, bool make_a_copy = true);
00054
00055 Address(const Address& other);
00056 Address& operator=(const Address& other);
00057
00058 ~Address();
00059
00060 void swap(Address& other);
00061
00063 GnomeVFSAddress* gobj() { return gobject_; }
00064
00066 const GnomeVFSAddress* gobj() const { return gobject_; }
00067
00069 GnomeVFSAddress* gobj_copy() const;
00070
00071 protected:
00072 GnomeVFSAddress* gobject_;
00073
00074 private:
00075
00076 public:
00077
00078
00079 public:
00080 explicit Address(const Glib::ustring& address);
00081 explicit Address(guint32 ipv4_address);
00082 explicit Address(struct sockaddr* sa, int len);
00083
00084
00085 int get_family_type() const;
00086
00087 Glib::ustring to_string() const;
00088
00089 guint32 get_ipv4() const;
00090
00091
00092 GnomeVFSAddress** gobj_addr() { return &gobject_; }
00093
00094
00095 };
00096
00097 }
00098 }
00099
00100
00101 namespace Gnome
00102 {
00103
00104 namespace Vfs
00105 {
00106
00111 inline void swap(Address& lhs, Address& rhs)
00112 { lhs.swap(rhs); }
00113
00114 }
00115
00116 }
00117
00118 namespace Glib
00119 {
00120
00126 Gnome::Vfs::Address wrap(GnomeVFSAddress* object, bool take_copy = false);
00127
00128 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00129 template <>
00130 class Value<Gnome::Vfs::Address> : public Glib::Value_Boxed<Gnome::Vfs::Address>
00131 {};
00132 #endif
00133
00134 }
00135
00136 #endif
00137