00001 // -*- c++ -*- 00002 // Generated by gtkmmproc -- DO NOT MODIFY! 00003 #ifndef _LIBGNOMEVFSMM_FILE_INFO_H 00004 #define _LIBGNOMEVFSMM_FILE_INFO_H 00005 00006 00007 #include <glibmm.h> 00008 00009 /* $Id: file-info.hg,v 1.13 2005/11/16 19:50:26 murrayc Exp $ */ 00010 // -*- C++ -*- // this is for the .hg, I realize gensig puts one in 00011 00012 /* Copyright 2003 gnome-vfsmm Development Team 00013 * 00014 * This library is free software; you can redistribute it and/or 00015 * modify it under the terms of the GNU Library General Public 00016 * License as published by the Free Software Foundation; either 00017 * version 2 of the License, or (at your option) any later version. 00018 * 00019 * This library is distributed in the hope that it will be useful, 00020 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00021 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00022 * Library General Public License for more details. 00023 * 00024 * You should have received a copy of the GNU Library General Public 00025 * License along with this library; if not, write to the Free 00026 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 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 //TODO: This is actually now a boxed-type, with a get_type() function. 00041 00042 class FileInfo 00043 { 00044 public: 00045 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00046 typedef FileInfo CppObjectType; 00047 typedef GnomeVFSFileInfo BaseObjectType; 00048 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 00049 00050 static Glib::RefPtr<FileInfo> create(); 00051 00052 // For use with Glib::RefPtr<> only. 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 // Do not derive this. Gnome::Vfs::FileInfo can neither be constructed nor deleted. 00067 FileInfo(); 00068 void operator delete(void*, size_t); 00069 00070 private: 00071 // noncopyable 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 /* Fields which are actually valid in this structure. */ 00100 //GnomeVFSFileInfoFields valid_fields; 00101 00105 FileType get_type() const; 00106 00110 FilePermissions get_permissions() const; 00111 00115 FileFlags get_flags() const; 00116 00117 /* These are only valid if `is_local' is TRUE (see below). */ 00118 //dev_t device; 00119 //GnomeVFSInodeNumber inode; 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 } // namespace Vfs 00185 } // namespace Gnome 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 } // namespace Container_Helpers 00218 } // namespace Glib 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 } // namespace Vfs 00245 00246 } // namespace Gnome 00247 00248 00249 namespace Glib 00250 { 00251 00257 Glib::RefPtr<Gnome::Vfs::FileInfo> wrap(GnomeVFSFileInfo* object, bool take_copy = false); 00258 00259 } // namespace Glib 00260 00261 00262 #endif /* _LIBGNOMEVFSMM_FILE_INFO_H */ 00263