libgnomevfsmm  2.26.0
file-info.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _LIBGNOMEVFSMM_FILE_INFO_H
4 #define _LIBGNOMEVFSMM_FILE_INFO_H
5 
6 
7 #include <glibmm.h>
8 
9 /* $Id: file-info.hg,v 1.13 2005/11/16 19:50:26 murrayc Exp $ */
10 // -*- C++ -*- // this is for the .hg, I realize gensig puts one in
11 
12 /* Copyright 2003 gnome-vfsmm Development Team
13  *
14  * This library is free software; you can redistribute it and/or
15  * modify it under the terms of the GNU Lesser General Public
16  * License as published by the Free Software Foundation; either
17  * version 2.1 of the License, or (at your option) any later version.
18  *
19  * This library is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22  * Lesser General Public License for more details.
23  *
24  * You should have received a copy of the GNU Lesser General Public
25  * License along with this library; if not, write to the Free
26  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27  */
28 
29 
30 #include <libgnomevfsmm/enums.h>
31 #include <libgnomevfsmm/types.h>
32 
33 
34 namespace Gnome
35 {
36 
37 namespace Vfs
38 {
39 
40 //TODO: This is actually now a boxed-type, with a get_type() function.
41 
42 class FileInfo
43 {
44  public:
45 #ifndef DOXYGEN_SHOULD_SKIP_THIS
46  typedef FileInfo CppObjectType;
47  typedef GnomeVFSFileInfo BaseObjectType;
48 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
49 
50  static Glib::RefPtr<FileInfo> create();
51 
52  // For use with Glib::RefPtr<> only.
53  void reference() const;
54  void unreference() const;
55 
57  GnomeVFSFileInfo* gobj();
58 
60  const GnomeVFSFileInfo* gobj() const;
61 
63  GnomeVFSFileInfo* gobj_copy() const;
64 
65 protected:
66  // Do not derive this. Gnome::Vfs::FileInfo can neither be constructed nor deleted.
67  FileInfo();
68  void operator delete(void*, size_t);
69 
70 private:
71  // noncopyable
72  FileInfo(const FileInfo&);
73  FileInfo& operator=(const FileInfo&);
74 
75 
76 public:
77 
78 
81  void clear();
82 
86  Glib::ustring get_mime_type() const;
87 
91  Glib::RefPtr<FileInfo> duplicate();
92 
93 
97  std::string get_name() const;
98 
99  /* Fields which are actually valid in this structure. */
100 //GnomeVFSFileInfoFields valid_fields;
101 
105  FileType get_type() const;
106 
111 
115  FileFlags get_flags() const;
116 
117  /* These are only valid if `is_local' is TRUE (see below). */
118  //dev_t device;
119  //GnomeVFSInodeNumber inode;
120 
121 
125  guint get_link_count() const;
126 
130  guint get_uid() const;
131 
135  guint get_gid() const;
136 
141  FileSize get_size() const;
142 
147  FileSize get_block_count() const;
148 
153  guint get_io_block_size() const;
154 
158  time_t get_access_time() const;
159 
163  time_t get_modification_time() const;
164 
168  time_t get_creation_time() const;
169 
173  std::string get_symlink_name() const;
174 
179  bool is_symlink() const;
180 
181 
182 };
183 
184 } // namespace Vfs
185 } // namespace Gnome
186 
187 #ifndef DOXYGEN_SHOULD_SKIP_THIS
188 namespace Glib
189 {
190  RefPtr<Gnome::Vfs::FileInfo> wrap(GnomeVFSFileInfo* object, bool take_copy);
191 
192  namespace Container_Helpers
193  {
198  template <>
199  struct TypeTraits< Glib::RefPtr<Gnome::Vfs::FileInfo> >
200  {
201  typedef Glib::RefPtr<Gnome::Vfs::FileInfo> CppType;
202  typedef Gnome::Vfs::FileInfo::BaseObjectType * CType;
203  typedef Gnome::Vfs::FileInfo::BaseObjectType * CTypeNonConst;
204 
205  static CType to_c_type (const CppType& ptr) { return Glib::unwrap(ptr); }
206  static CType to_c_type (CType ptr) { return ptr; }
207  static CppType to_cpp_type (CType ptr)
208  {
209  return Glib::wrap(ptr, true);
210  }
211 
212  static void release_c_type (CType ptr)
213  {
214  gnome_vfs_file_info_unref(const_cast<CTypeNonConst>(ptr));
215  }
216  };
217  } // namespace Container_Helpers
218 } // namespace Glib
219 
220 #endif // DOXYGEN_SHOULD_SKIP_THIS
221 
222 
223 namespace Gnome
224 {
225 
226 namespace Vfs
227 {
228 
234 bool operator==(const FileInfo& lhs, const FileInfo& rhs);
235 
241 bool operator!=(const FileInfo& lhs, const FileInfo& rhs);
242 
243 
244 } // namespace Vfs
245 
246 } // namespace Gnome
247 
248 
249 namespace Glib
250 {
251 
260  Glib::RefPtr<Gnome::Vfs::FileInfo> wrap(GnomeVFSFileInfo* object, bool take_copy = false);
261 
262 } // namespace Glib
263 
264 
265 #endif /* _LIBGNOMEVFSMM_FILE_INFO_H */
266