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
62 * @G_FILE_TYPE_SPECIAL: File is a "special" file, such as a socket, fifo,
63 * block device, or character device.
64 * @G_FILE_TYPE_SHORTCUT: File is a shortcut (Windows systems).
65 * @G_FILE_TYPE_MOUNTABLE: File is a mountable location.
67 * Indicates the file's on-disk type.
70 G_FILE_TYPE_UNKNOWN = 0,
72 G_FILE_TYPE_DIRECTORY,
73 G_FILE_TYPE_SYMBOLIC_LINK,
74 G_FILE_TYPE_SPECIAL, /* socket, fifo, blockdev, chardev */
79 /* Common Attributes: */
81 * G_FILE_ATTRIBUTE_STD_TYPE:
83 * A key in the "std" namespace for storing file types.
84 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
85 * The value for this key should contain a #GFileType.
87 #define G_FILE_ATTRIBUTE_STD_TYPE "std:type" /* uint32 (GFileType) */
90 * G_FILE_ATTRIBUTE_STD_IS_HIDDEN:
92 * A key in the "std" namespace for checking if a file is hidden.
93 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
95 #define G_FILE_ATTRIBUTE_STD_IS_HIDDEN "std:is_hidden" /* boolean */
98 * G_FILE_ATTRIBUTE_STD_IS_BACKUP:
100 * A key in the "std" namespace for checking if a file is a backup file.
101 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
103 #define G_FILE_ATTRIBUTE_STD_IS_BACKUP "std:is_backup" /* boolean */
106 * G_FILE_ATTRIBUTE_STD_IS_SYMLINK:
108 * A key in the "std" namespace for checking if the file is a symlink.
109 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
111 #define G_FILE_ATTRIBUTE_STD_IS_SYMLINK "std:is_symlink" /* boolean */
114 * G_FILE_ATTRIBUTE_STD_IS_VIRTUAL:
116 * A key in the "std" namespace for checking if a file is virtual.
117 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
119 #define G_FILE_ATTRIBUTE_STD_IS_VIRTUAL "std:is_virtual" /* boolean */
122 * G_FILE_ATTRIBUTE_STD_NAME:
124 * A key in the "std" namespace for getting the name of the file.
125 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
127 #define G_FILE_ATTRIBUTE_STD_NAME "std:name" /* byte string */
130 * G_FILE_ATTRIBUTE_STD_DISPLAY_NAME:
132 * A key in the "std" namespace for getting the display name of the file.
133 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
135 #define G_FILE_ATTRIBUTE_STD_DISPLAY_NAME "std:display_name" /* string */
138 * G_FILE_ATTRIBUTE_STD_EDIT_NAME:
140 * A key in the "std" namespace for edit name of the file.
141 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
143 #define G_FILE_ATTRIBUTE_STD_EDIT_NAME "std:edit_name" /* string */
146 * G_FILE_ATTRIBUTE_STD_COPY_NAME:
148 * A key in the "std" namespace for getting the copy name of the file.
149 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
151 #define G_FILE_ATTRIBUTE_STD_COPY_NAME "std:copy_name" /* string */
154 * G_FILE_ATTRIBUTE_STD_ICON:
156 * A key in the "std" namespace for getting the icon for the file.
157 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_OBJECT.
158 * The value for this key should contain a #GIcon.
160 #define G_FILE_ATTRIBUTE_STD_ICON "std:icon" /* object (GIcon) */
163 * G_FILE_ATTRIBUTE_STD_CONTENT_TYPE:
165 * A key in the "std" namespace for getting the content type of the file.
166 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
167 * The value for this key should contain a valid content type.
169 #define G_FILE_ATTRIBUTE_STD_CONTENT_TYPE "std:content_type" /* string */
172 * G_FILE_ATTRIBUTE_STD_FAST_CONTENT_TYPE:
174 * A key in the "std" namespace for getting the fast content type.
175 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
178 #define G_FILE_ATTRIBUTE_STD_FAST_CONTENT_TYPE "std:fast_content_type" /* string */
181 * G_FILE_ATTRIBUTE_STD_SIZE:
183 * A key in the "std" namespace for getting the file's size.
184 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
186 #define G_FILE_ATTRIBUTE_STD_SIZE "std:size" /* uint64 */
189 * G_FILE_ATTRIBUTE_STD_SYMLINK_TARGET:
191 * A key in the "std" namespace for getting the symlink target, if the file
192 * is a symlink. Corresponding #GFileAttributeType is
193 * %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
195 #define G_FILE_ATTRIBUTE_STD_SYMLINK_TARGET "std:symlink_target" /* byte string */
198 * G_FILE_ATTRIBUTE_STD_TARGET_URI:
200 * A key in the "std" namespace for getting the target URI for the file.
201 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
203 #define G_FILE_ATTRIBUTE_STD_TARGET_URI "std:target_uri" /* string */
206 * G_FILE_ATTRIBUTE_STD_SORT_ORDER:
208 * A key in the "std" namespace for setting the sort order of a file.
209 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_INT32.
210 * An example use would be in file managers, which would use this key
211 * to set the order files are displayed.
213 #define G_FILE_ATTRIBUTE_STD_SORT_ORDER "std:sort_order" /* int32 */
215 /* Entity tags, used to avoid missing updates on save */
218 * G_FILE_ATTRIBUTE_ETAG_VALUE:
220 * A key in the "etag" namespace for getting the value of the file's
221 * entity tag. Corresponding #GFileAttributeType is
222 * %G_FILE_ATTRIBUTE_TYPE_STRING.
224 #define G_FILE_ATTRIBUTE_ETAG_VALUE "etag:value" /* string */
226 /* File identifier, for e.g. avoiding loops when doing recursive
231 * G_FILE_ATTRIBUTE_ID_FILE:
233 * A key in the "id" namespace for getting a file identifier.
234 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
235 * An example use would be during listing files, to avoid recursive
236 * directory scanning.
238 #define G_FILE_ATTRIBUTE_ID_FILE "id:file" /* string */
241 * G_FILE_ATTRIBUTE_ID_FS:
243 * A key in the "id" namespace for getting the file system identifier.
244 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
245 * An example use would be during listing files, to avoid recursive
246 * directory scanning.
248 #define G_FILE_ATTRIBUTE_ID_FS "id:fs" /* string */
250 /* Calculated Access Rights for current user */
253 * G_FILE_ATTRIBUTE_ACCESS_CAN_READ:
255 * A key in the "access" namespace for getting read privileges.
256 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
257 * This attribute will be %TRUE if the user is able to read the file.
259 #define G_FILE_ATTRIBUTE_ACCESS_CAN_READ "access:can_read" /* boolean */
262 * G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE:
264 * A key in the "access" namespace for getting write privileges.
265 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
266 * This attribute will be %TRUE if the user is able to write to the file.
268 #define G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE "access:can_write" /* boolean */
271 * G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE:
273 * A key in the "access" namespace for getting execution privileges.
274 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
275 * This attribute will be %TRUE if the user is able to execute the file.
277 #define G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE "access:can_execute" /* boolean */
280 * G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE:
282 * A key in the "access" namespace for checking deletion privileges.
283 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
284 * This attribute will be %TRUE if the user is able to delete the file.
286 #define G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE "access:can_delete" /* boolean */
289 * G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH:
291 * A key in the "access" namespace for checking trashing privileges.
292 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
293 * This attribute will be %TRUE if the user is able to send the file to
294 * the virtual file system trash location.
296 #define G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH "access:can_trash" /* boolean */
299 * G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME:
301 * A key in the "access" namespace for checking renaming privileges.
302 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
303 * This attribute will be %TRUE if the user is able to rename the file.
305 #define G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME "access:can_rename" /* boolean */
307 /* TODO: Should we have special version for directories? can_enumerate, etc */
309 /* Mountable attributes */
312 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT:
314 * A key in the "mountable" namespace for checking if a file is mountable.
315 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
317 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT "mountable:can_mount" /* boolean */
320 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT:
322 * A key in the "mountable" namespace for checking if a file is unmountable.
323 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
325 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT "mountable:can_unmount" /* boolean */
328 * G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT:
330 * A key in the "mountable" namespace for checking if a file can be ejected.
331 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
333 #define G_FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT "mountable:can_eject" /* boolean */
336 * G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE:
338 * A key in the "mountable" namespace for getting the unix device.
339 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
341 #define G_FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE "mountable:unix_device" /* uint32 */
344 * G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI:
346 * A key in the "mountable" namespace for getting the HAL UDI for the mounted
347 * file. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
349 #define G_FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI "mountable:hal_udi" /* string */
351 /* Time attributes */
354 * G_FILE_ATTRIBUTE_TIME_MODIFIED:
356 * A key in the "time" namespace for getting the time the file was last
357 * modified. Corresponding #GFileAttributeType is
358 * %G_FILE_ATTRIBUTE_TYPE_UINT64, and contains the UNIX time since the
361 #define G_FILE_ATTRIBUTE_TIME_MODIFIED "time:modified" /* uint64 */
364 * G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC:
366 * A key in the "time" namespace for getting the milliseconds of the time
367 * the file was last modified. This should be used in conjunction with
368 * #G_FILE_ATTRIBUTE_TIME_MODIFIED. Corresponding #GFileAttributeType is
369 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
371 #define G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC "time:modified_usec" /* uint32 */
374 * G_FILE_ATTRIBUTE_TIME_ACCESS:
376 * A key in the "time" namespace for getting the time the file was last
377 * accessed. Corresponding #GFileAttributeType is
378 * %G_FILE_ATTRIBUTE_TYPE_UINT64, and contains the UNIX time since the
379 * file was last accessed.
381 #define G_FILE_ATTRIBUTE_TIME_ACCESS "time:access" /* uint64 */
384 * G_FILE_ATTRIBUTE_TIME_ACCESS_USEC:
386 * A key in the "time" namespace for getting the milliseconds of the time
387 * the file was last accessed. This should be used in conjunction with
388 * #G_FILE_ATTRIBUTE_TIME_ACCESS. Corresponding #GFileAttributeType is
389 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
391 #define G_FILE_ATTRIBUTE_TIME_ACCESS_USEC "time:access_usec" /* uint32 */
394 * G_FILE_ATTRIBUTE_TIME_CHANGED:
396 * A key in the "time" namespace for getting the time the file was last
397 * changed. Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64,
398 * and contains the UNIX time since the file was last changed.
400 * This corresponds to the traditional UNIX ctime.
402 #define G_FILE_ATTRIBUTE_TIME_CHANGED "time:changed" /* uint64 */
405 * G_FILE_ATTRIBUTE_TIME_CHANGED_USEC:
407 * A key in the "time" namespace for getting the milliseconds of the time
408 * the file was last changed. This should be used in conjunction with
409 * #G_FILE_ATTRIBUTE_TIME_CHANGED. Corresponding #GFileAttributeType is
410 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
412 #define G_FILE_ATTRIBUTE_TIME_CHANGED_USEC "time:changed_usec" /* uint32 */
415 * G_FILE_ATTRIBUTE_TIME_CREATED:
417 * A key in the "time" namespace for getting the time the file was created.
418 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64,
419 * and contains the UNIX time since the file was created.
421 * This corresponds to the NTFS ctime.
423 #define G_FILE_ATTRIBUTE_TIME_CREATED "time:created" /* uint64 */
426 * G_FILE_ATTRIBUTE_TIME_CREATED_USEC:
428 * A key in the "time" namespace for getting the milliseconds of the time
429 * the file was created. This should be used in conjunction with
430 * #G_FILE_ATTRIBUTE_TIME_CREATED. Corresponding #GFileAttributeType is
431 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
433 #define G_FILE_ATTRIBUTE_TIME_CREATED_USEC "time:created_usec" /* uint32 */
435 /* Unix specific attributes */
438 * G_FILE_ATTRIBUTE_UNIX_DEVICE:
440 * A key in the "unix" namespace for getting the device id of the device the
441 * file is located on (see stat() documentation). This attribute is only
442 * available for UNIX file systems. Corresponding #GFileAttributeType is
443 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
445 #define G_FILE_ATTRIBUTE_UNIX_DEVICE "unix:device" /* uint32 */
448 * G_FILE_ATTRIBUTE_UNIX_INODE:
450 * A key in the "unix" namespace for getting the inode of the file.
451 * This attribute is only available for UNIX file systems. Corresponding
452 * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
454 #define G_FILE_ATTRIBUTE_UNIX_INODE "unix:inode" /* uint64 */
457 * G_FILE_ATTRIBUTE_UNIX_MODE:
459 * A key in the "unix" namespace for getting the mode of the file
460 * (e.g. whether the file is a regular file, symlink, etc). See lstat()
461 * documentation. This attribute is only available for UNIX file systems.
462 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
464 #define G_FILE_ATTRIBUTE_UNIX_MODE "unix:mode" /* uint32 */
467 * G_FILE_ATTRIBUTE_UNIX_NLINK:
469 * A key in the "unix" namespace for getting the number of hard links
470 * for a file. See lstat() documentation. This attribute is only available
471 * for UNIX file systems. Corresponding #GFileAttributeType is
472 * %G_FILE_ATTRIBUTE_TYPE_UINT32.
474 #define G_FILE_ATTRIBUTE_UNIX_NLINK "unix:nlink" /* uint32 */
477 * G_FILE_ATTRIBUTE_UNIX_UID:
479 * A key in the "unix" namespace for getting the user ID for the file.
480 * This attribute is only available for UNIX file systems.
481 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
483 #define G_FILE_ATTRIBUTE_UNIX_UID "unix:uid" /* uint32 */
486 * G_FILE_ATTRIBUTE_UNIX_GID:
488 * A key in the "unix" namespace for getting the group ID for the file.
489 * This attribute is only available for UNIX file systems.
490 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
492 #define G_FILE_ATTRIBUTE_UNIX_GID "unix:gid" /* uint32 */
495 * G_FILE_ATTRIBUTE_UNIX_RDEV:
497 * A key in the "unix" namespace for getting the device ID for the file
498 * (if it is a special file). See lstat() documentation. This attribute
499 * is only available for UNIX file systems. Corresponding #GFileAttributeType
500 * is %G_FILE_ATTRIBUTE_TYPE_UINT32.
502 #define G_FILE_ATTRIBUTE_UNIX_RDEV "unix:rdev" /* uint32 */
505 * G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE:
507 * A key in the "unix" namespace for getting the block size for the file
508 * system. This attribute is only available for UNIX file systems.
509 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT32.
511 #define G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE "unix:block_size" /* uint32 */
514 * G_FILE_ATTRIBUTE_UNIX_BLOCKS:
516 * A key in the "unix" namespace for getting the number of blocks allocated
517 * for the file. This attribute is only available for UNIX file systems.
518 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_UINT64.
520 #define G_FILE_ATTRIBUTE_UNIX_BLOCKS "unix:blocks" /* uint64 */
523 * G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT:
525 * A key in the "unix" namespace for checking if the file represents a
526 * UNIX mount point. This attribute is %TRUE if the file is a UNIX mount
527 * point. This attribute is only available for UNIX file systems.
528 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
530 #define G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT "unix:is_mountpoint" /* boolean */
532 /* DOS specific attributes */
535 * G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE:
537 * A key in the "dos" namespace for checking if the file's archive flag
538 * is set. This attribute is %TRUE if the archive flag is set. This attribute
539 * is only available for DOS file systems. Corresponding #GFileAttributeType
540 * is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
542 #define G_FILE_ATTRIBUTE_DOS_IS_ARCHIVE "dos:is_archive" /* boolean */
545 * G_FILE_ATTRIBUTE_DOS_IS_SYSTEM:
547 * A key in the "dos" namespace for checking if the file's backup flag
548 * is set. This attribute is %TRUE if the backup flag is set. This attribute
549 * is only available for DOS file systems. Corresponding #GFileAttributeType
550 * is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
552 #define G_FILE_ATTRIBUTE_DOS_IS_SYSTEM "dos:is_system" /* boolean */
554 /* Owner attributes */
557 * G_FILE_ATTRIBUTE_OWNER_USER:
559 * A key in the "owner" namespace for getting the user name of the
560 * file's owner. Corresponding #GFileAttributeType is
561 * %G_FILE_ATTRIBUTE_TYPE_STRING.
563 #define G_FILE_ATTRIBUTE_OWNER_USER "owner:user" /* string */
566 * G_FILE_ATTRIBUTE_OWNER_USER_REAL:
568 * A key in the "owner" namespace for getting the real name of the
569 * user that owns the file. Corresponding #GFileAttributeType is
570 * %G_FILE_ATTRIBUTE_TYPE_STRING.
572 #define G_FILE_ATTRIBUTE_OWNER_USER_REAL "owner:user_real" /* string */
575 * G_FILE_ATTRIBUTE_OWNER_GROUP:
577 * A key in the "owner" namespace for getting the file owner's group.
578 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
580 #define G_FILE_ATTRIBUTE_OWNER_GROUP "owner:group" /* string */
585 * G_FILE_ATTRIBUTE_THUMBNAIL_PATH:
587 * A key in the "thumbnail" namespace for getting the path to the thumbnail
588 * image. Corresponding #GFileAttributeType is
589 * %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING.
591 #define G_FILE_ATTRIBUTE_THUMBNAIL_PATH "thumbnail:path" /* bytestring */
593 * G_FILE_ATTRIBUTE_THUMBNAIL_THUMNAILING_FAILED:
595 * A key in the "thumbnail" namespace for checking if thumbnailing failed.
596 * This attribute is %TRUE if thumbnailing failed. Corresponding
597 * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
599 #define G_FILE_ATTRIBUTE_THUMBNAILING_FAILED "thumbnail:failed" /* boolean */
601 /* File system info (for g_file_get_filesystem_info) */
604 * G_FILE_ATTRIBUTE_FS_SIZE:
606 * A key in the "fs" namespace for getting the size of the file system,
607 * used in g_file_get_filesystem_info(). Corresponding #GFileAttributeType
608 * is %G_FILE_ATTRIBUTE_TYPE_UINT64.
610 #define G_FILE_ATTRIBUTE_FS_SIZE "fs:size" /* uint64 */
613 * G_FILE_ATTRIBUTE_FS_FREE:
615 * A key in the "fs" namespace for getting the free space left on the
616 * file system. Corresponding #GFileAttributeType is
617 * %G_FILE_ATTRIBUTE_TYPE_UINT64.
619 #define G_FILE_ATTRIBUTE_FS_FREE "fs:free" /* uint64 */
622 * G_FILE_ATTRIBUTE_FS_TYPE:
624 * A key in the "fs" namespace for getting the file system's type.
625 * Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_STRING.
627 #define G_FILE_ATTRIBUTE_FS_TYPE "fs:type" /* string */
630 * G_FILE_ATTRIBUTE_FS_READONLY:
632 * A key in the "fs" namespace for checking if the file system is read only.
633 * Is set to %TRUE if the file system is read only. Corresponding
634 * #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
636 #define G_FILE_ATTRIBUTE_FS_READONLY "fs:readonly" /* boolean */
639 * G_FILE_ATTRIBUTE_GVFS_BACKEND:
641 * A key in the "gvfs" namespace that gets the name of the current
642 * GVFS backend in use. Corresponding #GFileAttributeType is
643 * %G_FILE_ATTRIBUTE_TYPE_STRING.
645 #define G_FILE_ATTRIBUTE_GVFS_BACKEND "gvfs:backend" /* string */
647 GType g_file_info_get_type (void) G_GNUC_CONST;
649 GFileInfo * g_file_info_new (void);
650 GFileInfo * g_file_info_dup (GFileInfo *other);
651 void g_file_info_copy_into (GFileInfo *src_info,
652 GFileInfo *dest_info);
653 gboolean g_file_info_has_attribute (GFileInfo *info,
654 const char *attribute);
655 char ** g_file_info_list_attributes (GFileInfo *info,
656 const char *name_space);
657 GFileAttributeType g_file_info_get_attribute_type (GFileInfo *info,
658 const char *attribute);
659 void g_file_info_remove_attribute (GFileInfo *info,
660 const char *attribute);
661 GFileAttributeValue * g_file_info_get_attribute (GFileInfo *info,
662 const char *attribute);
663 const char * g_file_info_get_attribute_string (GFileInfo *info,
664 const char *attribute);
665 const char * g_file_info_get_attribute_byte_string (GFileInfo *info,
666 const char *attribute);
667 gboolean g_file_info_get_attribute_boolean (GFileInfo *info,
668 const char *attribute);
669 guint32 g_file_info_get_attribute_uint32 (GFileInfo *info,
670 const char *attribute);
671 gint32 g_file_info_get_attribute_int32 (GFileInfo *info,
672 const char *attribute);
673 guint64 g_file_info_get_attribute_uint64 (GFileInfo *info,
674 const char *attribute);
675 gint64 g_file_info_get_attribute_int64 (GFileInfo *info,
676 const char *attribute);
677 GObject * g_file_info_get_attribute_object (GFileInfo *info,
678 const char *attribute);
680 void g_file_info_set_attribute (GFileInfo *info,
681 const char *attribute,
682 const GFileAttributeValue *attr_value);
683 void g_file_info_set_attribute_string (GFileInfo *info,
684 const char *attribute,
685 const char *attr_value);
686 void g_file_info_set_attribute_byte_string (GFileInfo *info,
687 const char *attribute,
688 const char *attr_value);
689 void g_file_info_set_attribute_boolean (GFileInfo *info,
690 const char *attribute,
691 gboolean attr_value);
692 void g_file_info_set_attribute_uint32 (GFileInfo *info,
693 const char *attribute,
695 void g_file_info_set_attribute_int32 (GFileInfo *info,
696 const char *attribute,
698 void g_file_info_set_attribute_uint64 (GFileInfo *info,
699 const char *attribute,
701 void g_file_info_set_attribute_int64 (GFileInfo *info,
702 const char *attribute,
704 void g_file_info_set_attribute_object (GFileInfo *info,
705 const char *attribute,
706 GObject *attr_value);
708 void g_file_info_clear_status (GFileInfo *info);
710 /* Helper getters: */
711 GFileType g_file_info_get_file_type (GFileInfo *info);
712 gboolean g_file_info_get_is_hidden (GFileInfo *info);
713 gboolean g_file_info_get_is_backup (GFileInfo *info);
714 gboolean g_file_info_get_is_symlink (GFileInfo *info);
715 const char * g_file_info_get_name (GFileInfo *info);
716 const char * g_file_info_get_display_name (GFileInfo *info);
717 const char * g_file_info_get_edit_name (GFileInfo *info);
718 GIcon * g_file_info_get_icon (GFileInfo *info);
719 const char * g_file_info_get_content_type (GFileInfo *info);
720 goffset g_file_info_get_size (GFileInfo *info);
721 void g_file_info_get_modification_time (GFileInfo *info,
723 const char * g_file_info_get_symlink_target (GFileInfo *info);
724 const char * g_file_info_get_etag (GFileInfo *info);
725 gint32 g_file_info_get_sort_order (GFileInfo *info);
727 void g_file_info_set_attribute_mask (GFileInfo *info,
728 GFileAttributeMatcher *mask);
729 void g_file_info_unset_attribute_mask (GFileInfo *info);
731 /* Helper setters: */
732 void g_file_info_set_file_type (GFileInfo *info,
734 void g_file_info_set_is_hidden (GFileInfo *info,
736 void g_file_info_set_is_symlink (GFileInfo *info,
737 gboolean is_symlink);
738 void g_file_info_set_name (GFileInfo *info,
740 void g_file_info_set_display_name (GFileInfo *info,
741 const char *display_name);
742 void g_file_info_set_edit_name (GFileInfo *info,
743 const char *edit_name);
744 void g_file_info_set_icon (GFileInfo *info,
746 void g_file_info_set_content_type (GFileInfo *info,
747 const char *content_type);
748 void g_file_info_set_size (GFileInfo *info,
750 void g_file_info_set_modification_time (GFileInfo *info,
752 void g_file_info_set_symlink_target (GFileInfo *info,
753 const char *symlink_target);
754 void g_file_info_set_sort_order (GFileInfo *info,
757 GFileAttributeMatcher *g_file_attribute_matcher_new (const char *attributes);
758 GFileAttributeMatcher *g_file_attribute_matcher_ref (GFileAttributeMatcher *matcher);
759 void g_file_attribute_matcher_unref (GFileAttributeMatcher *matcher);
760 gboolean g_file_attribute_matcher_matches (GFileAttributeMatcher *matcher,
761 const char *attribute);
762 gboolean g_file_attribute_matcher_matches_only (GFileAttributeMatcher *matcher,
763 const char *attribute);
764 gboolean g_file_attribute_matcher_enumerate_namespace (GFileAttributeMatcher *matcher,
766 const char * g_file_attribute_matcher_enumerate_next (GFileAttributeMatcher *matcher);
771 #endif /* __G_FILE_INFO_H__ */