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