00001
00002
00003 #ifndef _LIBGNOMEVFSMM_FILE_INFO_H
00004 #define _LIBGNOMEVFSMM_FILE_INFO_H
00005
00006
00007 #include <glibmm.h>
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include <libgnomevfsmm/enums.h>
00031 #include <libgnomevfsmm/types.h>
00032
00033
00034 namespace Gnome
00035 {
00036
00037 namespace Vfs
00038 {
00039
00040
00041
00042 class FileInfo
00043 {
00044 public:
00045 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00046 typedef FileInfo CppObjectType;
00047 typedef GnomeVFSFileInfo BaseObjectType;
00048 #endif
00049
00050 static Glib::RefPtr<FileInfo> create();
00051
00052
00053 void reference() const;
00054 void unreference() const;
00055
00057 GnomeVFSFileInfo* gobj();
00058
00060 const GnomeVFSFileInfo* gobj() const;
00061
00063 GnomeVFSFileInfo* gobj_copy() const;
00064
00065 protected:
00066
00067 FileInfo();
00068 void operator delete(void*, size_t);
00069
00070 private:
00071
00072 FileInfo(const FileInfo&);
00073 FileInfo& operator=(const FileInfo&);
00074
00075
00076 public:
00077
00078
00081 void clear();
00082
00086 Glib::ustring get_mime_type() const;
00087
00091 Glib::RefPtr<FileInfo> duplicate();
00092
00093
00097 std::string get_name() const;
00098
00099
00100
00101
00105 FileType get_type() const;
00106
00110 FilePermissions get_permissions() const;
00111
00115 FileFlags get_flags() const;
00116
00117
00118
00119
00120
00121
00125 guint get_link_count() const;
00126
00130 guint get_uid() const;
00131
00135 guint get_gid() const;
00136
00141 FileSize get_size() const;
00142
00147 FileSize get_block_count() const;
00148
00153 guint get_io_block_size() const;
00154
00158 time_t get_access_time() const;
00159
00163 time_t get_modification_time() const;
00164
00168 time_t get_creation_time() const;
00169
00173 std::string get_symlink_name() const;
00174
00179 bool is_symlink() const;
00180
00181
00182 };
00183
00184 }
00185 }
00186
00187 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00188 namespace Glib
00189 {
00190 RefPtr<Gnome::Vfs::FileInfo> wrap(GnomeVFSFileInfo* object, bool take_copy);
00191
00192 namespace Container_Helpers
00193 {
00198 template <>
00199 struct TypeTraits< Glib::RefPtr<Gnome::Vfs::FileInfo> >
00200 {
00201 typedef Glib::RefPtr<Gnome::Vfs::FileInfo> CppType;
00202 typedef Gnome::Vfs::FileInfo::BaseObjectType * CType;
00203 typedef Gnome::Vfs::FileInfo::BaseObjectType * CTypeNonConst;
00204
00205 static CType to_c_type (const CppType& ptr) { return Glib::unwrap(ptr); }
00206 static CType to_c_type (CType ptr) { return ptr; }
00207 static CppType to_cpp_type (CType ptr)
00208 {
00209 return Glib::wrap(ptr, true);
00210 }
00211
00212 static void release_c_type (CType ptr)
00213 {
00214 gnome_vfs_file_info_unref(const_cast<CTypeNonConst>(ptr));
00215 }
00216 };
00217 }
00218 }
00219
00220 #endif // DOXYGEN_SHOULD_SKIP_THIS
00221
00222
00223 namespace Gnome
00224 {
00225
00226 namespace Vfs
00227 {
00228
00234 bool operator==(const FileInfo& lhs, const FileInfo& rhs);
00235
00241 bool operator!=(const FileInfo& lhs, const FileInfo& rhs);
00242
00243
00244 }
00245
00246 }
00247
00248
00249 namespace Glib
00250 {
00251
00257 Glib::RefPtr<Gnome::Vfs::FileInfo> wrap(GnomeVFSFileInfo* object, bool take_copy = false);
00258
00259 }
00260
00261
00262 #endif
00263