Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

uri.h

Go to the documentation of this file.
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.18 2004/04/06 18:56:25 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 
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: GnomeVFSToplevelURI inherits from GnomeVFSUri, but they are not GObjects. That needs a little work.  
00148   //_WRAP_METHOD(GnomeVFSToplevelURI* get_toplevel(), gnome_vfs_uri_get_toplevel)
00149   //_WRAP_METHOD(const GnomeVFSToplevelURI* get_toplevel() const, gnome_vfs_uri_get_toplevel)
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   //We wrap this as equal() as well, because operator== requires an operator*.
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   //These are used for creating hashes for hash tables, apparently.
00263   //I don't see the point of wrapping them.
00264   
00265 
00266 /*
00267 GList* gnome_vfs_uri_list_parse(const Glib::ustring& uri_list), )
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 //TODO: GnomeVFSToplevelURI inherits from GnomeVFSUri, but they are not GObjects. That needs a little work.
00308 /*
00309 class TopLevelUri : Uri
00310 {
00311   //TODO: Constructors/memory-management so we can wrap a GnomeVFSToplevelURI* in this.
00312   //TODO: member accessors?
00313 };
00314 */
00315   
00316 
00317 } // namespace Vfs
00318 } // namespace Gnome
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 } // namespace Vfs
00343 
00344 } // namespace Gnome
00345 
00346 
00347 namespace Glib
00348 {
00349 
00355   Glib::RefPtr<Gnome::Vfs::Uri> wrap(GnomeVFSURI* object, bool take_copy = false);
00356 
00357 } // namespace Glib
00358 
00359 #endif /* _LIBGNOMEVFSMM_URI_H */
00360 

Generated on Wed Aug 17 17:31:33 2005 for libgnomevfsmm by  doxygen 1.3.9.1