1 /* GIO - GLib Input, Output and Streaming Library
3 * Copyright (C) 2006-2007 Red Hat, Inc.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General
16 * Public License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18 * Boston, MA 02111-1307, USA.
20 * Author: Alexander Larsson <alexl@redhat.com>
23 #ifndef __G_FILE_INFO_H__
24 #define __G_FILE_INFO_H__
26 #include <glib-object.h>
27 #include <glib/gfileutils.h>
28 #include <gio/gfileattribute.h>
29 #include <gio/gicon.h>
33 #define G_TYPE_FILE_INFO (g_file_info_get_type ())
34 #define G_FILE_INFO(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_FILE_INFO, GFileInfo))
35 #define G_FILE_INFO_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_FILE_INFO, GFileInfoClass))
36 #define G_IS_FILE_INFO(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_FILE_INFO))
37 #define G_IS_FILE_INFO_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_FILE_INFO))
38 #define G_FILE_INFO_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_FILE_INFO, GFileInfoClass))
43 * Stores information about a file system object referenced by a #GFile.
45 typedef struct _GFileInfo GFileInfo;
46 typedef struct _GFileInfoClass GFileInfoClass;
49 * GFileAttributeMatcher:
51 * Determines if a string matches a file attribute.
53 typedef struct _GFileAttributeMatcher GFileAttributeMatcher;
57 * @G_FILE_TYPE_UNKNOWN: File's type is unknown.
58 * @G_FILE_TYPE_REGULAR: File handle represents a regular file.
59 * @G_FILE_TYPE_DIRECTORY: File handle represents a directory.
60 * @G_FILE_TYPE_SYMBOLIC_LINK: File handle represents a symbolic link (Unix systems)
61 * @G_FILE_TYPE_SPECIAL: File is a "special" file, such as a socket, fifo, blockdev, or chardev.
62 * @G_FILE_TYPE_SHORTCUT: File is a shortcut (Windows systems)
63 * @G_FILE_TYPE_MOUNTABLE: File is a mountable location.
65 * Indicates the file's on-disk type.
68 G_FILE_TYPE_UNKNOWN = 0,
70 G_FILE_TYPE_DIRECTORY,
71 G_FILE_TYPE_SYMBOLIC_LINK,
72 G_FILE_TYPE_SPECIAL, /* socket, fifo, blockdev, chardev */
77 /* Common Attributes: */
79 * G_FILE_ATTRIBUTE_STD_TYPE:
81 * A key in the "std" namespace for storing file types.
82 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
83 * The value for this key should contain a #GFileType.
85 #define G_FILE_ATTRIBUTE_STD_TYPE "std:type" /* uint32 (GFileType) */
88 * G_FILE_ATTRIBUTE_STD_IS_HIDDEN:
90 * A key in the "std" namespace for checking if a file is hidden.
91 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
93 #define G_FILE_ATTRIBUTE_STD_IS_HIDDEN "std:is_hidden" /* boolean */
96 * G_FILE_ATTRIBUTE_STD_IS_BACKUP:
98 * A key in the "std" namespace for checking if a file is a backup file.
99 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
101 #define G_FILE_ATTRIBUTE_STD_IS_BACKUP "std:is_backup" /* boolean */
104 * G_FILE_ATTRIBUTE_STD_IS_SYMLINK:
106 * A key in the "std" namespace for checking if the file is a symlink.
107 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
109 #define G_FILE_ATTRIBUTE_STD_IS_SYMLINK "std:is_symlink" /* boolean */
112 * G_FILE_ATTRIBUTE_STD_IS_VIRTUAL:
114 * A key in the "std" namespace for checking if a file is virtual.
115 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
117 #define G_FILE_ATTRIBUTE_STD_IS_VIRTUAL "std:is_virtual" /* boolean */
120 * G_FILE_ATTRIBUTE_STD_NAME:
122 * A key in the "std" namespace for getting the name of the file.
123 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
125 #define G_FILE_ATTRIBUTE_STD_NAME "std:name" /* byte string */
128 * G_FILE_ATTRIBUTE_STD_DISPLAY_NAME:
130 * A key in the "std" namespace for getting the display name of the file.
131 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
133 #define G_FILE_ATTRIBUTE_STD_DISPLAY_NAME "std:display_name" /* string */
136 * G_FILE_ATTRIBUTE_STD_EDIT_NAME:
138 * A key in the "std" namespace for edit name of the file.
139 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
141 #define G_FILE_ATTRIBUTE_STD_EDIT_NAME "std:edit_name" /* string */
144 * G_FILE_ATTRIBUTE_STD_COPY_NAME:
146 * A key in the "std" namespace for getting the copy name of the file.
147 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
149 #define G_FILE_ATTRIBUTE_STD_COPY_NAME "std:copy_name" /* string */
152 * G_FILE_ATTRIBUTE_STD_ICON:
154 * A key in the "std" namespace for getting the icon for the file.
155 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_OBJECT.
156 * The value for this key should contain a #GIcon.
158 #define G_FILE_ATTRIBUTE_STD_ICON "std:icon" /* object (GIcon) */
161 * G_FILE_ATTRIBUTE_STD_CONTENT_TYPE:
163 * A key in the "std" namespace for getting the content type of the file.
164 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
165 * The value for this key should contain a valid content type.
167 #define G_FILE_ATTRIBUTE_STD_CONTENT_TYPE "std:content_type" /* string */
170 * G_FILE_ATTRIBUTE_STD_FAST_CONTENT_TYPE:
172 * A key in the "std" namespace for getting the fast content type.
173 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
176 #define G_FILE_ATTRIBUTE_STD_FAST_CONTENT_TYPE "std:fast_content_type" /* string */
179 * G_FILE_ATTRIBUTE_STD_SIZE:
181 * A key in the "std" namespace for getting the file's size.
182 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
184 #define G_FILE_ATTRIBUTE_STD_SIZE "std:size" /* uint64 */
187 * G_FILE_ATTRIBUTE_STD_SYMLINK_TARGET:
189 * A key in the "std" namespace for getting the symlink target, if the file
190 * is a symlink. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
192 #define G_FILE_ATTRIBUTE_STD_SYMLINK_TARGET "std:symlink_target" /* byte string */
195 * G_FILE_ATTRIBUTE_STD_TARGET_URI:
197 * A key in the "std" namespace for getting the target URI for the file.
198 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
200 #define G_FILE_ATTRIBUTE_STD_TARGET_URI "std:target_uri" /* string */
203 * G_FILE_ATTRIBUTE_STD_SORT_ORDER:
205 * A key in the "std" namespace for setting the sort order of a file.
206 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_INT32.
207 * An example use would be in file managers, which would use this key to set
208 * the order files are displayed.
210 #define G_FILE_ATTRIBUTE_STD_SORT_ORDER "std:sort_order" /* int32 */
212 /* Entity tags, used to avoid missing updates on save */
214 * G_FILE_ATTRIBUTE_ETAG_VALUE:
216 * A key in the "etag" namespace for getting the value of the file's
217 * entity tag. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
219 #define G_FILE_ATTRIBUTE_ETAG_VALUE "etag:value" /* string */
221 /* File identifier, for e.g. avoiding loops when doing recursive directory scanning */
223 * G_FILE_ATTRIBUTE_ID_FILE:
225 * A key in the "id" namespace for getting a file identifier.
226 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
227 * An example use would be during listing files, to avoid recursive
228 * directory scanning.
230 #define G_FILE_ATTRIBUTE_ID_FILE "id:file" /* string */
233 * G_FILE_ATTRIBUTE_ID_FS:
235 * A key in the "id" namespace for getting the file system identifier.
236 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
237 * An example use would be during listing files, to avoid recursive
238 * directory scanning.
240 #define G_FILE_ATTRIBUTE_ID_FS "id:fs" /* string */
242 /* Calculated Access Rights for current user */
245 * G_FILE_ATTRIBUTE_ACCESS_CAN_READ:
247 * A key in the "access" namespace for getting read privilidges.
248 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
249 * This key will be true if the user is able to read the file.
251 #define G_FILE_ATTRIBUTE_ACCESS_CAN_READ "access:can_read" /* boolean */
254 * G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE:
256 * A key in the "access" namespace for getting write privilidges.
257 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
258 * This key will be true if the user is able to write to the file.
260 #define G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE "access:can_write" /* boolean */
263 * G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE:
265 * A key in the "access" namespace for getting execution privilidges.
266 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
267 * This key will be true if the user is able to execute the file.
269 #define G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE "access:can_execute" /* boolean */
272 * G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE:
274 * A key in the "access" namespace for checking deletion privilidges.
275 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
276 * This key will be true if the user is able to delete the file.
278 #define G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE "access:can_delete" /* boolean */
281 * G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH:
283 * A key in the "access" namespace for checking trashing privilidges.
284 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
285 * This key will be true if the user is able to send the file to the
286 * virtual file system trash location.
288 #define G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH "access:can_trash" /* boolean */
291 * G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME:
293 * A key in the "access" namespace for checking renaming privilidges.
294 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
295 * This key will be true if the user is able to rename the file.
297 #define G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME "access:can_rename" /* boolean */
298 /* TODO: Should we have special version for directories? can_enumerate, etc */
300 /* Mountable attributes */
302 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT:
304 * A key in the "mountable" namespace for checking if a file is mountable.
305 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
307 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT "mountable:can_mount" /* boolean */
310 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT:
312 * A key in the "mountable" namespace for checking if a file is unmountable.
313 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
315 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT "mountable:can_unmount" /* boolean */
318 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT:
320 * A key in the "mountable" namespace for checking if a file can be ejected.
321 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
323 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT "mountable:can_eject" /* boolean */
326 * G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE:
328 * A key in the "mountable" namespace for getting the unix device.
329 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
331 #define G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE "mountable:unix_device" /* uint32 */
334 * G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI:
336 * A key in the "mountable" namespace for getting the HAL UDI for the mounted
337 * file. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
339 #define G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI "mountable:hal_udi" /* string */
341 /* Time attributes */
343 /* The last time the file content or an attribute was modified */
345 * G_FILE_ATTRIBUTE_TIME_MODIFIED:
347 * A key in the "time" namespace for getting the time the file was last
348 * modified. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64,
349 * and contains the UNIX time since the file was modified.
351 #define G_FILE_ATTRIBUTE_TIME_MODIFIED "time:modified" /* uint64 */
354 * G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC:
356 * A key in the "time" namespace for getting the milliseconds of the time
357 * the file was last modified. This should be used in conjunction with
358 * #G_FILE_ATTRIBUTE_TIME_MODIFIED. Corresponding #GFileAttributeType is
359 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
361 #define G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC "time:modified_usec" /* uint32 */
362 /* The last time the file was read */
364 * G_FILE_ATTRIBUTE_TIME_ACCESS:
366 * A key in the "time" namespace for getting the time the file was last
367 * accessed. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64,
368 * and contains the UNIX time since the file was last accessed.
370 #define G_FILE_ATTRIBUTE_TIME_ACCESS "time:access" /* uint64 */
372 * G_FILE_ATTRIBUTE_TIME_ACCESS_USEC:
374 * A key in the "time" namespace for getting the milliseconds of the time
375 * the file was last accessed. This should be used in conjunction with
376 * #G_FILE_ATTRIBUTE_TIME_ACCESS. Corresponding #GFileAttributeType is
377 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
379 #define G_FILE_ATTRIBUTE_TIME_ACCESS_USEC "time:access_usec" /* uint32 */
380 /* The last time a file attribute was changed (e.g. unix ctime) */
382 * G_FILE_ATTRIBUTE_TIME_CHANGED:
384 * A key in the "time" namespace for getting the time the file was last
385 * changed. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64,
386 * and contains the UNIX time since the file was last changed.
388 #define G_FILE_ATTRIBUTE_TIME_CHANGED "time:changed" /* uint64 */
390 * G_FILE_ATTRIBUTE_TIME_CHANGED_USEC:
392 * A key in the "time" namespace for getting the milliseconds of the time
393 * the file was last changed. This should be used in conjunction with
394 * #G_FILE_ATTRIBUTE_TIME_CHANGED. Corresponding #GFileAttributeType is
395 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
397 #define G_FILE_ATTRIBUTE_TIME_CHANGED_USEC "time:changed_usec" /* uint32 */
398 /* When the file was originally created (e.g. ntfs ctime) */
400 * G_FILE_ATTRIBUTE_TIME_CREATED:
402 * A key in the "time" namespace for getting the time the file was created.
403 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64,
404 * and contains the UNIX time since the file was created.
406 #define G_FILE_ATTRIBUTE_TIME_CREATED "time:created" /* uint64 */
409 * G_FILE_ATTRIBUTE_TIME_CREATED_USEC:
411 * A key in the "time" namespace for getting the milliseconds of the time
412 * the file was created. This should be used in conjunction with
413 * #G_FILE_ATTRIBUTE_TIME_CREATED. Corresponding #GFileAttributeType is
414 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
416 #define G_FILE_ATTRIBUTE_TIME_CREATED_USEC "time:created_usec" /* uint32 */
418 /* Unix specific attributes */
420 * G_FILE_ATTRIBUTE_UNIX_DEVICE:
422 * A key in the "unix" namespace for getting the device id of the device the
423 * file is located on (see man stat(2)). This attribute is only available
424 * for UNIX file systems. Corresponding #GFileAttributeType is
425 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
428 #define G_FILE_ATTRIBUTE_UNIX_DEVICE "unix:device" /* uint32 */
430 * G_FILE_ATTRIBUTE_UNIX_INODE:
432 * A key in the "unix" namespace for getting the inode of the file.
433 * This attribute is only available for UNIX file systems. Corresponding
434 * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
436 #define G_FILE_ATTRIBUTE_UNIX_INODE "unix:inode" /* uint64 */
438 * G_FILE_ATTRIBUTE_UNIX_MODE:
440 * A key in the "unix" namespace for getting the mode of the file (e.g. whether the file
441 * is a regular file, symlink, etc). See man lstat(2). This attribute is only available
442 * for UNIX file systems. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
444 #define G_FILE_ATTRIBUTE_UNIX_MODE "unix:mode" /* uint32 */
447 * G_FILE_ATTRIBUTE_UNIX_NLINK:
449 * A key in the "unix" namespace for getting the number of hard links for a
450 * file. See man lstat(2). This attribute is only available for UNIX file systems.
451 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
454 #define G_FILE_ATTRIBUTE_UNIX_NLINK "unix:nlink" /* uint32 */
456 * G_FILE_ATTRIBUTE_UNIX_UID:
458 * A key in the "unix" namespace for getting the user ID for the file.
459 * This attribute is only available for UNIX file systems.
460 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
462 #define G_FILE_ATTRIBUTE_UNIX_UID "unix:uid" /* uint32 */
464 * G_FILE_ATTRIBUTE_UNIX_GID:
466 * A key in the "unix" namespace for getting the group ID for the file.
467 * This attribute is only available for UNIX file systems.
468 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
470 #define G_FILE_ATTRIBUTE_UNIX_GID "unix:gid" /* uint32 */
472 * G_FILE_ATTRIBUTE_UNIX_RDEV:
474 * A key in the "unix" namespace for getting the device ID for the file (if it
475 * is a special file). See man lstat(2). This attribute is only available for
476 * UNIX file systems. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
478 #define G_FILE_ATTRIBUTE_UNIX_RDEV "unix:rdev" /* uint32 */
480 * G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE:
482 * A key in the "unix" namespace for getting the block size for the file system.
483 * This attribute is only available for UNIX file systems.
484 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
486 #define G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE "unix:block_size" /* uint32 */
488 * G_FILE_ATTRIBUTE_UNIX_BLOCKS:
490 * A key in the "unix" namespace for getting the number of blocks allocated for the file.
491 * This attribute is only available for UNIX file systems.
492 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
494 #define G_FILE_ATTRIBUTE_UNIX_BLOCKS "unix:blocks" /* uint64 */
497 * G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT:
499 * A key in the "unix" namespace for checking if the file represents a unix mount point.
500 * Returns %TRUE if the file is a unix mount point. This attribute is only available for
501 * UNIX file systems. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
503 #define G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT "unix:is_mountpoint" /* boolean */
505 /* DOS specific attributes */
507 * G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE:
509 * A key in the "dos" namespace for checking if the file's archive flag is set.
510 * Returns %TRUE if the archive flag is set. This attribute is only available for
511 * DOS file systems. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
513 #define G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE "dos:is_archive" /* boolean */
516 * G_FILE_ATTRIBUTE_DOS_IS_SYSTEM:
518 * A key in the "dos" namespace for checking if the file's backup flag is set.
519 * Returns %TRUE if the backup flag is set. This attribute is only available for
520 * DOS file systems. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
522 #define G_FILE_ATTRIBUTE_DOS_IS_SYSTEM "dos:is_system" /* boolean */
524 /* Owner attributes */
526 * G_FILE_ATTRIBUTE_OWNER_USER:
528 * A key in the "owner" namespace for getting the user name of the file's owner.
529 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
531 #define G_FILE_ATTRIBUTE_OWNER_USER "owner:user" /* string */
534 * G_FILE_ATTRIBUTE_OWNER_USER_REAL:
536 * A key in the "owner" namespace for getting the real name of the user that owns the file.
537 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
539 #define G_FILE_ATTRIBUTE_OWNER_USER_REAL "owner:user_real" /* string */
542 * G_FILE_ATTRIBUTE_OWNER_GROUP:
544 * A key in the "owner" namespace for getting the file owner's group.
545 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
547 #define G_FILE_ATTRIBUTE_OWNER_GROUP "owner:group" /* string */
552 * G_FILE_ATTRIBUTE_THUMBNAIL_PATH:
554 * A key in the "thumbnail" namespace for getting the path to the thumbnail image.
555 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
557 #define G_FILE_ATTRIBUTE_THUMBNAIL_PATH "thumbnail:path" /* bytestring */
559 * G_FILE_ATTRIBUTE_THUMBNAIL_THUMNAILING_FAILED:
561 * A key in the "thumbnail" namespace for checking if thumbnailing failed.
562 * Is set to %TRUE if thumbnailing failed. Corresponding #GFileAttributeType
563 * is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
565 #define G_FILE_ATTRIBUTE_THUMBNAILING_FAILED "thumbnail:failed" /* boolean */
567 /* File system info (for g_file_get_filesystem_info) */
570 * G_FILE_ATTRIBUTE_FS_SIZE:
572 * A key in the "fs" namespace for getting the size of the file system, used in
573 * g_file_get_filesystem_info(). Corresponding #GFileAttributeType is
574 * %G_FILE_ATTRIBUTE_TYPE_UINT64.
576 #define G_FILE_ATTRIBUTE_FS_SIZE "fs:size" /* uint64 */
579 * G_FILE_ATTRIBUTE_FS_FREE:
581 * A key in the "fs" namespace for getting the free space left on the file system.
582 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
584 #define G_FILE_ATTRIBUTE_FS_FREE "fs:free" /* uint64 */
587 * G_FILE_ATTRIBUTE_FS_TYPE:
589 * A key in the "fs" namespace for getting the file system's type.
590 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
592 #define G_FILE_ATTRIBUTE_FS_TYPE "fs:type" /* string */
595 * G_FILE_ATTRIBUTE_FS_READONLY:
597 * A key in the "fs" namespace for checking if the file system is read only.
598 * Is set to %TRUE if the file system is read only. Corresponding #GFileAttributeType is
599 * %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
601 #define G_FILE_ATTRIBUTE_FS_READONLY "fs:readonly" /* boolean */
604 * G_FILE_ATTRIBUTE_GVFS_BACKEND:
606 * A key in the "gvfs" namespace that gets the name of the current
607 * GVFS backend in use. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
609 #define G_FILE_ATTRIBUTE_GVFS_BACKEND "gvfs:backend" /* string */
611 GType g_file_info_get_type (void) G_GNUC_CONST;
613 GFileInfo * g_file_info_new (void);
614 GFileInfo * g_file_info_dup (GFileInfo *other);
615 void g_file_info_copy_into (GFileInfo *src_info,
616 GFileInfo *dest_info);
617 gboolean g_file_info_has_attribute (GFileInfo *info,
618 const char *attribute);
619 char ** g_file_info_list_attributes (GFileInfo *info,
620 const char *name_space);
621 GFileAttributeType g_file_info_get_attribute_type (GFileInfo *info,
622 const char *attribute);
623 void g_file_info_remove_attribute (GFileInfo *info,
624 const char *attribute);
625 GFileAttributeValue * g_file_info_get_attribute (GFileInfo *info,
626 const char *attribute);
627 const char * g_file_info_get_attribute_string (GFileInfo *info,
628 const char *attribute);
629 const char * g_file_info_get_attribute_byte_string (GFileInfo *info,
630 const char *attribute);
631 gboolean g_file_info_get_attribute_boolean (GFileInfo *info,
632 const char *attribute);
633 guint32 g_file_info_get_attribute_uint32 (GFileInfo *info,
634 const char *attribute);
635 gint32 g_file_info_get_attribute_int32 (GFileInfo *info,
636 const char *attribute);
637 guint64 g_file_info_get_attribute_uint64 (GFileInfo *info,
638 const char *attribute);
639 gint64 g_file_info_get_attribute_int64 (GFileInfo *info,
640 const char *attribute);
641 GObject * g_file_info_get_attribute_object (GFileInfo *info,
642 const char *attribute);
644 void g_file_info_set_attribute (GFileInfo *info,
645 const char *attribute,
646 const GFileAttributeValue *attr_value);
647 void g_file_info_set_attribute_string (GFileInfo *info,
648 const char *attribute,
649 const char *attr_value);
650 void g_file_info_set_attribute_byte_string (GFileInfo *info,
651 const char *attribute,
652 const char *attr_value);
653 void g_file_info_set_attribute_boolean (GFileInfo *info,
654 const char *attribute,
655 gboolean attr_value);
656 void g_file_info_set_attribute_uint32 (GFileInfo *info,
657 const char *attribute,
659 void g_file_info_set_attribute_int32 (GFileInfo *info,
660 const char *attribute,
662 void g_file_info_set_attribute_uint64 (GFileInfo *info,
663 const char *attribute,
665 void g_file_info_set_attribute_int64 (GFileInfo *info,
666 const char *attribute,
668 void g_file_info_set_attribute_object (GFileInfo *info,
669 const char *attribute,
670 GObject *attr_value);
672 void g_file_info_clear_status (GFileInfo *info);
674 /* Helper getters: */
675 GFileType g_file_info_get_file_type (GFileInfo *info);
676 gboolean g_file_info_get_is_hidden (GFileInfo *info);
677 gboolean g_file_info_get_is_backup (GFileInfo *info);
678 gboolean g_file_info_get_is_symlink (GFileInfo *info);
679 const char * g_file_info_get_name (GFileInfo *info);
680 const char * g_file_info_get_display_name (GFileInfo *info);
681 const char * g_file_info_get_edit_name (GFileInfo *info);
682 GIcon * g_file_info_get_icon (GFileInfo *info);
683 const char * g_file_info_get_content_type (GFileInfo *info);
684 goffset g_file_info_get_size (GFileInfo *info);
685 void g_file_info_get_modification_time (GFileInfo *info,
687 const char * g_file_info_get_symlink_target (GFileInfo *info);
688 const char * g_file_info_get_etag (GFileInfo *info);
689 gint32 g_file_info_get_sort_order (GFileInfo *info);
691 void g_file_info_set_attribute_mask (GFileInfo *info,
692 GFileAttributeMatcher *mask);
693 void g_file_info_unset_attribute_mask (GFileInfo *info);
695 /* Helper setters: */
696 void g_file_info_set_file_type (GFileInfo *info,
698 void g_file_info_set_is_hidden (GFileInfo *info,
700 void g_file_info_set_is_symlink (GFileInfo *info,
701 gboolean is_symlink);
702 void g_file_info_set_name (GFileInfo *info,
704 void g_file_info_set_display_name (GFileInfo *info,
705 const char *display_name);
706 void g_file_info_set_edit_name (GFileInfo *info,
707 const char *edit_name);
708 void g_file_info_set_icon (GFileInfo *info,
710 void g_file_info_set_content_type (GFileInfo *info,
711 const char *content_type);
712 void g_file_info_set_size (GFileInfo *info,
714 void g_file_info_set_modification_time (GFileInfo *info,
716 void g_file_info_set_symlink_target (GFileInfo *info,
717 const char *symlink_target);
718 void g_file_info_set_sort_order (GFileInfo *info,
721 GFileAttributeMatcher *g_file_attribute_matcher_new (const char *attributes);
722 GFileAttributeMatcher *g_file_attribute_matcher_ref (GFileAttributeMatcher *matcher);
723 void g_file_attribute_matcher_unref (GFileAttributeMatcher *matcher);
724 gboolean g_file_attribute_matcher_matches (GFileAttributeMatcher *matcher,
725 const char *attribute);
726 gboolean g_file_attribute_matcher_matches_only (GFileAttributeMatcher *matcher,
727 const char *attribute);
728 gboolean g_file_attribute_matcher_enumerate_namespace (GFileAttributeMatcher *matcher,
730 const char * g_file_attribute_matcher_enumerate_next (GFileAttributeMatcher *matcher);
735 #endif /* __G_FILE_INFO_H__ */