00001
00002
00003 #ifndef _LIBGNOMEVFSMM_URI_H
00004 #define _LIBGNOMEVFSMM_URI_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
00026
00027
00028 #include <libgnomevfsmm/file-info.h>
00029 #include <libgnomevfsmm/enums.h>
00030 #include <libgnomevfsmm/exception.h>
00031 #include <libgnomevfs/gnome-vfs-uri.h>
00032 #include <libgnomevfs/gnome-vfs-ops.h>
00033
00034
00035 namespace Gnome
00036 {
00037
00038 namespace Vfs
00039 {
00040
00041 class Uri
00042 {
00043 public:
00044 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00045 typedef Uri CppObjectType;
00046 typedef GnomeVFSURI BaseObjectType;
00047 #endif
00048
00049
00050
00051 void reference() const;
00052 void unreference() const;
00053
00055 GnomeVFSURI* gobj();
00056
00058 const GnomeVFSURI* gobj() const;
00059
00060
00061 GnomeVFSURI* gobj_copy() const;
00062
00063 protected:
00064
00065 Uri();
00066 void operator delete(void*, size_t);
00067
00068 private:
00069
00070 Uri(const Uri&);
00071 Uri& operator=(const Uri&);
00072
00073
00074 public:
00075
00080 static Glib::RefPtr<Uri> create(const Glib::ustring& uri);
00081
00082
00087 Glib::RefPtr<Uri> resolve_relative(const Glib::ustring& relative_reference);
00088
00089
00096 Glib::RefPtr<Uri> append_string(const Glib::ustring& uri_fragment);
00097
00104 Glib::RefPtr<Uri> append_path(const Glib::ustring& path);
00105
00112 Glib::RefPtr<Uri> append_file_name(const Glib::ustring& filename);
00113
00120 Glib::ustring to_string(URIHideOptions hide_options = URI_HIDE_NONE) const;
00121
00125 Glib::RefPtr<Uri> dup();
00126
00130 bool is_local() const;
00131
00135 bool has_parent() const;
00136
00140 Glib::RefPtr<Uri> get_parent();
00141
00145 Glib::RefPtr<const Uri> get_parent() const;
00146
00147
00148
00152 GnomeVFSToplevelURI* get_toplevel();
00153
00154
00155
00159 Glib::ustring get_host_name() const;
00160
00164 Glib::ustring get_scheme() const;
00165
00169 guint get_host_port() const;
00170
00174 Glib::ustring get_user_name() const;
00175
00179 Glib::ustring get_password() const;
00180
00181
00185 void set_host_name(const Glib::ustring& host_name);
00186
00191 void set_host_port(guint host_port);
00192
00196 void set_user_name(const Glib::ustring& user_name);
00197
00201 void set_password(const Glib::ustring& password);
00202
00203
00211 bool is_parent(const Glib::RefPtr<const Uri>& possible_child, bool recursive = true) const;
00212
00213
00217 Glib::ustring get_path() const;
00218
00222 Glib::ustring get_fragment_identifier() const;
00223
00228 Glib::ustring extract_dirname() const;
00229
00240 Glib::ustring extract_short_name() const;
00241
00252 Glib::ustring extract_short_path_name() const;
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00273 static Glib::ustring make_full_from_relative(const Glib::ustring& base_uri, const Glib::ustring& relative_uri);
00274
00275
00280 Glib::RefPtr<FileInfo> get_file_info(FileInfoOptions options = FILE_INFO_DEFAULT) const throw(exception);
00281
00285 void create_symbolic_link(const Glib::ustring& target_reference) throw(exception);
00286
00290 bool uri_exists() const;
00291
00292
00293 };
00294
00295
00296 class TopLevelUri : Uri
00297 {
00298
00299 };
00300
00301
00302 }
00303 }
00304
00305
00306 namespace Gnome
00307 {
00308
00309 namespace Vfs
00310 {
00311
00313 bool operator==(const Uri& lhs, const Uri& rhs);
00314
00316 bool operator!=(const Uri& lhs, const Uri& rhs);
00317
00318
00319 }
00320
00321 }
00322
00323
00324 namespace Glib
00325 {
00326
00328 Glib::RefPtr<Gnome::Vfs::Uri> wrap(GnomeVFSURI* object, bool take_copy = false);
00329
00330 }
00331
00332 #endif
00333