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::{ffi, FileAttributeMatcher, FileAttributeStatus, FileAttributeType, FileType, Icon};
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 /// It is an error to call this if the #GFileInfo does not contain
506 /// [`FILE_ATTRIBUTE_STANDARD_IS_BACKUP`][crate::FILE_ATTRIBUTE_STANDARD_IS_BACKUP].
507 ///
508 /// # Returns
509 ///
510 /// [`true`] if file is a backup file, [`false`] otherwise.
511 #[doc(alias = "g_file_info_get_is_backup")]
512 #[doc(alias = "get_is_backup")]
513 pub fn is_backup(&self) -> bool {
514 unsafe { from_glib(ffi::g_file_info_get_is_backup(self.to_glib_none().0)) }
515 }
516
517 /// Checks if a file is hidden.
518 ///
519 /// It is an error to call this if the #GFileInfo does not contain
520 /// [`FILE_ATTRIBUTE_STANDARD_IS_HIDDEN`][crate::FILE_ATTRIBUTE_STANDARD_IS_HIDDEN].
521 ///
522 /// # Returns
523 ///
524 /// [`true`] if the file is a hidden file, [`false`] otherwise.
525 #[doc(alias = "g_file_info_get_is_hidden")]
526 #[doc(alias = "get_is_hidden")]
527 pub fn is_hidden(&self) -> bool {
528 unsafe { from_glib(ffi::g_file_info_get_is_hidden(self.to_glib_none().0)) }
529 }
530
531 /// Checks if a file is a symlink.
532 ///
533 /// It is an error to call this if the #GFileInfo does not contain
534 /// [`FILE_ATTRIBUTE_STANDARD_IS_SYMLINK`][crate::FILE_ATTRIBUTE_STANDARD_IS_SYMLINK].
535 ///
536 /// # Returns
537 ///
538 /// [`true`] if the given @self is a symlink.
539 #[doc(alias = "g_file_info_get_is_symlink")]
540 #[doc(alias = "get_is_symlink")]
541 pub fn is_symlink(&self) -> bool {
542 unsafe { from_glib(ffi::g_file_info_get_is_symlink(self.to_glib_none().0)) }
543 }
544
545 /// Gets the modification time of the current @self and returns it as a
546 /// #GDateTime.
547 ///
548 /// It is an error to call this if the #GFileInfo does not contain
549 /// [`FILE_ATTRIBUTE_TIME_MODIFIED`][crate::FILE_ATTRIBUTE_TIME_MODIFIED]. If [`FILE_ATTRIBUTE_TIME_MODIFIED_USEC`][crate::FILE_ATTRIBUTE_TIME_MODIFIED_USEC] is
550 /// provided, the resulting #GDateTime will additionally have microsecond
551 /// precision.
552 ///
553 /// If nanosecond precision is needed, [`FILE_ATTRIBUTE_TIME_MODIFIED_NSEC`][crate::FILE_ATTRIBUTE_TIME_MODIFIED_NSEC] must
554 /// be queried separately using g_file_info_get_attribute_uint32().
555 ///
556 /// # Returns
557 ///
558 /// modification time, or [`None`] if unknown
559 #[cfg(feature = "v2_62")]
560 #[cfg_attr(docsrs, doc(cfg(feature = "v2_62")))]
561 #[doc(alias = "g_file_info_get_modification_date_time")]
562 #[doc(alias = "get_modification_date_time")]
563 pub fn modification_date_time(&self) -> Option<glib::DateTime> {
564 unsafe {
565 from_glib_full(ffi::g_file_info_get_modification_date_time(
566 self.to_glib_none().0,
567 ))
568 }
569 }
570
571 /// Gets the name for a file. This is guaranteed to always be set.
572 ///
573 /// It is an error to call this if the #GFileInfo does not contain
574 /// [`FILE_ATTRIBUTE_STANDARD_NAME`][crate::FILE_ATTRIBUTE_STANDARD_NAME].
575 ///
576 /// # Returns
577 ///
578 /// a string containing the file name.
579 #[doc(alias = "g_file_info_get_name")]
580 #[doc(alias = "get_name")]
581 pub fn name(&self) -> std::path::PathBuf {
582 unsafe { from_glib_none(ffi::g_file_info_get_name(self.to_glib_none().0)) }
583 }
584
585 /// Gets the file's size (in bytes). The size is retrieved through the value of
586 /// the [`FILE_ATTRIBUTE_STANDARD_SIZE`][crate::FILE_ATTRIBUTE_STANDARD_SIZE] attribute and is converted
587 /// from #guint64 to #goffset before returning the result.
588 ///
589 /// It is an error to call this if the #GFileInfo does not contain
590 /// [`FILE_ATTRIBUTE_STANDARD_SIZE`][crate::FILE_ATTRIBUTE_STANDARD_SIZE].
591 ///
592 /// # Returns
593 ///
594 /// a #goffset containing the file's size (in bytes).
595 #[doc(alias = "g_file_info_get_size")]
596 #[doc(alias = "get_size")]
597 pub fn size(&self) -> i64 {
598 unsafe { ffi::g_file_info_get_size(self.to_glib_none().0) }
599 }
600
601 /// Gets the value of the sort_order attribute from the #GFileInfo.
602 /// See [`FILE_ATTRIBUTE_STANDARD_SORT_ORDER`][crate::FILE_ATTRIBUTE_STANDARD_SORT_ORDER].
603 ///
604 /// It is an error to call this if the #GFileInfo does not contain
605 /// [`FILE_ATTRIBUTE_STANDARD_SORT_ORDER`][crate::FILE_ATTRIBUTE_STANDARD_SORT_ORDER].
606 ///
607 /// # Returns
608 ///
609 /// a #gint32 containing the value of the "standard::sort_order" attribute.
610 #[doc(alias = "g_file_info_get_sort_order")]
611 #[doc(alias = "get_sort_order")]
612 pub fn sort_order(&self) -> i32 {
613 unsafe { ffi::g_file_info_get_sort_order(self.to_glib_none().0) }
614 }
615
616 /// Gets the symbolic icon for a file.
617 ///
618 /// It is an error to call this if the #GFileInfo does not contain
619 /// [`FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON`][crate::FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON].
620 ///
621 /// # Returns
622 ///
623 /// #GIcon for the given @self.
624 #[doc(alias = "g_file_info_get_symbolic_icon")]
625 #[doc(alias = "get_symbolic_icon")]
626 pub fn symbolic_icon(&self) -> Option<Icon> {
627 unsafe { from_glib_none(ffi::g_file_info_get_symbolic_icon(self.to_glib_none().0)) }
628 }
629
630 /// Gets the symlink target for a given #GFileInfo.
631 ///
632 /// It is an error to call this if the #GFileInfo does not contain
633 /// [`FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET`][crate::FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET].
634 ///
635 /// # Returns
636 ///
637 /// a string containing the symlink target.
638 #[doc(alias = "g_file_info_get_symlink_target")]
639 #[doc(alias = "get_symlink_target")]
640 pub fn symlink_target(&self) -> Option<std::path::PathBuf> {
641 unsafe { from_glib_none(ffi::g_file_info_get_symlink_target(self.to_glib_none().0)) }
642 }
643
644 /// Checks if a file info structure has an attribute named @attribute.
645 /// ## `attribute`
646 /// a file attribute key.
647 ///
648 /// # Returns
649 ///
650 /// [`true`] if @self has an attribute named @attribute,
651 /// [`false`] otherwise.
652 #[doc(alias = "g_file_info_has_attribute")]
653 pub fn has_attribute(&self, attribute: &str) -> bool {
654 unsafe {
655 from_glib(ffi::g_file_info_has_attribute(
656 self.to_glib_none().0,
657 attribute.to_glib_none().0,
658 ))
659 }
660 }
661
662 /// Checks if a file info structure has an attribute in the
663 /// specified @name_space.
664 /// ## `name_space`
665 /// a file attribute namespace.
666 ///
667 /// # Returns
668 ///
669 /// [`true`] if @self has an attribute in @name_space,
670 /// [`false`] otherwise.
671 #[doc(alias = "g_file_info_has_namespace")]
672 pub fn has_namespace(&self, name_space: &str) -> bool {
673 unsafe {
674 from_glib(ffi::g_file_info_has_namespace(
675 self.to_glib_none().0,
676 name_space.to_glib_none().0,
677 ))
678 }
679 }
680
681 /// Lists the file info structure's attributes.
682 /// ## `name_space`
683 /// a file attribute key's namespace, or [`None`] to list
684 /// all attributes.
685 ///
686 /// # Returns
687 ///
688 /// a
689 /// null-terminated array of strings of all of the possible attribute
690 /// types for the given @name_space, or [`None`] on error.
691 #[doc(alias = "g_file_info_list_attributes")]
692 pub fn list_attributes(&self, name_space: Option<&str>) -> Vec<glib::GString> {
693 unsafe {
694 FromGlibPtrContainer::from_glib_full(ffi::g_file_info_list_attributes(
695 self.to_glib_none().0,
696 name_space.to_glib_none().0,
697 ))
698 }
699 }
700
701 /// Removes all cases of @attribute from @self if it exists.
702 /// ## `attribute`
703 /// a file attribute key.
704 #[doc(alias = "g_file_info_remove_attribute")]
705 pub fn remove_attribute(&self, attribute: &str) {
706 unsafe {
707 ffi::g_file_info_remove_attribute(self.to_glib_none().0, attribute.to_glib_none().0);
708 }
709 }
710
711 /// Sets the [`FILE_ATTRIBUTE_TIME_ACCESS`][crate::FILE_ATTRIBUTE_TIME_ACCESS] and
712 /// [`FILE_ATTRIBUTE_TIME_ACCESS_USEC`][crate::FILE_ATTRIBUTE_TIME_ACCESS_USEC] attributes in the file info to the
713 /// given date/time value.
714 ///
715 /// [`FILE_ATTRIBUTE_TIME_ACCESS_NSEC`][crate::FILE_ATTRIBUTE_TIME_ACCESS_NSEC] will be cleared.
716 /// ## `atime`
717 /// a #GDateTime.
718 #[cfg(feature = "v2_70")]
719 #[cfg_attr(docsrs, doc(cfg(feature = "v2_70")))]
720 #[doc(alias = "g_file_info_set_access_date_time")]
721 pub fn set_access_date_time(&self, atime: &glib::DateTime) {
722 unsafe {
723 ffi::g_file_info_set_access_date_time(self.to_glib_none().0, atime.to_glib_none().0);
724 }
725 }
726
727 //#[doc(alias = "g_file_info_set_attribute")]
728 //pub fn set_attribute(&self, attribute: &str, type_: FileAttributeType, value_p: /*Unimplemented*/Basic: Pointer) {
729 // unsafe { TODO: call ffi:g_file_info_set_attribute() }
730 //}
731
732 /// Sets the @attribute to contain the given @attr_value,
733 /// if possible.
734 /// ## `attribute`
735 /// a file attribute key.
736 /// ## `attr_value`
737 /// a boolean value.
738 #[doc(alias = "g_file_info_set_attribute_boolean")]
739 pub fn set_attribute_boolean(&self, attribute: &str, attr_value: bool) {
740 unsafe {
741 ffi::g_file_info_set_attribute_boolean(
742 self.to_glib_none().0,
743 attribute.to_glib_none().0,
744 attr_value.into_glib(),
745 );
746 }
747 }
748
749 /// Sets the @attribute to contain the given @attr_value,
750 /// if possible.
751 /// ## `attribute`
752 /// a file attribute key.
753 /// ## `attr_value`
754 /// a byte string.
755 #[doc(alias = "g_file_info_set_attribute_byte_string")]
756 pub fn set_attribute_byte_string(&self, attribute: &str, attr_value: &str) {
757 unsafe {
758 ffi::g_file_info_set_attribute_byte_string(
759 self.to_glib_none().0,
760 attribute.to_glib_none().0,
761 attr_value.to_glib_none().0,
762 );
763 }
764 }
765
766 /// Sets the @attribute to contain the given @attr_value,
767 /// if possible.
768 ///
769 /// This function is meant to be used by language bindings that have specific
770 /// handling for Unix paths.
771 /// ## `attribute`
772 /// a file attribute key.
773 /// ## `attr_value`
774 /// a file path.
775 #[cfg(feature = "v2_78")]
776 #[cfg_attr(docsrs, doc(cfg(feature = "v2_78")))]
777 #[doc(alias = "g_file_info_set_attribute_file_path")]
778 pub fn set_attribute_file_path(
779 &self,
780 attribute: &str,
781 attr_value: impl AsRef<std::path::Path>,
782 ) {
783 unsafe {
784 ffi::g_file_info_set_attribute_file_path(
785 self.to_glib_none().0,
786 attribute.to_glib_none().0,
787 attr_value.as_ref().to_glib_none().0,
788 );
789 }
790 }
791
792 /// Sets the @attribute to contain the given @attr_value,
793 /// if possible.
794 /// ## `attribute`
795 /// a file attribute key.
796 /// ## `attr_value`
797 /// a signed 32-bit integer
798 #[doc(alias = "g_file_info_set_attribute_int32")]
799 pub fn set_attribute_int32(&self, attribute: &str, attr_value: i32) {
800 unsafe {
801 ffi::g_file_info_set_attribute_int32(
802 self.to_glib_none().0,
803 attribute.to_glib_none().0,
804 attr_value,
805 );
806 }
807 }
808
809 /// Sets the @attribute to contain the given @attr_value,
810 /// if possible.
811 /// ## `attribute`
812 /// attribute name to set.
813 /// ## `attr_value`
814 /// int64 value to set attribute to.
815 #[doc(alias = "g_file_info_set_attribute_int64")]
816 pub fn set_attribute_int64(&self, attribute: &str, attr_value: i64) {
817 unsafe {
818 ffi::g_file_info_set_attribute_int64(
819 self.to_glib_none().0,
820 attribute.to_glib_none().0,
821 attr_value,
822 );
823 }
824 }
825
826 /// Sets @mask on @self to match specific attribute types.
827 /// ## `mask`
828 /// a #GFileAttributeMatcher.
829 #[doc(alias = "g_file_info_set_attribute_mask")]
830 pub fn set_attribute_mask(&self, mask: &FileAttributeMatcher) {
831 unsafe {
832 ffi::g_file_info_set_attribute_mask(self.to_glib_none().0, mask.to_glib_none().0);
833 }
834 }
835
836 /// Sets the @attribute to contain the given @attr_value,
837 /// if possible.
838 /// ## `attribute`
839 /// a file attribute key.
840 /// ## `attr_value`
841 /// a #GObject.
842 #[doc(alias = "g_file_info_set_attribute_object")]
843 pub fn set_attribute_object(&self, attribute: &str, attr_value: &impl IsA<glib::Object>) {
844 unsafe {
845 ffi::g_file_info_set_attribute_object(
846 self.to_glib_none().0,
847 attribute.to_glib_none().0,
848 attr_value.as_ref().to_glib_none().0,
849 );
850 }
851 }
852
853 /// Sets the attribute status for an attribute key. This is only
854 /// needed by external code that implement g_file_set_attributes_from_info()
855 /// or similar functions.
856 ///
857 /// The attribute must exist in @self for this to work. Otherwise [`false`]
858 /// is returned and @self is unchanged.
859 /// ## `attribute`
860 /// a file attribute key
861 /// ## `status`
862 /// a #GFileAttributeStatus
863 ///
864 /// # Returns
865 ///
866 /// [`true`] if the status was changed, [`false`] if the key was not set.
867 #[doc(alias = "g_file_info_set_attribute_status")]
868 pub fn set_attribute_status(&self, attribute: &str, status: FileAttributeStatus) -> bool {
869 unsafe {
870 from_glib(ffi::g_file_info_set_attribute_status(
871 self.to_glib_none().0,
872 attribute.to_glib_none().0,
873 status.into_glib(),
874 ))
875 }
876 }
877
878 /// Sets the @attribute to contain the given @attr_value,
879 /// if possible.
880 /// ## `attribute`
881 /// a file attribute key.
882 /// ## `attr_value`
883 /// a UTF-8 string.
884 #[doc(alias = "g_file_info_set_attribute_string")]
885 pub fn set_attribute_string(&self, attribute: &str, attr_value: &str) {
886 unsafe {
887 ffi::g_file_info_set_attribute_string(
888 self.to_glib_none().0,
889 attribute.to_glib_none().0,
890 attr_value.to_glib_none().0,
891 );
892 }
893 }
894
895 /// Sets the @attribute to contain the given @attr_value,
896 /// if possible.
897 /// ## `attribute`
898 /// a file attribute key.
899 /// ## `attr_value`
900 /// an unsigned 32-bit integer.
901 #[doc(alias = "g_file_info_set_attribute_uint32")]
902 pub fn set_attribute_uint32(&self, attribute: &str, attr_value: u32) {
903 unsafe {
904 ffi::g_file_info_set_attribute_uint32(
905 self.to_glib_none().0,
906 attribute.to_glib_none().0,
907 attr_value,
908 );
909 }
910 }
911
912 /// Sets the @attribute to contain the given @attr_value,
913 /// if possible.
914 /// ## `attribute`
915 /// a file attribute key.
916 /// ## `attr_value`
917 /// an unsigned 64-bit integer.
918 #[doc(alias = "g_file_info_set_attribute_uint64")]
919 pub fn set_attribute_uint64(&self, attribute: &str, attr_value: u64) {
920 unsafe {
921 ffi::g_file_info_set_attribute_uint64(
922 self.to_glib_none().0,
923 attribute.to_glib_none().0,
924 attr_value,
925 );
926 }
927 }
928
929 /// Sets the content type attribute for a given #GFileInfo.
930 /// See [`FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE`][crate::FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE].
931 /// ## `content_type`
932 /// a [content type](content-types.html#content-types).
933 #[doc(alias = "g_file_info_set_content_type")]
934 pub fn set_content_type(&self, content_type: &str) {
935 unsafe {
936 ffi::g_file_info_set_content_type(self.to_glib_none().0, content_type.to_glib_none().0);
937 }
938 }
939
940 /// Sets the [`FILE_ATTRIBUTE_TIME_CREATED`][crate::FILE_ATTRIBUTE_TIME_CREATED] and
941 /// [`FILE_ATTRIBUTE_TIME_CREATED_USEC`][crate::FILE_ATTRIBUTE_TIME_CREATED_USEC] attributes in the file info to the
942 /// given date/time value.
943 ///
944 /// [`FILE_ATTRIBUTE_TIME_CREATED_NSEC`][crate::FILE_ATTRIBUTE_TIME_CREATED_NSEC] will be cleared.
945 /// ## `creation_time`
946 /// a #GDateTime.
947 #[cfg(feature = "v2_70")]
948 #[cfg_attr(docsrs, doc(cfg(feature = "v2_70")))]
949 #[doc(alias = "g_file_info_set_creation_date_time")]
950 pub fn set_creation_date_time(&self, creation_time: &glib::DateTime) {
951 unsafe {
952 ffi::g_file_info_set_creation_date_time(
953 self.to_glib_none().0,
954 creation_time.to_glib_none().0,
955 );
956 }
957 }
958
959 /// Sets the display name for the current #GFileInfo.
960 /// See [`FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME`][crate::FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME].
961 /// ## `display_name`
962 /// a string containing a display name.
963 #[doc(alias = "g_file_info_set_display_name")]
964 pub fn set_display_name(&self, display_name: &str) {
965 unsafe {
966 ffi::g_file_info_set_display_name(self.to_glib_none().0, display_name.to_glib_none().0);
967 }
968 }
969
970 /// Sets the edit name for the current file.
971 /// See [`FILE_ATTRIBUTE_STANDARD_EDIT_NAME`][crate::FILE_ATTRIBUTE_STANDARD_EDIT_NAME].
972 /// ## `edit_name`
973 /// a string containing an edit name.
974 #[doc(alias = "g_file_info_set_edit_name")]
975 pub fn set_edit_name(&self, edit_name: &str) {
976 unsafe {
977 ffi::g_file_info_set_edit_name(self.to_glib_none().0, edit_name.to_glib_none().0);
978 }
979 }
980
981 /// Sets the file type in a #GFileInfo to @type_.
982 /// See [`FILE_ATTRIBUTE_STANDARD_TYPE`][crate::FILE_ATTRIBUTE_STANDARD_TYPE].
983 /// ## `type_`
984 /// a #GFileType.
985 #[doc(alias = "g_file_info_set_file_type")]
986 pub fn set_file_type(&self, type_: FileType) {
987 unsafe {
988 ffi::g_file_info_set_file_type(self.to_glib_none().0, type_.into_glib());
989 }
990 }
991
992 /// Sets the icon for a given #GFileInfo.
993 /// See [`FILE_ATTRIBUTE_STANDARD_ICON`][crate::FILE_ATTRIBUTE_STANDARD_ICON].
994 /// ## `icon`
995 /// a #GIcon.
996 #[doc(alias = "g_file_info_set_icon")]
997 pub fn set_icon(&self, icon: &impl IsA<Icon>) {
998 unsafe {
999 ffi::g_file_info_set_icon(self.to_glib_none().0, icon.as_ref().to_glib_none().0);
1000 }
1001 }
1002
1003 /// Sets the "is_hidden" attribute in a #GFileInfo according to @is_hidden.
1004 /// See [`FILE_ATTRIBUTE_STANDARD_IS_HIDDEN`][crate::FILE_ATTRIBUTE_STANDARD_IS_HIDDEN].
1005 /// ## `is_hidden`
1006 /// a #gboolean.
1007 #[doc(alias = "g_file_info_set_is_hidden")]
1008 pub fn set_is_hidden(&self, is_hidden: bool) {
1009 unsafe {
1010 ffi::g_file_info_set_is_hidden(self.to_glib_none().0, is_hidden.into_glib());
1011 }
1012 }
1013
1014 /// Sets the "is_symlink" attribute in a #GFileInfo according to @is_symlink.
1015 /// See [`FILE_ATTRIBUTE_STANDARD_IS_SYMLINK`][crate::FILE_ATTRIBUTE_STANDARD_IS_SYMLINK].
1016 /// ## `is_symlink`
1017 /// a #gboolean.
1018 #[doc(alias = "g_file_info_set_is_symlink")]
1019 pub fn set_is_symlink(&self, is_symlink: bool) {
1020 unsafe {
1021 ffi::g_file_info_set_is_symlink(self.to_glib_none().0, is_symlink.into_glib());
1022 }
1023 }
1024
1025 /// Sets the [`FILE_ATTRIBUTE_TIME_MODIFIED`][crate::FILE_ATTRIBUTE_TIME_MODIFIED] and
1026 /// [`FILE_ATTRIBUTE_TIME_MODIFIED_USEC`][crate::FILE_ATTRIBUTE_TIME_MODIFIED_USEC] attributes in the file info to the
1027 /// given date/time value.
1028 ///
1029 /// [`FILE_ATTRIBUTE_TIME_MODIFIED_NSEC`][crate::FILE_ATTRIBUTE_TIME_MODIFIED_NSEC] will be cleared.
1030 /// ## `mtime`
1031 /// a #GDateTime.
1032 #[cfg(feature = "v2_62")]
1033 #[cfg_attr(docsrs, doc(cfg(feature = "v2_62")))]
1034 #[doc(alias = "g_file_info_set_modification_date_time")]
1035 pub fn set_modification_date_time(&self, mtime: &glib::DateTime) {
1036 unsafe {
1037 ffi::g_file_info_set_modification_date_time(
1038 self.to_glib_none().0,
1039 mtime.to_glib_none().0,
1040 );
1041 }
1042 }
1043
1044 /// Sets the name attribute for the current #GFileInfo.
1045 /// See [`FILE_ATTRIBUTE_STANDARD_NAME`][crate::FILE_ATTRIBUTE_STANDARD_NAME].
1046 /// ## `name`
1047 /// a string containing a name.
1048 #[doc(alias = "g_file_info_set_name")]
1049 pub fn set_name(&self, name: impl AsRef<std::path::Path>) {
1050 unsafe {
1051 ffi::g_file_info_set_name(self.to_glib_none().0, name.as_ref().to_glib_none().0);
1052 }
1053 }
1054
1055 /// Sets the [`FILE_ATTRIBUTE_STANDARD_SIZE`][crate::FILE_ATTRIBUTE_STANDARD_SIZE] attribute in the file info
1056 /// to the given size.
1057 /// ## `size`
1058 /// a #goffset containing the file's size.
1059 #[doc(alias = "g_file_info_set_size")]
1060 pub fn set_size(&self, size: i64) {
1061 unsafe {
1062 ffi::g_file_info_set_size(self.to_glib_none().0, size);
1063 }
1064 }
1065
1066 /// Sets the sort order attribute in the file info structure. See
1067 /// [`FILE_ATTRIBUTE_STANDARD_SORT_ORDER`][crate::FILE_ATTRIBUTE_STANDARD_SORT_ORDER].
1068 /// ## `sort_order`
1069 /// a sort order integer.
1070 #[doc(alias = "g_file_info_set_sort_order")]
1071 pub fn set_sort_order(&self, sort_order: i32) {
1072 unsafe {
1073 ffi::g_file_info_set_sort_order(self.to_glib_none().0, sort_order);
1074 }
1075 }
1076
1077 /// Sets the symbolic icon for a given #GFileInfo.
1078 /// See [`FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON`][crate::FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON].
1079 /// ## `icon`
1080 /// a #GIcon.
1081 #[doc(alias = "g_file_info_set_symbolic_icon")]
1082 pub fn set_symbolic_icon(&self, icon: &impl IsA<Icon>) {
1083 unsafe {
1084 ffi::g_file_info_set_symbolic_icon(
1085 self.to_glib_none().0,
1086 icon.as_ref().to_glib_none().0,
1087 );
1088 }
1089 }
1090
1091 /// Sets the [`FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET`][crate::FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET] attribute in the file info
1092 /// to the given symlink target.
1093 /// ## `symlink_target`
1094 /// a static string containing a path to a symlink target.
1095 #[doc(alias = "g_file_info_set_symlink_target")]
1096 pub fn set_symlink_target(&self, symlink_target: impl AsRef<std::path::Path>) {
1097 unsafe {
1098 ffi::g_file_info_set_symlink_target(
1099 self.to_glib_none().0,
1100 symlink_target.as_ref().to_glib_none().0,
1101 );
1102 }
1103 }
1104
1105 /// Unsets a mask set by g_file_info_set_attribute_mask(), if one
1106 /// is set.
1107 #[doc(alias = "g_file_info_unset_attribute_mask")]
1108 pub fn unset_attribute_mask(&self) {
1109 unsafe {
1110 ffi::g_file_info_unset_attribute_mask(self.to_glib_none().0);
1111 }
1112 }
1113}
1114
1115impl Default for FileInfo {
1116 fn default() -> Self {
1117 Self::new()
1118 }
1119}