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
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
00149
00150
00151
00155 Glib::ustring get_host_name() const;
00156
00160 Glib::ustring get_scheme() const;
00161
00165 guint get_host_port() const;
00166
00170 Glib::ustring get_user_name() const;
00171
00175 Glib::ustring get_password() const;
00176
00177
00181 void set_host_name(const Glib::ustring& host_name);
00182
00187 void set_host_port(guint host_port);
00188
00192 void set_user_name(const Glib::ustring& user_name);
00193
00197 void set_password(const Glib::ustring& password);
00198
00199
00208 bool equal(const Glib::RefPtr<const Uri>& uri) const;
00209
00210
00211
00219 bool is_parent(const Glib::RefPtr<const Uri>& possible_child, bool recursive = true) const;
00220
00221
00225 Glib::ustring get_path() const;
00226
00230 Glib::ustring get_fragment_identifier() const;
00231
00236 Glib::ustring extract_dirname() const;
00237
00248 Glib::ustring extract_short_name() const;
00249
00260 Glib::ustring extract_short_path_name() const;
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00277 static Glib::ustring make_full_from_relative(const Glib::ustring& base_uri, const Glib::ustring& relative_uri);
00278
00279
00284 Glib::RefPtr<FileInfo> get_file_info(FileInfoOptions options = FILE_INFO_DEFAULT) const throw(exception);
00285
00289 void create_symbolic_link(const Glib::ustring& target_reference) throw(exception);
00290
00294 bool uri_exists() const;
00295
00301 FileSize get_volume_free_space() const throw(exception);
00302
00303
00304 };
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317 }
00318 }
00319
00320
00321 namespace Gnome
00322 {
00323
00324 namespace Vfs
00325 {
00326
00332 bool operator==(const Uri& lhs, const Uri& rhs);
00333
00339 bool operator!=(const Uri& lhs, const Uri& rhs);
00340
00341
00342 }
00343
00344 }
00345
00346
00347 namespace Glib
00348 {
00349
00355 Glib::RefPtr<Gnome::Vfs::Uri> wrap(GnomeVFSURI* object, bool take_copy = false);
00356
00357 }
00358
00359 #endif
00360