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

handle.h

Go to the documentation of this file.
00001 /* $Id: handle.h,v 1.9 2003/07/21 20:54:05 mxpxpod Exp $ */
00002 
00003 /* Copyright 2003 gnome-vfsmm Development Team
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Library General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2 of the License, or (at your option) any later version.
00009  *
00010  * This library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Library General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Library General Public
00016  * License along with this library; if not, write to the Free
00017  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018  */
00019 
00020 
00021 #ifndef _LIBGNOMEVFSMM_HANDLE_H
00022 #define _LIBGNOMEVFSMM_HANDLE_H
00023 
00024 #include <glibmm.h>
00025 
00026 #include <libgnomevfs/gnome-vfs-ops.h>
00027 
00028 #include <libgnomevfsmm/uri.h>
00029 #include <libgnomevfsmm/exception.h>
00030 #include <libgnomevfsmm/file-info.h>
00031 #include <libgnomevfsmm/enums.h>
00032 #include <libgnomevfsmm/types.h>
00033 
00034 
00035 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00036 typedef struct GnomeVFSHandle GnomeVFSHandle;
00037 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00038 
00039 namespace Gnome
00040 {
00041 
00042 namespace Vfs
00043 {
00044 
00045 class Handle
00046 {
00047 public:
00048   Handle();
00049   virtual ~Handle();
00050   
00051   void open(const Glib::ustring& text_uri, OpenMode open_mode) throw(exception);
00052   void open(const Glib::RefPtr<const Uri>& uri, OpenMode open_mode) throw(exception);
00053 
00054   void create(const Glib::ustring& text_uri, OpenMode open_mode, bool exclusive, guint permissions) throw(exception);
00055   void create(const Glib::RefPtr<const Uri>& uri, OpenMode open_mode, bool exclusive, guint permissions) throw(exception);
00056 
00057   void close() throw(exception);
00058 
00059   FileSize read(gpointer buffer, FileSize bytes) throw(exception);
00060 
00061   FileSize write(gconstpointer buffer, FileSize bytes) throw(exception);
00062 
00063   void seek(SeekPosition whence, FileOffset offset) throw(exception);
00064 
00065   FileSize tell() throw(exception);
00066   
00067   static Glib::RefPtr<FileInfo> get_file_info(const Glib::ustring& text_uri, FileInfoOptions options = FILE_INFO_DEFAULT) throw(exception);
00068 
00069   Glib::RefPtr<FileInfo> get_file_info(FileInfoOptions options = FILE_INFO_DEFAULT) const throw(exception);
00070 
00071   
00072   static void truncate(const Glib::ustring& text_uri, FileSize length) throw(exception);
00073   static void truncate(const Glib::RefPtr<const Uri>& uri, FileSize length) throw(exception);
00074   void truncate(FileSize length) throw(exception);
00075 
00076   static void make_directory(const Glib::ustring& text_uri, guint permissions) throw(exception);
00077   static void make_directory(const Glib::RefPtr<const Uri>& uri, guint permissions) throw(exception);
00078 
00079   static void remove_directory(const Glib::ustring& text_uri) throw(exception);
00080   static void remove_directory(const Glib::RefPtr<const Uri>& uri) throw(exception);
00081 
00082   static void unlink(const Glib::ustring& text_uri) throw(exception);
00083   static void unlink(const Glib::RefPtr<const Uri>& uri) throw(exception);
00084 
00085   static void move(const Glib::ustring& old_text_uri, const Glib::ustring& new_text_uri, bool force_replace) throw(exception);
00086   static void move(const Glib::RefPtr<const Uri>& old_uri, const Glib::RefPtr<const Uri>& new_uri, bool force_replace) throw(exception);
00087    
00088   static bool check_same_fs(const Glib::ustring& source, const Glib::ustring& target) throw(exception);
00089   static bool check_same_fs(const Glib::RefPtr<const Uri>& source, const Glib::RefPtr<const Uri>& target) throw(exception);
00090 
00091   bool uri_exists(const Glib::RefPtr<const Uri>& uri) throw(exception);
00092 
00093   static void set_file_info(const Glib::ustring& text_uri, const Glib::RefPtr<const FileInfo>& info, SetFileInfoMask mask) throw(exception);
00094   static void set_file_info(const Glib::RefPtr<const Uri>& uri, const Glib::RefPtr<const FileInfo>& info, SetFileInfoMask mask) throw(exception);
00095 
00096   void file_control(const Glib::ustring& operation, gpointer operation_data) throw(exception);
00097   
00098   
00099   GnomeVFSHandle* gobj();
00100   const GnomeVFSHandle* gobj() const;  
00101 
00102 
00103 protected:
00104  
00105   GnomeVFSHandle* gobj_;
00106 };
00107 
00108 } // namespace Vfs
00109 } // namespace Gnome
00110 
00111 
00112 
00113 
00114 #endif /* _LIBGNOMEVFSMM_HANDLE_H */
00115 

Generated on Mon Apr 5 17:43:41 2004 for libgnomevfsmm by doxygen 1.3.6-20040222