00001 // -*- c++ -*- 00002 // Generated by gtkmmproc -- DO NOT MODIFY! 00003 #ifndef _LIBGNOMEVFSMM_URI_H 00004 #define _LIBGNOMEVFSMM_URI_H 00005 00006 #include <glibmm.h> 00007 00008 /* $Id: uri.hg,v 1.15 2003/12/03 19:28:54 murrayc Exp $ */ 00009 // -*- C++ -*- // this is for the .hg, I realize gensig puts one in 00010 00011 /* Copyright 2003 gnome-vfsmm Development Team 00012 * 00013 * This library is free software; you can redistribute it and/or 00014 * modify it under the terms of the GNU Library General Public 00015 * License as published by the Free Software Foundation; either 00016 * version 2 of the License, or (at your option) any later version. 00017 * 00018 * This library is distributed in the hope that it will be useful, 00019 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00021 * Library General Public License for more details. 00022 * 00023 * You should have received a copy of the GNU Library General Public 00024 * License along with this library; if not, write to the Free 00025 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 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 /* DOXYGEN_SHOULD_SKIP_THIS */ 00048 00049 00050 // For use with Glib::RefPtr<> only. 00051 void reference() const; 00052 void unreference() const; 00053 00055 GnomeVFSURI* gobj(); 00056 00058 const GnomeVFSURI* gobj() const; 00059 00060 // The caller is responsible for freeing it. Use when directly setting fields in structs. 00061 GnomeVFSURI* gobj_copy() const; 00062 00063 protected: 00064 // Do not derive this. Gnome::Vfs::Uri can neither be constructed nor deleted. 00065 Uri(); 00066 void operator delete(void*, size_t); 00067 00068 private: 00069 // noncopyable 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 //TODO: Use a C++ instance type instead a the C type. 00148 00152 GnomeVFSToplevelURI* get_toplevel(); 00153 //TODO: _WRAP_METHOD(const GnomeVFSToplevelURI* get_toplevel() const, gnome_vfs_uri_get_toplevel) 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 //These are used for creating hashes for hash tables, apparently. 00255 //I don't see the point of wrapping them. 00256 00257 00258 /* 00259 GList* gnome_vfs_uri_list_parse(const Glib::ustring& uri_list), ) 00260 GList* gnome_vfs_uri_list_ref(GList *list), ) 00261 GList* gnome_vfs_uri_list_unref(GList *list), ) 00262 GList* gnome_vfs_uri_list_copy(GList *list), ) 00263 void gnome_vfs_uri_list_free(GList *list), ) 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 //TODO: member accessors? 00299 }; 00300 00301 00302 } // namespace Vfs 00303 } // namespace Gnome 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 } // namespace Vfs 00320 00321 } // namespace Gnome 00322 00323 00324 namespace Glib 00325 { 00326 00328 Glib::RefPtr<Gnome::Vfs::Uri> wrap(GnomeVFSURI* object, bool take_copy = false); 00329 00330 } // namespace Glib 00331 00332 #endif /* _LIBGNOMEVFSMM_URI_H */ 00333