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_ATTRIBUTE_H__
24 #define __G_FILE_ATTRIBUTE_H__
26 #include <glib-object.h>
31 G_FILE_ATTRIBUTE_TYPE_INVALID = 0,
32 G_FILE_ATTRIBUTE_TYPE_STRING,
33 G_FILE_ATTRIBUTE_TYPE_BYTE_STRING, /* zero terminated string of non-zero bytes */
34 G_FILE_ATTRIBUTE_TYPE_BOOLEAN,
35 G_FILE_ATTRIBUTE_TYPE_UINT32,
36 G_FILE_ATTRIBUTE_TYPE_INT32,
37 G_FILE_ATTRIBUTE_TYPE_UINT64,
38 G_FILE_ATTRIBUTE_TYPE_INT64,
39 G_FILE_ATTRIBUTE_TYPE_OBJECT
43 G_FILE_ATTRIBUTE_FLAGS_NONE = 0,
44 G_FILE_ATTRIBUTE_FLAGS_COPY_WITH_FILE = 1 << 0,
45 G_FILE_ATTRIBUTE_FLAGS_COPY_WHEN_MOVED = 1 << 1
46 } GFileAttributeFlags;
48 /* Used by g_file_set_attributes_from_info */
50 G_FILE_ATTRIBUTE_STATUS_UNSET = 0,
51 G_FILE_ATTRIBUTE_STATUS_SET,
52 G_FILE_ATTRIBUTE_STATUS_ERROR_SETTING
53 } GFileAttributeStatus;
55 #define G_FILE_ATTRIBUTE_VALUE_INIT {0}
58 GFileAttributeType type : 8;
59 GFileAttributeStatus status : 8;
70 } GFileAttributeValue;
74 GFileAttributeType type;
75 GFileAttributeFlags flags;
79 GFileAttributeInfo *infos;
81 } GFileAttributeInfoList;
83 GFileAttributeValue *g_file_attribute_value_new (void);
84 void g_file_attribute_value_free (GFileAttributeValue *attr);
85 void g_file_attribute_value_clear (GFileAttributeValue *attr);
86 void g_file_attribute_value_set (GFileAttributeValue *attr,
87 const GFileAttributeValue *new_value);
88 GFileAttributeValue *g_file_attribute_value_dup (const GFileAttributeValue *other);
90 char * g_file_attribute_value_as_string (const GFileAttributeValue *attr);
92 const char * g_file_attribute_value_get_string (const GFileAttributeValue *attr);
93 const char * g_file_attribute_value_get_byte_string (const GFileAttributeValue *attr);
94 gboolean g_file_attribute_value_get_boolean (const GFileAttributeValue *attr);
95 guint32 g_file_attribute_value_get_uint32 (const GFileAttributeValue *attr);
96 gint32 g_file_attribute_value_get_int32 (const GFileAttributeValue *attr);
97 guint64 g_file_attribute_value_get_uint64 (const GFileAttributeValue *attr);
98 gint64 g_file_attribute_value_get_int64 (const GFileAttributeValue *attr);
99 GObject * g_file_attribute_value_get_object (const GFileAttributeValue *attr);
101 void g_file_attribute_value_set_string (GFileAttributeValue *attr,
103 void g_file_attribute_value_set_byte_string (GFileAttributeValue *attr,
105 void g_file_attribute_value_set_boolean (GFileAttributeValue *attr,
107 void g_file_attribute_value_set_uint32 (GFileAttributeValue *attr,
109 void g_file_attribute_value_set_int32 (GFileAttributeValue *attr,
111 void g_file_attribute_value_set_uint64 (GFileAttributeValue *attr,
113 void g_file_attribute_value_set_int64 (GFileAttributeValue *attr,
115 void g_file_attribute_value_set_object (GFileAttributeValue *attr,
118 GFileAttributeInfoList * g_file_attribute_info_list_new (void);
119 GFileAttributeInfoList * g_file_attribute_info_list_ref (GFileAttributeInfoList *list);
120 void g_file_attribute_info_list_unref (GFileAttributeInfoList *list);
121 GFileAttributeInfoList * g_file_attribute_info_list_dup (GFileAttributeInfoList *list);
122 const GFileAttributeInfo *g_file_attribute_info_list_lookup (GFileAttributeInfoList *list,
124 void g_file_attribute_info_list_add (GFileAttributeInfoList *list,
126 GFileAttributeType type,
127 GFileAttributeFlags flags);
132 #endif /* __G_FILE_INFO_H__ */