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

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.19 2005/04/07 11:04:01 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 
00054 enum MakeURIDirs
00055 {
00056   MAKE_URI_DIR_NONE = 0,
00057   MAKE_URI_DIR_HOMEDIR = 1 << 0,
00058   MAKE_URI_DIR_CURRENT = 1 << 1
00059 };
00060 
00062 inline MakeURIDirs operator|(MakeURIDirs lhs, MakeURIDirs rhs)
00063   { return static_cast<MakeURIDirs>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
00064 
00066 inline MakeURIDirs operator&(MakeURIDirs lhs, MakeURIDirs rhs)
00067   { return static_cast<MakeURIDirs>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
00068 
00070 inline MakeURIDirs operator^(MakeURIDirs lhs, MakeURIDirs rhs)
00071   { return static_cast<MakeURIDirs>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
00072 
00074 inline MakeURIDirs operator~(MakeURIDirs flags)
00075   { return static_cast<MakeURIDirs>(~static_cast<unsigned>(flags)); }
00076 
00078 inline MakeURIDirs& operator|=(MakeURIDirs& lhs, MakeURIDirs rhs)
00079   { return (lhs = static_cast<MakeURIDirs>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }
00080 
00082 inline MakeURIDirs& operator&=(MakeURIDirs& lhs, MakeURIDirs rhs)
00083   { return (lhs = static_cast<MakeURIDirs>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }
00084 
00086 inline MakeURIDirs& operator^=(MakeURIDirs& lhs, MakeURIDirs rhs)
00087   { return (lhs = static_cast<MakeURIDirs>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }
00088 
00089 
00090 class Uri
00091 {
00092   public:
00093 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00094   typedef Uri CppObjectType;
00095   typedef GnomeVFSURI BaseObjectType;
00096 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00097 
00098 
00099   // For use with Glib::RefPtr<> only.
00100   void reference()   const;
00101   void unreference() const;
00102 
00104   GnomeVFSURI*       gobj();
00105 
00107   const GnomeVFSURI* gobj() const;
00108 
00110   GnomeVFSURI* gobj_copy() const;
00111 
00112 protected:
00113   // Do not derive this.  Gnome::Vfs::Uri can neither be constructed nor deleted.
00114   Uri();
00115   void operator delete(void*, size_t);
00116 
00117 private:
00118   // noncopyable
00119   Uri(const Uri&);
00120   Uri& operator=(const Uri&);
00121 
00122 
00123 public:
00124 
00129   static Glib::RefPtr<Uri> create(const Glib::ustring& uri);
00130 
00131   
00136   Glib::RefPtr<Uri> resolve_relative(const Glib::ustring& relative_reference);
00137 
00138 
00145   Glib::RefPtr<Uri> append_string(const Glib::ustring& uri_fragment);
00146   
00153   Glib::RefPtr<Uri> append_path(const Glib::ustring& path);
00154   
00161   Glib::RefPtr<Uri> append_file_name(const Glib::ustring& filename);
00162   
00169   Glib::ustring to_string(URIHideOptions hide_options = URI_HIDE_NONE) const;
00170   
00174   Glib::RefPtr<Uri> dup();
00175   
00179   bool is_local() const;
00180   
00184   bool has_parent() const;
00185   
00189   Glib::RefPtr<Uri> get_parent();
00190   
00194   Glib::RefPtr<const Uri> get_parent() const;
00195 
00196   //TODO: GnomeVFSToplevelURI inherits from GnomeVFSUri, but they are not GObjects. That needs a little work.  
00197   //_WRAP_METHOD(GnomeVFSToplevelURI* get_toplevel(), gnome_vfs_uri_get_toplevel)
00198   //_WRAP_METHOD(const GnomeVFSToplevelURI* get_toplevel() const, gnome_vfs_uri_get_toplevel)
00199 
00200   
00204   Glib::ustring get_host_name() const;
00205   
00209   Glib::ustring get_scheme() const;
00210   
00214   guint get_host_port() const;
00215   
00219   Glib::ustring get_user_name() const;
00220   
00224   Glib::ustring get_password() const;
00225 
00226   
00230   void set_host_name(const Glib::ustring& host_name);
00231   
00236   void set_host_port(guint host_port);
00237   
00241   void set_user_name(const Glib::ustring& user_name);
00242   
00246   void set_password(const Glib::ustring& password);
00247 
00248   
00257   bool equal(const Glib::RefPtr<const Uri>& uri) const;
00258   //We wrap this as equal() as well, because operator== requires an operator*.
00259   
00260 
00268   bool is_parent(const Glib::RefPtr<const Uri>& possible_child, bool recursive = true) const;
00269 
00270   
00274   Glib::ustring get_path() const;
00275   
00279   Glib::ustring get_fragment_identifier() const;
00280   
00285   Glib::ustring extract_dirname() const;
00286   
00297   Glib::ustring extract_short_name() const;
00298   
00309   Glib::ustring extract_short_path_name() const;
00310 
00311   //These are used for creating hashes for hash tables, apparently.
00312   //I don't see the point of wrapping them.
00313   
00314 
00315 /*
00316 GList* gnome_vfs_uri_list_parse(const Glib::ustring& uri_list), )
00317 */
00318 
00319   
00326   static Glib::ustring make_full_from_relative(const Glib::ustring& base_uri, const Glib::ustring& relative_uri);
00327 
00328   
00343   static Glib::ustring format_for_display(const Glib::ustring& uri);
00344   
00355   static Glib::ustring make_from_input(const Glib::ustring& uri);
00356   
00357   static Glib::ustring make_from_input(const Glib::ustring& uri, MakeURIDirs dirs);
00358   
00365   static Glib::ustring make_canonical_strip_fragment(const Glib::ustring& uri);
00366   
00374   static bool uris_match(const Glib::ustring& uri_1, const Glib::ustring& uri_2);
00375   
00382   static Glib::ustring get_scheme(const Glib::ustring& uri);
00383   
00394   static Glib::ustring make_from_shell_arg(const Glib::ustring& uri);
00395 
00396 
00401   Glib::RefPtr<FileInfo> get_file_info(FileInfoOptions options = FILE_INFO_DEFAULT) const throw(exception);
00402 
00406   void create_symbolic_link(const Glib::ustring& target_reference) throw(exception);
00407 
00411   bool uri_exists() const;
00412 
00418   FileSize get_volume_free_space() const throw(exception);        
00419 
00420 
00421 };
00422 
00423 
00424 //TODO: GnomeVFSToplevelURI inherits from GnomeVFSUri, but they are not GObjects. That needs a little work.
00425 /*
00426 class TopLevelUri : Uri
00427 {
00428   //TODO: Constructors/memory-management so we can wrap a GnomeVFSToplevelURI* in this.
00429   //TODO: member accessors?
00430 };
00431 */
00432   
00433 
00434 } // namespace Vfs
00435 } // namespace Gnome
00436 
00437 
00438 namespace Gnome
00439 {
00440 
00441 namespace Vfs
00442 {
00443 
00449 bool operator==(const Uri& lhs, const Uri& rhs);
00450 
00456 bool operator!=(const Uri& lhs, const Uri& rhs);
00457 
00458 
00459 } // namespace Vfs
00460 
00461 } // namespace Gnome
00462 
00463 
00464 namespace Glib
00465 {
00466 
00472   Glib::RefPtr<Gnome::Vfs::Uri> wrap(GnomeVFSURI* object, bool take_copy = false);
00473 
00474 } // namespace Glib
00475 
00476 #endif /* _LIBGNOMEVFSMM_URI_H */
00477 

Generated on Fri Sep 9 23:29:34 2005 for libgnomevfsmm by  doxygen 1.4.4