gio/auto/file_info.rs
1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// DO NOT EDIT
4#![allow(deprecated)]
5
6use crate::{FileAttributeMatcher, FileAttributeStatus, FileAttributeType, FileType, Icon, ffi};
7use glib::{prelude::*, translate::*};
8
9glib::wrapper! {
10 /// Stores information about a file system object referenced by a [`File`][crate::File].
11 ///
12 /// Functionality for manipulating basic metadata for files. `GFileInfo`
13 /// implements methods for getting information that all files should
14 /// contain, and allows for manipulation of extended attributes.
15 ///
16 /// See the [file attributes](file-attributes.html) document for more
17 /// information on how GIO handles file attributes.
18 ///
19 /// To obtain a `GFileInfo` for a [`File`][crate::File], use
20 /// [`FileExt::query_info()`][crate::prelude::FileExt::query_info()] (or its async variant). To obtain a `GFileInfo`
21 /// for a file input or output stream, use [`FileInputStreamExt::query_info()`][crate::prelude::FileInputStreamExt::query_info()]
22 /// or [`FileOutputStreamExt::query_info()`][crate::prelude::FileOutputStreamExt::query_info()] (or their async variants).
23 ///
24 /// To change the actual attributes of a file, you should then set the
25 /// attribute in the `GFileInfo` and call [`FileExt::set_attributes_from_info()`][crate::prelude::FileExt::set_attributes_from_info()]
26 /// or [`FileExt::set_attributes_async()`][crate::prelude::FileExt::set_attributes_async()] on a `GFile`.
27 ///
28 /// However, not all attributes can be changed in the file. For instance,
29 /// the actual size of a file cannot be changed via [`set_size()`][Self::set_size()].
30 /// You may call [`FileExt::query_settable_attributes()`][crate::prelude::FileExt::query_settable_attributes()] and
31 /// [`FileExt::query_writable_namespaces()`][crate::prelude::FileExt::query_writable_namespaces()] to discover the settable attributes
32 /// of a particular file at runtime.
33 ///
34 /// The direct accessors, such as [`name()`][Self::name()], are slightly more
35 /// optimized than the generic attribute accessors, such as
36 /// [`attribute_byte_string()`][Self::attribute_byte_string()].This optimization will matter
37 /// only if calling the API in a tight loop.
38 ///
39 /// It is an error to call these accessors without specifying their required file
40 /// attributes when creating the `GFileInfo`. Use
41 /// [`has_attribute()`][Self::has_attribute()] or [`list_attributes()`][Self::list_attributes()]
42 /// to check what attributes are specified for a `GFileInfo`.
43 ///
44 /// [`FileAttributeMatcher`][crate::FileAttributeMatcher] allows for searching through a `GFileInfo`
45 /// for attributes.
46 ///
47 /// # Implements
48 ///
49 /// [`trait@glib::ObjectExt`]
50 #[doc(alias = "GFileInfo")]
51 pub struct FileInfo(Object<ffi::GFileInfo, ffi::GFileInfoClass>);
52
53 match fn {
54 type_ => || ffi::g_file_info_get_type(),
55 }
56}
57
58impl FileInfo {
59 /// Creates a new file info structure.
60 ///
61 /// # Returns
62 ///
63 /// a #GFileInfo.
64 #[doc(alias = "g_file_info_new")]
65 pub fn new() -> FileInfo {
66 unsafe { from_glib_full(ffi::g_file_info_new()) }
67 }
68
69 /// Clears the status information from @self.
70 #[doc(alias = "g_file_info_clear_status")]
71 pub fn clear_status(&self) {
72 unsafe {
73 ffi::g_file_info_clear_status(self.to_glib_none().0);
74 }
75 }
76
77 /// First clears all of the [GFileAttribute](file-attributes.html#file-attributes) of
78 /// @dest_info, and then copies all of the file attributes from @self to @dest_info.
79 /// ## `dest_info`
80 /// destination to copy attributes to.
81 #[doc(alias = "g_file_info_copy_into")]
82 pub fn copy_into(&self, dest_info: &FileInfo) {
83 unsafe {
84 ffi::g_file_info_copy_into(self.to_glib_none().0, dest_info.to_glib_none().0);
85 }
86 }
87
88 /// Duplicates a file info structure.
89 ///
90 /// # Returns
91 ///
92 /// a duplicate #GFileInfo of @self.
93 #[doc(alias = "g_file_info_dup")]
94 #[must_use]
95 pub fn dup(&self) -> FileInfo {
96 unsafe { from_glib_full(ffi::g_file_info_dup(self.to_glib_none().0)) }
97 }
98
99 /// Gets the access time of the current @self and returns it as a
100 /// #GDateTime.
101 ///
102 /// It is an error to call this if the #GFileInfo does not contain
103 /// [`FILE_ATTRIBUTE_TIME_ACCESS`][crate::FILE_ATTRIBUTE_TIME_ACCESS]. If [`FILE_ATTRIBUTE_TIME_ACCESS_USEC`][crate::FILE_ATTRIBUTE_TIME_ACCESS_USEC] is
104 /// provided, the resulting #GDateTime will additionally have microsecond
105 /// precision.
106 ///
107 /// If nanosecond precision is needed, [`FILE_ATTRIBUTE_TIME_ACCESS_NSEC`][crate::FILE_ATTRIBUTE_TIME_ACCESS_NSEC] must
108 /// be queried separately using g_file_info_get_attribute_uint32().
109 ///
110 /// # Returns
111 ///
112 /// access time, or [`None`] if unknown
113 #[cfg(feature = "v2_70")]
114 #[cfg_attr(docsrs, doc(cfg(feature = "v2_70")))]
115 #[doc(alias = "g_file_info_get_access_date_time")]
116 #[doc(alias = "get_access_date_time")]
117 pub fn access_date_time(&self) -> Option<glib::DateTime> {
118 unsafe { from_glib_full(ffi::g_file_info_get_access_date_time(self.to_glib_none().0)) }
119 }
120
121 /// Gets the value of an attribute, formatted as a human readable string.
122 ///
123 /// This escapes things as needed to make the string valid UTF-8 and readable by
124 /// humans. It’s not meant to be a machine readable or reversible escaping
125 /// format.
126 ///
127 /// To format file name attributes of type
128 /// [enum@Gio.FileAttributeType.BYTE_STRING] for output as UTF-8, use
129 /// `filename_to_utf8()` instead:
130 /// **⚠️ The following code is in c ⚠️**
131 ///
132 /// ```c
133 /// const char *trash_orig_path_byte_string;
134 /// g_autofree char *trash_orig_path_utf8 = NULL;
135 ///
136 /// trash_orig_path_byte_string = g_file_info_get_attribute_byte_string (info, G_FILE_ATTRIBUTE_TRASH_ORIG_PATH);
137 /// trash_orig_path_utf8 = g_filename_to_utf8 (trash_orig_path_byte_string, -1, NULL, NULL, NULL);
138 /// if (trash_orig_path_utf8 != NULL)
139 /// g_message ("Some larger UTF-8 string with filename embedded as %s", trash_orig_path_utf8);
140 /// ```
141 /// ## `attribute`
142 /// a file attribute key.
143 ///
144 /// # Returns
145 ///
146 /// a UTF-8 string associated with the given @attribute, or
147 /// [`None`] if the attribute wasn’t set.
148 /// When you're done with the string it must be freed with g_free().
149 #[doc(alias = "g_file_info_get_attribute_as_string")]
150 #[doc(alias = "get_attribute_as_string")]
151 pub fn attribute_as_string(&self, attribute: &str) -> Option<glib::GString> {
152 unsafe {
153 from_glib_full(ffi::g_file_info_get_attribute_as_string(
154 self.to_glib_none().0,
155 attribute.to_glib_none().0,
156 ))
157 }
158 }
159
160 /// Gets the value of a boolean attribute. If the attribute does not
161 /// contain a boolean value, [`false`] will be returned.
162 /// ## `attribute`
163 /// a file attribute key.
164 ///
165 /// # Returns
166 ///
167 /// the boolean value contained within the attribute.
168 #[doc(alias = "g_file_info_get_attribute_boolean")]
169 #[doc(alias = "get_attribute_boolean")]
170 pub fn boolean(&self, attribute: &str) -> bool {
171 unsafe {
172 from_glib(ffi::g_file_info_get_attribute_boolean(
173 self.to_glib_none().0,
174 attribute.to_glib_none().0,
175 ))
176 }
177 }
178
179 /// Gets the value of a byte string attribute. If the attribute does
180 /// not contain a byte string, [`None`] will be returned.
181 /// ## `attribute`
182 /// a file attribute key.
183 ///
184 /// # Returns
185 ///
186 /// the contents of the @attribute value as a byte string, or
187 /// [`None`] otherwise.
188 #[doc(alias = "g_file_info_get_attribute_byte_string")]
189 #[doc(alias = "get_attribute_byte_string")]
190 pub fn attribute_byte_string(&self, attribute: &str) -> Option<glib::GString> {
191 unsafe {
192 from_glib_none(ffi::g_file_info_get_attribute_byte_string(
193 self.to_glib_none().0,
194 attribute.to_glib_none().0,
195 ))
196 }
197 }
198
199 //#[doc(alias = "g_file_info_get_attribute_data")]
200 //#[doc(alias = "get_attribute_data")]
201 //pub fn attribute_data(&self, attribute: &str, value_pp: /*Unimplemented*/&mut Basic: Pointer) -> Option<(FileAttributeType, FileAttributeStatus)> {
202 // unsafe { TODO: call ffi:g_file_info_get_attribute_data() }
203 //}
204
205 /// Gets the value of a byte string attribute as a file path.
206 ///
207 /// If the attribute does not contain a byte string, `NULL` will be returned.
208 ///
209 /// This function is meant to be used by language bindings that have specific
210 /// handling for Unix paths.
211 /// ## `attribute`
212 /// a file attribute key.
213 ///
214 /// # Returns
215 ///
216 /// the contents of the @attribute value as
217 /// a file path, or [`None`] otherwise.
218 #[cfg(feature = "v2_78")]
219 #[cfg_attr(docsrs, doc(cfg(feature = "v2_78")))]
220 #[doc(alias = "g_file_info_get_attribute_file_path")]
221 #[doc(alias = "get_attribute_file_path")]
222 pub fn attribute_file_path(&self, attribute: &str) -> Option<std::path::PathBuf> {
223 unsafe {
224 from_glib_none(ffi::g_file_info_get_attribute_file_path(
225 self.to_glib_none().0,
226 attribute.to_glib_none().0,
227 ))
228 }
229 }
230
231 /// Gets a signed 32-bit integer contained within the attribute. If the
232 /// attribute does not contain a signed 32-bit integer, or is invalid,
233 /// 0 will be returned.
234 /// ## `attribute`
235 /// a file attribute key.
236 ///
237 /// # Returns
238 ///
239 /// a signed 32-bit integer from the attribute.
240 #[doc(alias = "g_file_info_get_attribute_int32")]
241 #[doc(alias = "get_attribute_int32")]
242 pub fn attribute_int32(&self, attribute: &str) -> i32 {
243 unsafe {
244 ffi::g_file_info_get_attribute_int32(self.to_glib_none().0, attribute.to_glib_none().0)
245 }
246 }
247
248 /// Gets a signed 64-bit integer contained within the attribute. If the
249 /// attribute does not contain a signed 64-bit integer, or is invalid,
250 /// 0 will be returned.
251 /// ## `attribute`
252 /// a file attribute key.
253 ///
254 /// # Returns
255 ///
256 /// a signed 64-bit integer from the attribute.
257 #[doc(alias = "g_file_info_get_attribute_int64")]
258 #[doc(alias = "get_attribute_int64")]
259 pub fn attribute_int64(&self, attribute: &str) -> i64 {
260 unsafe {
261 ffi::g_file_info_get_attribute_int64(self.to_glib_none().0, attribute.to_glib_none().0)
262 }
263 }
264
265 /// Gets the value of a #GObject attribute. If the attribute does
266 /// not contain a #GObject, [`None`] will be returned.
267 /// ## `attribute`
268 /// a file attribute key.
269 ///
270 /// # Returns
271 ///
272 /// a #GObject associated with the given @attribute,
273 /// or [`None`] otherwise.
274 #[doc(alias = "g_file_info_get_attribute_object")]
275 #[doc(alias = "get_attribute_object")]
276 pub fn attribute_object(&self, attribute: &str) -> Option<glib::Object> {
277 unsafe {
278 from_glib_none(ffi::g_file_info_get_attribute_object(
279 self.to_glib_none().0,
280 attribute.to_glib_none().0,
281 ))
282 }
283 }
284
285 /// Gets the attribute status for an attribute key.
286 /// ## `attribute`
287 /// a file attribute key
288 ///
289 /// # Returns
290 ///
291 /// a #GFileAttributeStatus for the given @attribute, or
292 /// [`FileAttributeStatus::Unset`][crate::FileAttributeStatus::Unset] if the key is invalid.
293 #[doc(alias = "g_file_info_get_attribute_status")]
294 #[doc(alias = "get_attribute_status")]
295 pub fn attribute_status(&self, attribute: &str) -> FileAttributeStatus {
296 unsafe {
297 from_glib(ffi::g_file_info_get_attribute_status(
298 self.to_glib_none().0,
299 attribute.to_glib_none().0,
300 ))
301 }
302 }
303
304 /// Gets the value of a string attribute. If the attribute does
305 /// not contain a string, [`None`] will be returned.
306 /// ## `attribute`
307 /// a file attribute key.
308 ///
309 /// # Returns
310 ///
311 /// the contents of the @attribute value as a UTF-8 string,
312 /// or [`None`] otherwise.
313 #[doc(alias = "g_file_info_get_attribute_string")]
314 #[doc(alias = "get_attribute_string")]
315 pub fn attribute_string(&self, attribute: &str) -> Option<glib::GString> {
316 unsafe {
317 from_glib_none(ffi::g_file_info_get_attribute_string(
318 self.to_glib_none().0,
319 attribute.to_glib_none().0,
320 ))
321 }
322 }
323
324 /// Gets the attribute type for an attribute key.
325 /// ## `attribute`
326 /// a file attribute key.
327 ///
328 /// # Returns
329 ///
330 /// a #GFileAttributeType for the given @attribute, or
331 /// [`FileAttributeType::Invalid`][crate::FileAttributeType::Invalid] if the key is not set.
332 #[doc(alias = "g_file_info_get_attribute_type")]
333 #[doc(alias = "get_attribute_type")]
334 pub fn attribute_type(&self, attribute: &str) -> FileAttributeType {
335 unsafe {
336 from_glib(ffi::g_file_info_get_attribute_type(
337 self.to_glib_none().0,
338 attribute.to_glib_none().0,
339 ))
340 }
341 }
342
343 /// Gets an unsigned 32-bit integer contained within the attribute. If the
344 /// attribute does not contain an unsigned 32-bit integer, or is invalid,
345 /// 0 will be returned.
346 /// ## `attribute`
347 /// a file attribute key.
348 ///
349 /// # Returns
350 ///
351 /// an unsigned 32-bit integer from the attribute.
352 #[doc(alias = "g_file_info_get_attribute_uint32")]
353 #[doc(alias = "get_attribute_uint32")]
354 pub fn attribute_uint32(&self, attribute: &str) -> u32 {
355 unsafe {
356 ffi::g_file_info_get_attribute_uint32(self.to_glib_none().0, attribute.to_glib_none().0)
357 }
358 }
359
360 /// Gets a unsigned 64-bit integer contained within the attribute. If the
361 /// attribute does not contain an unsigned 64-bit integer, or is invalid,
362 /// 0 will be returned.
363 /// ## `attribute`
364 /// a file attribute key.
365 ///
366 /// # Returns
367 ///
368 /// a unsigned 64-bit integer from the attribute.
369 #[doc(alias = "g_file_info_get_attribute_uint64")]
370 #[doc(alias = "get_attribute_uint64")]
371 pub fn attribute_uint64(&self, attribute: &str) -> u64 {
372 unsafe {
373 ffi::g_file_info_get_attribute_uint64(self.to_glib_none().0, attribute.to_glib_none().0)
374 }
375 }
376
377 /// Gets the file's content type.
378 ///
379 /// It is an error to call this if the #GFileInfo does not contain
380 /// [`FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE`][crate::FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE].
381 ///
382 /// # Returns
383 ///
384 /// a string containing the file's content type,
385 /// or [`None`] if unknown.
386 #[doc(alias = "g_file_info_get_content_type")]
387 #[doc(alias = "get_content_type")]
388 pub fn content_type(&self) -> Option<glib::GString> {
389 unsafe { from_glib_none(ffi::g_file_info_get_content_type(self.to_glib_none().0)) }
390 }
391
392 /// Gets the creation time of the current @self and returns it as a
393 /// #GDateTime.
394 ///
395 /// It is an error to call this if the #GFileInfo does not contain
396 /// [`FILE_ATTRIBUTE_TIME_CREATED`][crate::FILE_ATTRIBUTE_TIME_CREATED]. If [`FILE_ATTRIBUTE_TIME_CREATED_USEC`][crate::FILE_ATTRIBUTE_TIME_CREATED_USEC] is
397 /// provided, the resulting #GDateTime will additionally have microsecond
398 /// precision.
399 ///
400 /// If nanosecond precision is needed, [`FILE_ATTRIBUTE_TIME_CREATED_NSEC`][crate::FILE_ATTRIBUTE_TIME_CREATED_NSEC] must
401 /// be queried separately using g_file_info_get_attribute_uint32().
402 ///
403 /// # Returns
404 ///
405 /// creation time, or [`None`] if unknown
406 #[cfg(feature = "v2_70")]
407 #[cfg_attr(docsrs, doc(cfg(feature = "v2_70")))]
408 #[doc(alias = "g_file_info_get_creation_date_time")]
409 #[doc(alias = "get_creation_date_time")]
410 pub fn creation_date_time(&self) -> Option<glib::DateTime> {
411 unsafe {
412 from_glib_full(ffi::g_file_info_get_creation_date_time(
413 self.to_glib_none().0,
414 ))
415 }
416 }
417
418 /// Returns the #GDateTime representing the deletion date of the file, as
419 /// available in [`FILE_ATTRIBUTE_TRASH_DELETION_DATE`][crate::FILE_ATTRIBUTE_TRASH_DELETION_DATE]. If the
420 /// [`FILE_ATTRIBUTE_TRASH_DELETION_DATE`][crate::FILE_ATTRIBUTE_TRASH_DELETION_DATE] attribute is unset, [`None`] is returned.
421 ///
422 /// # Returns
423 ///
424 /// a #GDateTime, or [`None`].
425 #[doc(alias = "g_file_info_get_deletion_date")]
426 #[doc(alias = "get_deletion_date")]
427 pub fn deletion_date(&self) -> Option<glib::DateTime> {
428 unsafe { from_glib_full(ffi::g_file_info_get_deletion_date(self.to_glib_none().0)) }
429 }
430
431 /// Gets a display name for a file. This is guaranteed to always be set.
432 ///
433 /// It is an error to call this if the #GFileInfo does not contain
434 /// [`FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME`][crate::FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME].
435 ///
436 /// # Returns
437 ///
438 /// a string containing the display name.
439 #[doc(alias = "g_file_info_get_display_name")]
440 #[doc(alias = "get_display_name")]
441 pub fn display_name(&self) -> glib::GString {
442 unsafe { from_glib_none(ffi::g_file_info_get_display_name(self.to_glib_none().0)) }
443 }
444
445 /// Gets the edit name for a file.
446 ///
447 /// It is an error to call this if the #GFileInfo does not contain
448 /// [`FILE_ATTRIBUTE_STANDARD_EDIT_NAME`][crate::FILE_ATTRIBUTE_STANDARD_EDIT_NAME].
449 ///
450 /// # Returns
451 ///
452 /// a string containing the edit name.
453 #[doc(alias = "g_file_info_get_edit_name")]
454 #[doc(alias = "get_edit_name")]
455 pub fn edit_name(&self) -> glib::GString {
456 unsafe { from_glib_none(ffi::g_file_info_get_edit_name(self.to_glib_none().0)) }
457 }
458
459 /// Gets the [entity tag][`File`][crate::File]#entity-tags] for a given
460 /// #GFileInfo. See [`FILE_ATTRIBUTE_ETAG_VALUE`][crate::FILE_ATTRIBUTE_ETAG_VALUE].
461 ///
462 /// It is an error to call this if the #GFileInfo does not contain
463 /// [`FILE_ATTRIBUTE_ETAG_VALUE`][crate::FILE_ATTRIBUTE_ETAG_VALUE].
464 ///
465 /// # Returns
466 ///
467 /// a string containing the value of the "etag:value" attribute.
468 #[doc(alias = "g_file_info_get_etag")]
469 #[doc(alias = "get_etag")]
470 pub fn etag(&self) -> Option<glib::GString> {
471 unsafe { from_glib_none(ffi::g_file_info_get_etag(self.to_glib_none().0)) }
472 }
473
474 /// Gets a file's type (whether it is a regular file, symlink, etc).
475 /// This is different from the file's content type, see g_file_info_get_content_type().
476 ///
477 /// It is an error to call this if the #GFileInfo does not contain
478 /// [`FILE_ATTRIBUTE_STANDARD_TYPE`][crate::FILE_ATTRIBUTE_STANDARD_TYPE].
479 ///
480 /// # Returns
481 ///
482 /// a #GFileType for the given file.
483 #[doc(alias = "g_file_info_get_file_type")]
484 #[doc(alias = "get_file_type")]
485 pub fn file_type(&self) -> FileType {
486 unsafe { from_glib(ffi::g_file_info_get_file_type(self.to_glib_none().0)) }
487 }
488
489 /// Gets the icon for a file.
490 ///
491 /// It is an error to call this if the #GFileInfo does not contain
492 /// [`FILE_ATTRIBUTE_STANDARD_ICON`][crate::FILE_ATTRIBUTE_STANDARD_ICON].
493 ///
494 /// # Returns
495 ///
496 /// #GIcon for the given @self.
497 #[doc(alias = "g_file_info_get_icon")]
498 #[doc(alias = "get_icon")]
499 pub fn icon(&self) -> Option<Icon> {
500 unsafe { from_glib_none(ffi::g_file_info_get_icon(self.to_glib_none().0)) }
501 }
502
503 /// Checks if a file is a backup file.
504 ///
505 /// The exact semantics of what constitutes a backup file are
506 /// backend-specific. For local files, a file is considered a backup
507 /// if its name ends with `~` and it is a regular file. This follows
508 /// the POSIX convention used by text editors such as Emacs.
509 ///
510 /// It is an error to call this if the #GFileInfo does not contain
511 /// [`FILE_ATTRIBUTE_STANDARD_IS_BACKUP`][crate::FILE_ATTRIBUTE_STANDARD_IS_BACKUP].
512 ///
513 /// # Returns
514 ///
515 /// [`true`] if file is a backup file, [`false`] otherwise.
516 #[doc(alias = "g_file_info_get_is_backup")]
517 #[doc(alias = "get_is_backup")]
518 pub fn is_backup(&self) -> bool {
519 unsafe { from_glib(ffi::g_file_info_get_is_backup(self.to_glib_none().0)) }
520 }
521
522 /// Checks if a file is hidden.
523 ///
524 /// It is an error to call this if the #GFileInfo does not contain
525 /// [`FILE_ATTRIBUTE_STANDARD_IS_HIDDEN`][crate::FILE_ATTRIBUTE_STANDARD_IS_HIDDEN].
526 ///
527 /// # Returns
528 ///
529 /// [`true`] if the file is a hidden file, [`false`] otherwise.
530 #[doc(alias = "g_file_info_get_is_hidden")]
531 #[doc(alias = "get_is_hidden")]
532 pub fn is_hidden(&self) -> bool {
533 unsafe { from_glib(ffi::g_file_info_get_is_hidden(self.to_glib_none().0)) }
534 }
535
536 /// Checks if a file is a symlink.
537 ///
538 /// It is an error to call this if the #GFileInfo does not contain
539 /// [`FILE_ATTRIBUTE_STANDARD_IS_SYMLINK`][crate::FILE_ATTRIBUTE_STANDARD_IS_SYMLINK].
540 ///
541 /// # Returns
542 ///
543 /// [`true`] if the given @self is a symlink.
544 #[doc(alias = "g_file_info_get_is_symlink")]
545 #[doc(alias = "get_is_symlink")]
546 pub fn is_symlink(&self) -> bool {
547 unsafe { from_glib(ffi::g_file_info_get_is_symlink(self.to_glib_none().0)) }
548 }
549
550 /// Gets the modification time of the current @self and returns it as a
551 /// #GDateTime.
552 ///
553 /// It is an error to call this if the #GFileInfo does not contain
554 /// [`FILE_ATTRIBUTE_TIME_MODIFIED`][crate::FILE_ATTRIBUTE_TIME_MODIFIED]. If [`FILE_ATTRIBUTE_TIME_MODIFIED_USEC`][crate::FILE_ATTRIBUTE_TIME_MODIFIED_USEC] is
555 /// provided, the resulting #GDateTime will additionally have microsecond
556 /// precision.
557 ///
558 /// If nanosecond precision is needed, [`FILE_ATTRIBUTE_TIME_MODIFIED_NSEC`][crate::FILE_ATTRIBUTE_TIME_MODIFIED_NSEC] must
559 /// be queried separately using g_file_info_get_attribute_uint32().
560 ///
561 /// # Returns
562 ///
563 /// modification time, or [`None`] if unknown
564 #[cfg(feature = "v2_62")]
565 #[cfg_attr(docsrs, doc(cfg(feature = "v2_62")))]
566 #[doc(alias = "g_file_info_get_modification_date_time")]
567 #[doc(alias = "get_modification_date_time")]
568 pub fn modification_date_time(&self) -> Option<glib::DateTime> {
569 unsafe {
570 from_glib_full(ffi::g_file_info_get_modification_date_time(
571 self.to_glib_none().0,
572 ))
573 }
574 }
575
576 /// Gets the name for a file. This is guaranteed to always be set.
577 ///
578 /// It is an error to call this if the #GFileInfo does not contain
579 /// [`FILE_ATTRIBUTE_STANDARD_NAME`][crate::FILE_ATTRIBUTE_STANDARD_NAME].
580 ///
581 /// # Returns
582 ///
583 /// a string containing the file name.
584 #[doc(alias = "g_file_info_get_name")]
585 #[doc(alias = "get_name")]
586 pub fn name(&self) -> std::path::PathBuf {
587 unsafe { from_glib_none(ffi::g_file_info_get_name(self.to_glib_none().0)) }
588 }
589
590 /// Gets the file's size (in bytes). The size is retrieved through the value of
591 /// the [`FILE_ATTRIBUTE_STANDARD_SIZE`][crate::FILE_ATTRIBUTE_STANDARD_SIZE] attribute and is converted
592 /// from #guint64 to #goffset before returning the result.
593 ///
594 /// It is an error to call this if the #GFileInfo does not contain
595 /// [`FILE_ATTRIBUTE_STANDARD_SIZE`][crate::FILE_ATTRIBUTE_STANDARD_SIZE].
596 ///
597 /// # Returns
598 ///
599 /// a #goffset containing the file's size (in bytes).
600 #[doc(alias = "g_file_info_get_size")]
601 #[doc(alias = "get_size")]
602 pub fn size(&self) -> i64 {
603 unsafe { ffi::g_file_info_get_size(self.to_glib_none().0) }
604 }
605
606 /// Gets the value of the sort_order attribute from the #GFileInfo.
607 /// See [`FILE_ATTRIBUTE_STANDARD_SORT_ORDER`][crate::FILE_ATTRIBUTE_STANDARD_SORT_ORDER].
608 ///
609 /// It is an error to call this if the #GFileInfo does not contain
610 /// [`FILE_ATTRIBUTE_STANDARD_SORT_ORDER`][crate::FILE_ATTRIBUTE_STANDARD_SORT_ORDER].
611 ///
612 /// # Returns
613 ///
614 /// a #gint32 containing the value of the "standard::sort_order" attribute.
615 #[doc(alias = "g_file_info_get_sort_order")]
616 #[doc(alias = "get_sort_order")]
617 pub fn sort_order(&self) -> i32 {
618 unsafe { ffi::g_file_info_get_sort_order(self.to_glib_none().0) }
619 }
620
621 /// Gets the symbolic icon for a file.
622 ///
623 /// It is an error to call this if the #GFileInfo does not contain
624 /// [`FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON`][crate::FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON].
625 ///
626 /// # Returns
627 ///
628 /// #GIcon for the given @self.
629 #[doc(alias = "g_file_info_get_symbolic_icon")]
630 #[doc(alias = "get_symbolic_icon")]
631 pub fn symbolic_icon(&self) -> Option<Icon> {
632 unsafe { from_glib_none(ffi::g_file_info_get_symbolic_icon(self.to_glib_none().0)) }
633 }
634
635 /// Gets the symlink target for a given #GFileInfo.
636 ///
637 /// It is an error to call this if the #GFileInfo does not contain
638 /// [`FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET`][crate::FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET].
639 ///
640 /// # Returns
641 ///
642 /// a string containing the symlink target.
643 #[doc(alias = "g_file_info_get_symlink_target")]
644 #[doc(alias = "get_symlink_target")]
645 pub fn symlink_target(&self) -> Option<std::path::PathBuf> {
646 unsafe { from_glib_none(ffi::g_file_info_get_symlink_target(self.to_glib_none().0)) }
647 }
648
649 /// Checks if a file info structure has an attribute named @attribute.
650 /// ## `attribute`
651 /// a file attribute key.
652 ///
653 /// # Returns
654 ///
655 /// [`true`] if @self has an attribute named @attribute,
656 /// [`false`] otherwise.
657 #[doc(alias = "g_file_info_has_attribute")]
658 pub fn has_attribute(&self, attribute: &str) -> bool {
659 unsafe {
660 from_glib(ffi::g_file_info_has_attribute(
661 self.to_glib_none().0,
662 attribute.to_glib_none().0,
663 ))
664 }
665 }
666
667 /// Checks if a file info structure has an attribute in the
668 /// specified @name_space.
669 /// ## `name_space`
670 /// a file attribute namespace.
671 ///
672 /// # Returns
673 ///
674 /// [`true`] if @self has an attribute in @name_space,
675 /// [`false`] otherwise.
676 #[doc(alias = "g_file_info_has_namespace")]
677 pub fn has_namespace(&self, name_space: &str) -> bool {
678 unsafe {
679 from_glib(ffi::g_file_info_has_namespace(
680 self.to_glib_none().0,
681 name_space.to_glib_none().0,
682 ))
683 }
684 }
685
686 /// Lists the file info structure's attributes.
687 /// ## `name_space`
688 /// a file attribute key's namespace, or [`None`] to list
689 /// all attributes.
690 ///
691 /// # Returns
692 ///
693 /// a
694 /// null-terminated array of strings of all of the possible attribute
695 /// types for the given @name_space, or [`None`] on error.
696 #[doc(alias = "g_file_info_list_attributes")]
697 pub fn list_attributes(&self, name_space: Option<&str>) -> Vec<glib::GString> {
698 unsafe {
699 FromGlibPtrContainer::from_glib_full(ffi::g_file_info_list_attributes(
700 self.to_glib_none().0,
701 name_space.to_glib_none().0,
702 ))
703 }
704 }
705
706 /// Removes all cases of @attribute from @self if it exists.
707 /// ## `attribute`
708 /// a file attribute key.
709 #[doc(alias = "g_file_info_remove_attribute")]
710 pub fn remove_attribute(&self, attribute: &str) {
711 unsafe {
712 ffi::g_file_info_remove_attribute(self.to_glib_none().0, attribute.to_glib_none().0);
713 }
714 }
715
716 /// Sets the [`FILE_ATTRIBUTE_TIME_ACCESS`][crate::FILE_ATTRIBUTE_TIME_ACCESS] and
717 /// [`FILE_ATTRIBUTE_TIME_ACCESS_USEC`][crate::FILE_ATTRIBUTE_TIME_ACCESS_USEC] attributes in the file info to the
718 /// given date/time value.
719 ///
720 /// [`FILE_ATTRIBUTE_TIME_ACCESS_NSEC`][crate::FILE_ATTRIBUTE_TIME_ACCESS_NSEC] will be cleared.
721 /// ## `atime`
722 /// a #GDateTime.
723 #[cfg(feature = "v2_70")]
724 #[cfg_attr(docsrs, doc(cfg(feature = "v2_70")))]
725 #[doc(alias = "g_file_info_set_access_date_time")]
726 pub fn set_access_date_time(&self, atime: &glib::DateTime) {
727 unsafe {
728 ffi::g_file_info_set_access_date_time(self.to_glib_none().0, atime.to_glib_none().0);
729 }
730 }
731
732 //#[doc(alias = "g_file_info_set_attribute")]
733 //pub fn set_attribute(&self, attribute: &str, type_: FileAttributeType, value_p: /*Unimplemented*/Basic: Pointer) {
734 // unsafe { TODO: call ffi:g_file_info_set_attribute() }
735 //}
736
737 /// Sets the @attribute to contain the given @attr_value,
738 /// if possible.
739 /// ## `attribute`
740 /// a file attribute key.
741 /// ## `attr_value`
742 /// a boolean value.
743 #[doc(alias = "g_file_info_set_attribute_boolean")]
744 pub fn set_attribute_boolean(&self, attribute: &str, attr_value: bool) {
745 unsafe {
746 ffi::g_file_info_set_attribute_boolean(
747 self.to_glib_none().0,
748 attribute.to_glib_none().0,
749 attr_value.into_glib(),
750 );
751 }
752 }
753
754 /// Sets the @attribute to contain the given @attr_value,
755 /// if possible.
756 /// ## `attribute`
757 /// a file attribute key.
758 /// ## `attr_value`
759 /// a byte string.
760 #[doc(alias = "g_file_info_set_attribute_byte_string")]
761 pub fn set_attribute_byte_string(&self, attribute: &str, attr_value: &str) {
762 unsafe {
763 ffi::g_file_info_set_attribute_byte_string(
764 self.to_glib_none().0,
765 attribute.to_glib_none().0,
766 attr_value.to_glib_none().0,
767 );
768 }
769 }
770
771 /// Sets the @attribute to contain the given @attr_value,
772 /// if possible.
773 ///
774 /// This function is meant to be used by language bindings that have specific
775 /// handling for Unix paths.
776 /// ## `attribute`
777 /// a file attribute key.
778 /// ## `attr_value`
779 /// a file path.
780 #[cfg(feature = "v2_78")]
781 #[cfg_attr(docsrs, doc(cfg(feature = "v2_78")))]
782 #[doc(alias = "g_file_info_set_attribute_file_path")]
783 pub fn set_attribute_file_path(
784 &self,
785 attribute: &str,
786 attr_value: impl AsRef<std::path::Path>,
787 ) {
788 unsafe {
789 ffi::g_file_info_set_attribute_file_path(
790 self.to_glib_none().0,
791 attribute.to_glib_none().0,
792 attr_value.as_ref().to_glib_none().0,
793 );
794 }
795 }
796
797 /// Sets the @attribute to contain the given @attr_value,
798 /// if possible.
799 /// ## `attribute`
800 /// a file attribute key.
801 /// ## `attr_value`
802 /// a signed 32-bit integer
803 #[doc(alias = "g_file_info_set_attribute_int32")]
804 pub fn set_attribute_int32(&self, attribute: &str, attr_value: i32) {
805 unsafe {
806 ffi::g_file_info_set_attribute_int32(
807 self.to_glib_none().0,
808 attribute.to_glib_none().0,
809 attr_value,
810 );
811 }
812 }
813
814 /// Sets the @attribute to contain the given @attr_value,
815 /// if possible.
816 /// ## `attribute`
817 /// attribute name to set.
818 /// ## `attr_value`
819 /// int64 value to set attribute to.
820 #[doc(alias = "g_file_info_set_attribute_int64")]
821 pub fn set_attribute_int64(&self, attribute: &str, attr_value: i64) {
822 unsafe {
823 ffi::g_file_info_set_attribute_int64(
824 self.to_glib_none().0,
825 attribute.to_glib_none().0,
826 attr_value,
827 );
828 }
829 }
830
831 /// Sets @mask on @self to match specific attribute types.
832 /// ## `mask`
833 /// a #GFileAttributeMatcher.
834 #[doc(alias = "g_file_info_set_attribute_mask")]
835 pub fn set_attribute_mask(&self, mask: &FileAttributeMatcher) {
836 unsafe {
837 ffi::g_file_info_set_attribute_mask(self.to_glib_none().0, mask.to_glib_none().0);
838 }
839 }
840
841 /// Sets the @attribute to contain the given @attr_value,
842 /// if possible.
843 /// ## `attribute`
844 /// a file attribute key.
845 /// ## `attr_value`
846 /// a #GObject.
847 #[doc(alias = "g_file_info_set_attribute_object")]
848 pub fn set_attribute_object(&self, attribute: &str, attr_value: &impl IsA<glib::Object>) {
849 unsafe {
850 ffi::g_file_info_set_attribute_object(
851 self.to_glib_none().0,
852 attribute.to_glib_none().0,
853 attr_value.as_ref().to_glib_none().0,
854 );
855 }
856 }
857
858 /// Sets the attribute status for an attribute key. This is only
859 /// needed by external code that implement g_file_set_attributes_from_info()
860 /// or similar functions.
861 ///
862 /// The attribute must exist in @self for this to work. Otherwise [`false`]
863 /// is returned and @self is unchanged.
864 /// ## `attribute`
865 /// a file attribute key
866 /// ## `status`
867 /// a #GFileAttributeStatus
868 ///
869 /// # Returns
870 ///
871 /// [`true`] if the status was changed, [`false`] if the key was not set.
872 #[doc(alias = "g_file_info_set_attribute_status")]
873 pub fn set_attribute_status(&self, attribute: &str, status: FileAttributeStatus) -> bool {
874 unsafe {
875 from_glib(ffi::g_file_info_set_attribute_status(
876 self.to_glib_none().0,
877 attribute.to_glib_none().0,
878 status.into_glib(),
879 ))
880 }
881 }
882
883 /// Sets the @attribute to contain the given @attr_value,
884 /// if possible.
885 /// ## `attribute`
886 /// a file attribute key.
887 /// ## `attr_value`
888 /// a UTF-8 string.
889 #[doc(alias = "g_file_info_set_attribute_string")]
890 pub fn set_attribute_string(&self, attribute: &str, attr_value: &str) {
891 unsafe {
892 ffi::g_file_info_set_attribute_string(
893 self.to_glib_none().0,
894 attribute.to_glib_none().0,
895 attr_value.to_glib_none().0,
896 );
897 }
898 }
899
900 /// Sets the @attribute to contain the given @attr_value,
901 /// if possible.
902 /// ## `attribute`
903 /// a file attribute key.
904 /// ## `attr_value`
905 /// an unsigned 32-bit integer.
906 #[doc(alias = "g_file_info_set_attribute_uint32")]
907 pub fn set_attribute_uint32(&self, attribute: &str, attr_value: u32) {
908 unsafe {
909 ffi::g_file_info_set_attribute_uint32(
910 self.to_glib_none().0,
911 attribute.to_glib_none().0,
912 attr_value,
913 );
914 }
915 }
916
917 /// Sets the @attribute to contain the given @attr_value,
918 /// if possible.
919 /// ## `attribute`
920 /// a file attribute key.
921 /// ## `attr_value`
922 /// an unsigned 64-bit integer.
923 #[doc(alias = "g_file_info_set_attribute_uint64")]
924 pub fn set_attribute_uint64(&self, attribute: &str, attr_value: u64) {
925 unsafe {
926 ffi::g_file_info_set_attribute_uint64(
927 self.to_glib_none().0,
928 attribute.to_glib_none().0,
929 attr_value,
930 );
931 }
932 }
933
934 /// Sets the content type attribute for a given #GFileInfo.
935 /// See [`FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE`][crate::FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE].
936 /// ## `content_type`
937 /// a [content type](content-types.html#content-types).
938 #[doc(alias = "g_file_info_set_content_type")]
939 pub fn set_content_type(&self, content_type: &str) {
940 unsafe {
941 ffi::g_file_info_set_content_type(self.to_glib_none().0, content_type.to_glib_none().0);
942 }
943 }
944
945 /// Sets the [`FILE_ATTRIBUTE_TIME_CREATED`][crate::FILE_ATTRIBUTE_TIME_CREATED] and
946 /// [`FILE_ATTRIBUTE_TIME_CREATED_USEC`][crate::FILE_ATTRIBUTE_TIME_CREATED_USEC] attributes in the file info to the
947 /// given date/time value.
948 ///
949 /// [`FILE_ATTRIBUTE_TIME_CREATED_NSEC`][crate::FILE_ATTRIBUTE_TIME_CREATED_NSEC] will be cleared.
950 /// ## `creation_time`
951 /// a #GDateTime.
952 #[cfg(feature = "v2_70")]
953 #[cfg_attr(docsrs, doc(cfg(feature = "v2_70")))]
954 #[doc(alias = "g_file_info_set_creation_date_time")]
955 pub fn set_creation_date_time(&self, creation_time: &glib::DateTime) {
956 unsafe {
957 ffi::g_file_info_set_creation_date_time(
958 self.to_glib_none().0,
959 creation_time.to_glib_none().0,
960 );
961 }
962 }
963
964 /// Sets the display name for the current #GFileInfo.
965 /// See [`FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME`][crate::FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME].
966 /// ## `display_name`
967 /// a string containing a display name.
968 #[doc(alias = "g_file_info_set_display_name")]
969 pub fn set_display_name(&self, display_name: &str) {
970 unsafe {
971 ffi::g_file_info_set_display_name(self.to_glib_none().0, display_name.to_glib_none().0);
972 }
973 }
974
975 /// Sets the edit name for the current file.
976 /// See [`FILE_ATTRIBUTE_STANDARD_EDIT_NAME`][crate::FILE_ATTRIBUTE_STANDARD_EDIT_NAME].
977 /// ## `edit_name`
978 /// a string containing an edit name.
979 #[doc(alias = "g_file_info_set_edit_name")]
980 pub fn set_edit_name(&self, edit_name: &str) {
981 unsafe {
982 ffi::g_file_info_set_edit_name(self.to_glib_none().0, edit_name.to_glib_none().0);
983 }
984 }
985
986 /// Sets the file type in a #GFileInfo to @type_.
987 /// See [`FILE_ATTRIBUTE_STANDARD_TYPE`][crate::FILE_ATTRIBUTE_STANDARD_TYPE].
988 /// ## `type_`
989 /// a #GFileType.
990 #[doc(alias = "g_file_info_set_file_type")]
991 pub fn set_file_type(&self, type_: FileType) {
992 unsafe {
993 ffi::g_file_info_set_file_type(self.to_glib_none().0, type_.into_glib());
994 }
995 }
996
997 /// Sets the icon for a given #GFileInfo.
998 /// See [`FILE_ATTRIBUTE_STANDARD_ICON`][crate::FILE_ATTRIBUTE_STANDARD_ICON].
999 /// ## `icon`
1000 /// a #GIcon.
1001 #[doc(alias = "g_file_info_set_icon")]
1002 pub fn set_icon(&self, icon: &impl IsA<Icon>) {
1003 unsafe {
1004 ffi::g_file_info_set_icon(self.to_glib_none().0, icon.as_ref().to_glib_none().0);
1005 }
1006 }
1007
1008 /// Sets the "is_hidden" attribute in a #GFileInfo according to @is_hidden.
1009 /// See [`FILE_ATTRIBUTE_STANDARD_IS_HIDDEN`][crate::FILE_ATTRIBUTE_STANDARD_IS_HIDDEN].
1010 /// ## `is_hidden`
1011 /// a #gboolean.
1012 #[doc(alias = "g_file_info_set_is_hidden")]
1013 pub fn set_is_hidden(&self, is_hidden: bool) {
1014 unsafe {
1015 ffi::g_file_info_set_is_hidden(self.to_glib_none().0, is_hidden.into_glib());
1016 }
1017 }
1018
1019 /// Sets the "is_symlink" attribute in a #GFileInfo according to @is_symlink.
1020 /// See [`FILE_ATTRIBUTE_STANDARD_IS_SYMLINK`][crate::FILE_ATTRIBUTE_STANDARD_IS_SYMLINK].
1021 /// ## `is_symlink`
1022 /// a #gboolean.
1023 #[doc(alias = "g_file_info_set_is_symlink")]
1024 pub fn set_is_symlink(&self, is_symlink: bool) {
1025 unsafe {
1026 ffi::g_file_info_set_is_symlink(self.to_glib_none().0, is_symlink.into_glib());
1027 }
1028 }
1029
1030 /// Sets the [`FILE_ATTRIBUTE_TIME_MODIFIED`][crate::FILE_ATTRIBUTE_TIME_MODIFIED] and
1031 /// [`FILE_ATTRIBUTE_TIME_MODIFIED_USEC`][crate::FILE_ATTRIBUTE_TIME_MODIFIED_USEC] attributes in the file info to the
1032 /// given date/time value.
1033 ///
1034 /// [`FILE_ATTRIBUTE_TIME_MODIFIED_NSEC`][crate::FILE_ATTRIBUTE_TIME_MODIFIED_NSEC] will be cleared.
1035 /// ## `mtime`
1036 /// a #GDateTime.
1037 #[cfg(feature = "v2_62")]
1038 #[cfg_attr(docsrs, doc(cfg(feature = "v2_62")))]
1039 #[doc(alias = "g_file_info_set_modification_date_time")]
1040 pub fn set_modification_date_time(&self, mtime: &glib::DateTime) {
1041 unsafe {
1042 ffi::g_file_info_set_modification_date_time(
1043 self.to_glib_none().0,
1044 mtime.to_glib_none().0,
1045 );
1046 }
1047 }
1048
1049 /// Sets the name attribute for the current #GFileInfo.
1050 /// See [`FILE_ATTRIBUTE_STANDARD_NAME`][crate::FILE_ATTRIBUTE_STANDARD_NAME].
1051 /// ## `name`
1052 /// a string containing a name.
1053 #[doc(alias = "g_file_info_set_name")]
1054 pub fn set_name(&self, name: impl AsRef<std::path::Path>) {
1055 unsafe {
1056 ffi::g_file_info_set_name(self.to_glib_none().0, name.as_ref().to_glib_none().0);
1057 }
1058 }
1059
1060 /// Sets the [`FILE_ATTRIBUTE_STANDARD_SIZE`][crate::FILE_ATTRIBUTE_STANDARD_SIZE] attribute in the file info
1061 /// to the given size.
1062 /// ## `size`
1063 /// a #goffset containing the file's size.
1064 #[doc(alias = "g_file_info_set_size")]
1065 pub fn set_size(&self, size: i64) {
1066 unsafe {
1067 ffi::g_file_info_set_size(self.to_glib_none().0, size);
1068 }
1069 }
1070
1071 /// Sets the sort order attribute in the file info structure. See
1072 /// [`FILE_ATTRIBUTE_STANDARD_SORT_ORDER`][crate::FILE_ATTRIBUTE_STANDARD_SORT_ORDER].
1073 /// ## `sort_order`
1074 /// a sort order integer.
1075 #[doc(alias = "g_file_info_set_sort_order")]
1076 pub fn set_sort_order(&self, sort_order: i32) {
1077 unsafe {
1078 ffi::g_file_info_set_sort_order(self.to_glib_none().0, sort_order);
1079 }
1080 }
1081
1082 /// Sets the symbolic icon for a given #GFileInfo.
1083 /// See [`FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON`][crate::FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON].
1084 /// ## `icon`
1085 /// a #GIcon.
1086 #[doc(alias = "g_file_info_set_symbolic_icon")]
1087 pub fn set_symbolic_icon(&self, icon: &impl IsA<Icon>) {
1088 unsafe {
1089 ffi::g_file_info_set_symbolic_icon(
1090 self.to_glib_none().0,
1091 icon.as_ref().to_glib_none().0,
1092 );
1093 }
1094 }
1095
1096 /// Sets the [`FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET`][crate::FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET] attribute in the file info
1097 /// to the given symlink target.
1098 /// ## `symlink_target`
1099 /// a static string containing a path to a symlink target.
1100 #[doc(alias = "g_file_info_set_symlink_target")]
1101 pub fn set_symlink_target(&self, symlink_target: impl AsRef<std::path::Path>) {
1102 unsafe {
1103 ffi::g_file_info_set_symlink_target(
1104 self.to_glib_none().0,
1105 symlink_target.as_ref().to_glib_none().0,
1106 );
1107 }
1108 }
1109
1110 /// Unsets a mask set by g_file_info_set_attribute_mask(), if one
1111 /// is set.
1112 #[doc(alias = "g_file_info_unset_attribute_mask")]
1113 pub fn unset_attribute_mask(&self) {
1114 unsafe {
1115 ffi::g_file_info_unset_attribute_mask(self.to_glib_none().0);
1116 }
1117 }
1118}
1119
1120impl Default for FileInfo {
1121 fn default() -> Self {
1122 Self::new()
1123 }
1124}