00001 // -*- c++ -*- 00002 // Generated by gtkmmproc -- DO NOT MODIFY! 00003 #ifndef _LIBGNOMEVFSMM_FILE_INFO_H 00004 #define _LIBGNOMEVFSMM_FILE_INFO_H 00005 00006 #include <glibmm.h> 00007 00008 /* $Id: file-info.hg,v 1.9 2003/07/31 18:06:23 mxpxpod 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 <libgnomevfs/gnome-vfs-file-info.h> 00029 #include <libgnomevfsmm/enums.h> 00030 #include <libgnomevfsmm/types.h> 00031 00032 00033 namespace Gnome 00034 { 00035 00036 namespace Vfs 00037 { 00038 00039 class FileInfo 00040 { 00041 public: 00042 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00043 typedef FileInfo CppObjectType; 00044 typedef GnomeVFSFileInfo BaseObjectType; 00045 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 00046 00047 static Glib::RefPtr<FileInfo> create(); 00048 00049 // For use with Glib::RefPtr<> only. 00050 void reference() const; 00051 void unreference() const; 00052 00054 GnomeVFSFileInfo* gobj(); 00055 00057 const GnomeVFSFileInfo* gobj() const; 00058 00059 // The caller is responsible for freeing it. Use when directly setting fields in structs. 00060 GnomeVFSFileInfo* gobj_copy() const; 00061 00062 protected: 00063 // Do not derive this. Gnome::Vfs::FileInfo can neither be constructed nor deleted. 00064 FileInfo(); 00065 void operator delete(void*, size_t); 00066 00067 private: 00068 // noncopyable 00069 FileInfo(const FileInfo&); 00070 FileInfo& operator=(const FileInfo&); 00071 00072 00073 public: 00074 00075 00078 void clear(); 00079 00082 Glib::ustring get_mime_type() const; 00083 00087 Glib::RefPtr<FileInfo> duplicate(); 00088 00089 00090 /* TODO 00091 GList * gnome_vfs_file_info_list_ref (GList *list); 00092 GList * gnome_vfs_file_info_list_unref (GList *list); 00093 GList * gnome_vfs_file_info_list_copy (GList *list); 00094 void gnome_vfs_file_info_list_free (GList *list); 00095 */ 00096 00097 00101 std::string get_name() const; 00102 00103 /* Fields which are actually valid in this structure. */ 00104 //GnomeVFSFileInfoFields valid_fields; 00105 00109 FileType get_type() const; 00110 00114 FilePermissions get_permissions() const; 00115 00119 FileFlags get_flags() const; 00120 00121 /* These are only valid if `is_local' is TRUE (see below). */ 00122 //dev_t device; 00123 //GnomeVFSInodeNumber inode; 00124 00125 00129 guint get_link_count() const; 00130 00134 guint get_uid() const; 00135 00139 guint get_gid() const; 00140 00145 FileSize get_size() const; 00146 00151 FileSize get_block_count() const; 00152 00157 guint get_io_block_size() const; 00158 00162 time_t get_access_time() const; 00163 00167 time_t get_modification_time() const; 00168 00172 time_t get_creation_time() const; 00173 00177 std::string get_symlink_name() const; 00178 00183 bool is_symlink() const; 00184 00185 00186 }; 00187 00188 } // namespace Vfs 00189 } // namespace Gnome 00190 00191 00192 namespace Gnome 00193 { 00194 00195 namespace Vfs 00196 { 00197 00199 bool operator==(const FileInfo& lhs, const FileInfo& rhs); 00200 00202 bool operator!=(const FileInfo& lhs, const FileInfo& rhs); 00203 00204 00205 } // namespace Vfs 00206 00207 } // namespace Gnome 00208 00209 00210 namespace Glib 00211 { 00212 00214 Glib::RefPtr<Gnome::Vfs::FileInfo> wrap(GnomeVFSFileInfo* object, bool take_copy = false); 00215 00216 } // namespace Glib 00217 00218 #endif /* _LIBGNOMEVFSMM_FILE_INFO_H */ 00219