00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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
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 }
00109 }
00110
00111
00112
00113
00114 #endif
00115