1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD 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
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gio.FileInfo;
26 
27 private import gio.FileAttributeMatcher;
28 private import gio.Icon;
29 private import gio.IconIF;
30 private import glib.ConstructionException;
31 private import glib.DateTime;
32 private import glib.Str;
33 private import glib.TimeVal;
34 private import gobject.ObjectG;
35 private import gtkc.gio;
36 public  import gtkc.giotypes;
37 
38 
39 /**
40  * Functionality for manipulating basic metadata for files. #GFileInfo
41  * implements methods for getting information that all files should
42  * contain, and allows for manipulation of extended attributes.
43  * 
44  * See [GFileAttribute][gio-GFileAttribute] for more information on how
45  * GIO handles file attributes.
46  * 
47  * To obtain a #GFileInfo for a #GFile, use g_file_query_info() (or its
48  * async variant). To obtain a #GFileInfo for a file input or output
49  * stream, use g_file_input_stream_query_info() or
50  * g_file_output_stream_query_info() (or their async variants).
51  * 
52  * To change the actual attributes of a file, you should then set the
53  * attribute in the #GFileInfo and call g_file_set_attributes_from_info()
54  * or g_file_set_attributes_async() on a GFile.
55  * 
56  * However, not all attributes can be changed in the file. For instance,
57  * the actual size of a file cannot be changed via g_file_info_set_size().
58  * You may call g_file_query_settable_attributes() and
59  * g_file_query_writable_namespaces() to discover the settable attributes
60  * of a particular file at runtime.
61  * 
62  * #GFileAttributeMatcher allows for searching through a #GFileInfo for
63  * attributes.
64  */
65 public class FileInfo : ObjectG
66 {
67 	/** the main Gtk struct */
68 	protected GFileInfo* gFileInfo;
69 
70 	/** Get the main Gtk struct */
71 	public GFileInfo* getFileInfoStruct()
72 	{
73 		return gFileInfo;
74 	}
75 
76 	/** the main Gtk struct as a void* */
77 	protected override void* getStruct()
78 	{
79 		return cast(void*)gFileInfo;
80 	}
81 
82 	protected override void setStruct(GObject* obj)
83 	{
84 		gFileInfo = cast(GFileInfo*)obj;
85 		super.setStruct(obj);
86 	}
87 
88 	/**
89 	 * Sets our main struct and passes it to the parent class.
90 	 */
91 	public this (GFileInfo* gFileInfo, bool ownedRef = false)
92 	{
93 		this.gFileInfo = gFileInfo;
94 		super(cast(GObject*)gFileInfo, ownedRef);
95 	}
96 
97 
98 	/** */
99 	public static GType getType()
100 	{
101 		return g_file_info_get_type();
102 	}
103 
104 	/**
105 	 * Creates a new file info structure.
106 	 *
107 	 * Return: a #GFileInfo.
108 	 *
109 	 * Throws: ConstructionException GTK+ fails to create the object.
110 	 */
111 	public this()
112 	{
113 		auto p = g_file_info_new();
114 		
115 		if(p is null)
116 		{
117 			throw new ConstructionException("null returned by new");
118 		}
119 		
120 		this(cast(GFileInfo*) p, true);
121 	}
122 
123 	/**
124 	 * Clears the status information from @info.
125 	 */
126 	public void clearStatus()
127 	{
128 		g_file_info_clear_status(gFileInfo);
129 	}
130 
131 	/**
132 	 * Copies all of the [GFileAttribute][gio-GFileAttribute]
133 	 * from @src_info to @dest_info.
134 	 *
135 	 * Params:
136 	 *     destInfo = destination to copy attributes to.
137 	 */
138 	public void copyInto(FileInfo destInfo)
139 	{
140 		g_file_info_copy_into(gFileInfo, (destInfo is null) ? null : destInfo.getFileInfoStruct());
141 	}
142 
143 	/**
144 	 * Duplicates a file info structure.
145 	 *
146 	 * Return: a duplicate #GFileInfo of @other.
147 	 */
148 	public FileInfo dup()
149 	{
150 		auto p = g_file_info_dup(gFileInfo);
151 		
152 		if(p is null)
153 		{
154 			return null;
155 		}
156 		
157 		return ObjectG.getDObject!(FileInfo)(cast(GFileInfo*) p, true);
158 	}
159 
160 	/**
161 	 * Gets the value of a attribute, formated as a string.
162 	 * This escapes things as needed to make the string valid
163 	 * utf8.
164 	 *
165 	 * Params:
166 	 *     attribute = a file attribute key.
167 	 *
168 	 * Return: a UTF-8 string associated with the given @attribute.
169 	 *     When you're done with the string it must be freed with g_free().
170 	 */
171 	public string getAttributeAsString(string attribute)
172 	{
173 		return Str.toString(g_file_info_get_attribute_as_string(gFileInfo, Str.toStringz(attribute)));
174 	}
175 
176 	/**
177 	 * Gets the value of a boolean attribute. If the attribute does not
178 	 * contain a boolean value, %FALSE will be returned.
179 	 *
180 	 * Params:
181 	 *     attribute = a file attribute key.
182 	 *
183 	 * Return: the boolean value contained within the attribute.
184 	 */
185 	public bool getAttributeBoolean(string attribute)
186 	{
187 		return g_file_info_get_attribute_boolean(gFileInfo, Str.toStringz(attribute)) != 0;
188 	}
189 
190 	/**
191 	 * Gets the value of a byte string attribute. If the attribute does
192 	 * not contain a byte string, %NULL will be returned.
193 	 *
194 	 * Params:
195 	 *     attribute = a file attribute key.
196 	 *
197 	 * Return: the contents of the @attribute value as a byte string, or
198 	 *     %NULL otherwise.
199 	 */
200 	public string getAttributeByteString(string attribute)
201 	{
202 		return Str.toString(g_file_info_get_attribute_byte_string(gFileInfo, Str.toStringz(attribute)));
203 	}
204 
205 	/**
206 	 * Gets the attribute type, value and status for an attribute key.
207 	 *
208 	 * Params:
209 	 *     attribute = a file attribute key
210 	 *     type = return location for the attribute type, or %NULL
211 	 *     valuePp = return location for the attribute value, or %NULL
212 	 *     status = return location for the attribute status, or %NULL
213 	 *
214 	 * Return: %TRUE if @info has an attribute named @attribute,
215 	 *     %FALSE otherwise.
216 	 */
217 	public bool getAttributeData(string attribute, out GFileAttributeType type, out void* valuePp, out GFileAttributeStatus status)
218 	{
219 		return g_file_info_get_attribute_data(gFileInfo, Str.toStringz(attribute), &type, &valuePp, &status) != 0;
220 	}
221 
222 	/**
223 	 * Gets a signed 32-bit integer contained within the attribute. If the
224 	 * attribute does not contain a signed 32-bit integer, or is invalid,
225 	 * 0 will be returned.
226 	 *
227 	 * Params:
228 	 *     attribute = a file attribute key.
229 	 *
230 	 * Return: a signed 32-bit integer from the attribute.
231 	 */
232 	public int getAttributeInt32(string attribute)
233 	{
234 		return g_file_info_get_attribute_int32(gFileInfo, Str.toStringz(attribute));
235 	}
236 
237 	/**
238 	 * Gets a signed 64-bit integer contained within the attribute. If the
239 	 * attribute does not contain an signed 64-bit integer, or is invalid,
240 	 * 0 will be returned.
241 	 *
242 	 * Params:
243 	 *     attribute = a file attribute key.
244 	 *
245 	 * Return: a signed 64-bit integer from the attribute.
246 	 */
247 	public long getAttributeInt64(string attribute)
248 	{
249 		return g_file_info_get_attribute_int64(gFileInfo, Str.toStringz(attribute));
250 	}
251 
252 	/**
253 	 * Gets the value of a #GObject attribute. If the attribute does
254 	 * not contain a #GObject, %NULL will be returned.
255 	 *
256 	 * Params:
257 	 *     attribute = a file attribute key.
258 	 *
259 	 * Return: a #GObject associated with the given @attribute, or
260 	 *     %NULL otherwise.
261 	 */
262 	public ObjectG getAttributeObject(string attribute)
263 	{
264 		auto p = g_file_info_get_attribute_object(gFileInfo, Str.toStringz(attribute));
265 		
266 		if(p is null)
267 		{
268 			return null;
269 		}
270 		
271 		return ObjectG.getDObject!(ObjectG)(cast(GObject*) p);
272 	}
273 
274 	/**
275 	 * Gets the attribute status for an attribute key.
276 	 *
277 	 * Params:
278 	 *     attribute = a file attribute key
279 	 *
280 	 * Return: a #GFileAttributeStatus for the given @attribute, or
281 	 *     %G_FILE_ATTRIBUTE_STATUS_UNSET if the key is invalid.
282 	 */
283 	public GFileAttributeStatus getAttributeStatus(string attribute)
284 	{
285 		return g_file_info_get_attribute_status(gFileInfo, Str.toStringz(attribute));
286 	}
287 
288 	/**
289 	 * Gets the value of a string attribute. If the attribute does
290 	 * not contain a string, %NULL will be returned.
291 	 *
292 	 * Params:
293 	 *     attribute = a file attribute key.
294 	 *
295 	 * Return: the contents of the @attribute value as a UTF-8 string, or
296 	 *     %NULL otherwise.
297 	 */
298 	public string getAttributeString(string attribute)
299 	{
300 		return Str.toString(g_file_info_get_attribute_string(gFileInfo, Str.toStringz(attribute)));
301 	}
302 
303 	/**
304 	 * Gets the value of a stringv attribute. If the attribute does
305 	 * not contain a stringv, %NULL will be returned.
306 	 *
307 	 * Params:
308 	 *     attribute = a file attribute key.
309 	 *
310 	 * Return: the contents of the @attribute value as a stringv, or
311 	 *     %NULL otherwise. Do not free. These returned strings are UTF-8.
312 	 *
313 	 * Since: 2.22
314 	 */
315 	public string[] getAttributeStringv(string attribute)
316 	{
317 		return Str.toStringArray(g_file_info_get_attribute_stringv(gFileInfo, Str.toStringz(attribute)));
318 	}
319 
320 	/**
321 	 * Gets the attribute type for an attribute key.
322 	 *
323 	 * Params:
324 	 *     attribute = a file attribute key.
325 	 *
326 	 * Return: a #GFileAttributeType for the given @attribute, or
327 	 *     %G_FILE_ATTRIBUTE_TYPE_INVALID if the key is not set.
328 	 */
329 	public GFileAttributeType getAttributeType(string attribute)
330 	{
331 		return g_file_info_get_attribute_type(gFileInfo, Str.toStringz(attribute));
332 	}
333 
334 	/**
335 	 * Gets an unsigned 32-bit integer contained within the attribute. If the
336 	 * attribute does not contain an unsigned 32-bit integer, or is invalid,
337 	 * 0 will be returned.
338 	 *
339 	 * Params:
340 	 *     attribute = a file attribute key.
341 	 *
342 	 * Return: an unsigned 32-bit integer from the attribute.
343 	 */
344 	public uint getAttributeUint32(string attribute)
345 	{
346 		return g_file_info_get_attribute_uint32(gFileInfo, Str.toStringz(attribute));
347 	}
348 
349 	/**
350 	 * Gets a unsigned 64-bit integer contained within the attribute. If the
351 	 * attribute does not contain an unsigned 64-bit integer, or is invalid,
352 	 * 0 will be returned.
353 	 *
354 	 * Params:
355 	 *     attribute = a file attribute key.
356 	 *
357 	 * Return: a unsigned 64-bit integer from the attribute.
358 	 */
359 	public ulong getAttributeUint64(string attribute)
360 	{
361 		return g_file_info_get_attribute_uint64(gFileInfo, Str.toStringz(attribute));
362 	}
363 
364 	/**
365 	 * Gets the file's content type.
366 	 *
367 	 * Return: a string containing the file's content type.
368 	 */
369 	public string getContentType()
370 	{
371 		return Str.toString(g_file_info_get_content_type(gFileInfo));
372 	}
373 
374 	/**
375 	 * Returns the #GDateTime representing the deletion date of the file, as
376 	 * available in G_FILE_ATTRIBUTE_TRASH_DELETION_DATE. If the
377 	 * G_FILE_ATTRIBUTE_TRASH_DELETION_DATE attribute is unset, %NULL is returned.
378 	 *
379 	 * Return: a #GDateTime, or %NULL.
380 	 *
381 	 * Since: 2.36
382 	 */
383 	public DateTime getDeletionDate()
384 	{
385 		auto p = g_file_info_get_deletion_date(gFileInfo);
386 		
387 		if(p is null)
388 		{
389 			return null;
390 		}
391 		
392 		return new DateTime(cast(GDateTime*) p);
393 	}
394 
395 	/**
396 	 * Gets a display name for a file.
397 	 *
398 	 * Return: a string containing the display name.
399 	 */
400 	public string getDisplayName()
401 	{
402 		return Str.toString(g_file_info_get_display_name(gFileInfo));
403 	}
404 
405 	/**
406 	 * Gets the edit name for a file.
407 	 *
408 	 * Return: a string containing the edit name.
409 	 */
410 	public string getEditName()
411 	{
412 		return Str.toString(g_file_info_get_edit_name(gFileInfo));
413 	}
414 
415 	/**
416 	 * Gets the [entity tag][gfile-etag] for a given
417 	 * #GFileInfo. See %G_FILE_ATTRIBUTE_ETAG_VALUE.
418 	 *
419 	 * Return: a string containing the value of the "etag:value" attribute.
420 	 */
421 	public string getEtag()
422 	{
423 		return Str.toString(g_file_info_get_etag(gFileInfo));
424 	}
425 
426 	/**
427 	 * Gets a file's type (whether it is a regular file, symlink, etc).
428 	 * This is different from the file's content type, see g_file_info_get_content_type().
429 	 *
430 	 * Return: a #GFileType for the given file.
431 	 */
432 	public GFileType getFileType()
433 	{
434 		return g_file_info_get_file_type(gFileInfo);
435 	}
436 
437 	/**
438 	 * Gets the icon for a file.
439 	 *
440 	 * Return: #GIcon for the given @info.
441 	 */
442 	public IconIF getIcon()
443 	{
444 		auto p = g_file_info_get_icon(gFileInfo);
445 		
446 		if(p is null)
447 		{
448 			return null;
449 		}
450 		
451 		return ObjectG.getDObject!(Icon, IconIF)(cast(GIcon*) p);
452 	}
453 
454 	/**
455 	 * Checks if a file is a backup file.
456 	 *
457 	 * Return: %TRUE if file is a backup file, %FALSE otherwise.
458 	 */
459 	public bool getIsBackup()
460 	{
461 		return g_file_info_get_is_backup(gFileInfo) != 0;
462 	}
463 
464 	/**
465 	 * Checks if a file is hidden.
466 	 *
467 	 * Return: %TRUE if the file is a hidden file, %FALSE otherwise.
468 	 */
469 	public bool getIsHidden()
470 	{
471 		return g_file_info_get_is_hidden(gFileInfo) != 0;
472 	}
473 
474 	/**
475 	 * Checks if a file is a symlink.
476 	 *
477 	 * Return: %TRUE if the given @info is a symlink.
478 	 */
479 	public bool getIsSymlink()
480 	{
481 		return g_file_info_get_is_symlink(gFileInfo) != 0;
482 	}
483 
484 	/**
485 	 * Gets the modification time of the current @info and sets it
486 	 * in @result.
487 	 *
488 	 * Params:
489 	 *     result = a #GTimeVal.
490 	 */
491 	public void getModificationTime(out TimeVal result)
492 	{
493 		GTimeVal* outresult = gMalloc!GTimeVal();
494 		
495 		g_file_info_get_modification_time(gFileInfo, outresult);
496 		
497 		result = new TimeVal(outresult);
498 	}
499 
500 	/**
501 	 * Gets the name for a file.
502 	 *
503 	 * Return: a string containing the file name.
504 	 */
505 	public string getName()
506 	{
507 		return Str.toString(g_file_info_get_name(gFileInfo));
508 	}
509 
510 	/**
511 	 * Gets the file's size.
512 	 *
513 	 * Return: a #goffset containing the file's size.
514 	 */
515 	public long getSize()
516 	{
517 		return g_file_info_get_size(gFileInfo);
518 	}
519 
520 	/**
521 	 * Gets the value of the sort_order attribute from the #GFileInfo.
522 	 * See %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
523 	 *
524 	 * Return: a #gint32 containing the value of the "standard::sort_order" attribute.
525 	 */
526 	public int getSortOrder()
527 	{
528 		return g_file_info_get_sort_order(gFileInfo);
529 	}
530 
531 	/**
532 	 * Gets the symbolic icon for a file.
533 	 *
534 	 * Return: #GIcon for the given @info.
535 	 *
536 	 * Since: 2.34
537 	 */
538 	public IconIF getSymbolicIcon()
539 	{
540 		auto p = g_file_info_get_symbolic_icon(gFileInfo);
541 		
542 		if(p is null)
543 		{
544 			return null;
545 		}
546 		
547 		return ObjectG.getDObject!(Icon, IconIF)(cast(GIcon*) p);
548 	}
549 
550 	/**
551 	 * Gets the symlink target for a given #GFileInfo.
552 	 *
553 	 * Return: a string containing the symlink target.
554 	 */
555 	public string getSymlinkTarget()
556 	{
557 		return Str.toString(g_file_info_get_symlink_target(gFileInfo));
558 	}
559 
560 	/**
561 	 * Checks if a file info structure has an attribute named @attribute.
562 	 *
563 	 * Params:
564 	 *     attribute = a file attribute key.
565 	 *
566 	 * Return: %TRUE if @Ginfo has an attribute named @attribute,
567 	 *     %FALSE otherwise.
568 	 */
569 	public bool hasAttribute(string attribute)
570 	{
571 		return g_file_info_has_attribute(gFileInfo, Str.toStringz(attribute)) != 0;
572 	}
573 
574 	/**
575 	 * Checks if a file info structure has an attribute in the
576 	 * specified @name_space.
577 	 *
578 	 * Params:
579 	 *     nameSpace = a file attribute namespace.
580 	 *
581 	 * Return: %TRUE if @Ginfo has an attribute in @name_space,
582 	 *     %FALSE otherwise.
583 	 *
584 	 * Since: 2.22
585 	 */
586 	public bool hasNamespace(string nameSpace)
587 	{
588 		return g_file_info_has_namespace(gFileInfo, Str.toStringz(nameSpace)) != 0;
589 	}
590 
591 	/**
592 	 * Lists the file info structure's attributes.
593 	 *
594 	 * Params:
595 	 *     nameSpace = a file attribute key's namespace.
596 	 *
597 	 * Return: a
598 	 *     null-terminated array of strings of all of the possible attribute
599 	 *     types for the given @name_space, or %NULL on error.
600 	 */
601 	public string[] listAttributes(string nameSpace)
602 	{
603 		return Str.toStringArray(g_file_info_list_attributes(gFileInfo, Str.toStringz(nameSpace)));
604 	}
605 
606 	/**
607 	 * Removes all cases of @attribute from @info if it exists.
608 	 *
609 	 * Params:
610 	 *     attribute = a file attribute key.
611 	 */
612 	public void removeAttribute(string attribute)
613 	{
614 		g_file_info_remove_attribute(gFileInfo, Str.toStringz(attribute));
615 	}
616 
617 	/**
618 	 * Sets the @attribute to contain the given value, if possible. To unset the
619 	 * attribute, use %G_ATTRIBUTE_TYPE_INVALID for @type.
620 	 *
621 	 * Params:
622 	 *     attribute = a file attribute key.
623 	 *     type = a #GFileAttributeType
624 	 *     valueP = pointer to the value
625 	 */
626 	public void setAttribute(string attribute, GFileAttributeType type, void* valueP)
627 	{
628 		g_file_info_set_attribute(gFileInfo, Str.toStringz(attribute), type, valueP);
629 	}
630 
631 	/**
632 	 * Sets the @attribute to contain the given @attr_value,
633 	 * if possible.
634 	 *
635 	 * Params:
636 	 *     attribute = a file attribute key.
637 	 *     attrValue = a boolean value.
638 	 */
639 	public void setAttributeBoolean(string attribute, bool attrValue)
640 	{
641 		g_file_info_set_attribute_boolean(gFileInfo, Str.toStringz(attribute), attrValue);
642 	}
643 
644 	/**
645 	 * Sets the @attribute to contain the given @attr_value,
646 	 * if possible.
647 	 *
648 	 * Params:
649 	 *     attribute = a file attribute key.
650 	 *     attrValue = a byte string.
651 	 */
652 	public void setAttributeByteString(string attribute, string attrValue)
653 	{
654 		g_file_info_set_attribute_byte_string(gFileInfo, Str.toStringz(attribute), Str.toStringz(attrValue));
655 	}
656 
657 	/**
658 	 * Sets the @attribute to contain the given @attr_value,
659 	 * if possible.
660 	 *
661 	 * Params:
662 	 *     attribute = a file attribute key.
663 	 *     attrValue = a signed 32-bit integer
664 	 */
665 	public void setAttributeInt32(string attribute, int attrValue)
666 	{
667 		g_file_info_set_attribute_int32(gFileInfo, Str.toStringz(attribute), attrValue);
668 	}
669 
670 	/**
671 	 * Sets the @attribute to contain the given @attr_value,
672 	 * if possible.
673 	 *
674 	 * Params:
675 	 *     attribute = attribute name to set.
676 	 *     attrValue = int64 value to set attribute to.
677 	 */
678 	public void setAttributeInt64(string attribute, long attrValue)
679 	{
680 		g_file_info_set_attribute_int64(gFileInfo, Str.toStringz(attribute), attrValue);
681 	}
682 
683 	/**
684 	 * Sets @mask on @info to match specific attribute types.
685 	 *
686 	 * Params:
687 	 *     mask = a #GFileAttributeMatcher.
688 	 */
689 	public void setAttributeMask(FileAttributeMatcher mask)
690 	{
691 		g_file_info_set_attribute_mask(gFileInfo, (mask is null) ? null : mask.getFileAttributeMatcherStruct());
692 	}
693 
694 	/**
695 	 * Sets the @attribute to contain the given @attr_value,
696 	 * if possible.
697 	 *
698 	 * Params:
699 	 *     attribute = a file attribute key.
700 	 *     attrValue = a #GObject.
701 	 */
702 	public void setAttributeObject(string attribute, ObjectG attrValue)
703 	{
704 		g_file_info_set_attribute_object(gFileInfo, Str.toStringz(attribute), (attrValue is null) ? null : attrValue.getObjectGStruct());
705 	}
706 
707 	/**
708 	 * Sets the attribute status for an attribute key. This is only
709 	 * needed by external code that implement g_file_set_attributes_from_info()
710 	 * or similar functions.
711 	 *
712 	 * The attribute must exist in @info for this to work. Otherwise %FALSE
713 	 * is returned and @info is unchanged.
714 	 *
715 	 * Params:
716 	 *     attribute = a file attribute key
717 	 *     status = a #GFileAttributeStatus
718 	 *
719 	 * Return: %TRUE if the status was changed, %FALSE if the key was not set.
720 	 *
721 	 * Since: 2.22
722 	 */
723 	public bool setAttributeStatus(string attribute, GFileAttributeStatus status)
724 	{
725 		return g_file_info_set_attribute_status(gFileInfo, Str.toStringz(attribute), status) != 0;
726 	}
727 
728 	/**
729 	 * Sets the @attribute to contain the given @attr_value,
730 	 * if possible.
731 	 *
732 	 * Params:
733 	 *     attribute = a file attribute key.
734 	 *     attrValue = a UTF-8 string.
735 	 */
736 	public void setAttributeString(string attribute, string attrValue)
737 	{
738 		g_file_info_set_attribute_string(gFileInfo, Str.toStringz(attribute), Str.toStringz(attrValue));
739 	}
740 
741 	/**
742 	 * Sets the @attribute to contain the given @attr_value,
743 	 * if possible.
744 	 *
745 	 * Sinze: 2.22
746 	 *
747 	 * Params:
748 	 *     attribute = a file attribute key
749 	 *     attrValue = a %NULL terminated array of UTF-8 strings.
750 	 */
751 	public void setAttributeStringv(string attribute, string[] attrValue)
752 	{
753 		g_file_info_set_attribute_stringv(gFileInfo, Str.toStringz(attribute), Str.toStringzArray(attrValue));
754 	}
755 
756 	/**
757 	 * Sets the @attribute to contain the given @attr_value,
758 	 * if possible.
759 	 *
760 	 * Params:
761 	 *     attribute = a file attribute key.
762 	 *     attrValue = an unsigned 32-bit integer.
763 	 */
764 	public void setAttributeUint32(string attribute, uint attrValue)
765 	{
766 		g_file_info_set_attribute_uint32(gFileInfo, Str.toStringz(attribute), attrValue);
767 	}
768 
769 	/**
770 	 * Sets the @attribute to contain the given @attr_value,
771 	 * if possible.
772 	 *
773 	 * Params:
774 	 *     attribute = a file attribute key.
775 	 *     attrValue = an unsigned 64-bit integer.
776 	 */
777 	public void setAttributeUint64(string attribute, ulong attrValue)
778 	{
779 		g_file_info_set_attribute_uint64(gFileInfo, Str.toStringz(attribute), attrValue);
780 	}
781 
782 	/**
783 	 * Sets the content type attribute for a given #GFileInfo.
784 	 * See %G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE.
785 	 *
786 	 * Params:
787 	 *     contentType = a content type. See [GContentType][gio-GContentType]
788 	 */
789 	public void setContentType(string contentType)
790 	{
791 		g_file_info_set_content_type(gFileInfo, Str.toStringz(contentType));
792 	}
793 
794 	/**
795 	 * Sets the display name for the current #GFileInfo.
796 	 * See %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME.
797 	 *
798 	 * Params:
799 	 *     displayName = a string containing a display name.
800 	 */
801 	public void setDisplayName(string displayName)
802 	{
803 		g_file_info_set_display_name(gFileInfo, Str.toStringz(displayName));
804 	}
805 
806 	/**
807 	 * Sets the edit name for the current file.
808 	 * See %G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME.
809 	 *
810 	 * Params:
811 	 *     editName = a string containing an edit name.
812 	 */
813 	public void setEditName(string editName)
814 	{
815 		g_file_info_set_edit_name(gFileInfo, Str.toStringz(editName));
816 	}
817 
818 	/**
819 	 * Sets the file type in a #GFileInfo to @type.
820 	 * See %G_FILE_ATTRIBUTE_STANDARD_TYPE.
821 	 *
822 	 * Params:
823 	 *     type = a #GFileType.
824 	 */
825 	public void setFileType(GFileType type)
826 	{
827 		g_file_info_set_file_type(gFileInfo, type);
828 	}
829 
830 	/**
831 	 * Sets the icon for a given #GFileInfo.
832 	 * See %G_FILE_ATTRIBUTE_STANDARD_ICON.
833 	 *
834 	 * Params:
835 	 *     icon = a #GIcon.
836 	 */
837 	public void setIcon(IconIF icon)
838 	{
839 		g_file_info_set_icon(gFileInfo, (icon is null) ? null : icon.getIconStruct());
840 	}
841 
842 	/**
843 	 * Sets the "is_hidden" attribute in a #GFileInfo according to @is_hidden.
844 	 * See %G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN.
845 	 *
846 	 * Params:
847 	 *     isHidden = a #gboolean.
848 	 */
849 	public void setIsHidden(bool isHidden)
850 	{
851 		g_file_info_set_is_hidden(gFileInfo, isHidden);
852 	}
853 
854 	/**
855 	 * Sets the "is_symlink" attribute in a #GFileInfo according to @is_symlink.
856 	 * See %G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK.
857 	 *
858 	 * Params:
859 	 *     isSymlink = a #gboolean.
860 	 */
861 	public void setIsSymlink(bool isSymlink)
862 	{
863 		g_file_info_set_is_symlink(gFileInfo, isSymlink);
864 	}
865 
866 	/**
867 	 * Sets the %G_FILE_ATTRIBUTE_TIME_MODIFIED attribute in the file
868 	 * info to the given time value.
869 	 *
870 	 * Params:
871 	 *     mtime = a #GTimeVal.
872 	 */
873 	public void setModificationTime(TimeVal mtime)
874 	{
875 		g_file_info_set_modification_time(gFileInfo, (mtime is null) ? null : mtime.getTimeValStruct());
876 	}
877 
878 	/**
879 	 * Sets the name attribute for the current #GFileInfo.
880 	 * See %G_FILE_ATTRIBUTE_STANDARD_NAME.
881 	 *
882 	 * Params:
883 	 *     name = a string containing a name.
884 	 */
885 	public void setName(string name)
886 	{
887 		g_file_info_set_name(gFileInfo, Str.toStringz(name));
888 	}
889 
890 	/**
891 	 * Sets the %G_FILE_ATTRIBUTE_STANDARD_SIZE attribute in the file info
892 	 * to the given size.
893 	 *
894 	 * Params:
895 	 *     size = a #goffset containing the file's size.
896 	 */
897 	public void setSize(long size)
898 	{
899 		g_file_info_set_size(gFileInfo, size);
900 	}
901 
902 	/**
903 	 * Sets the sort order attribute in the file info structure. See
904 	 * %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
905 	 *
906 	 * Params:
907 	 *     sortOrder = a sort order integer.
908 	 */
909 	public void setSortOrder(int sortOrder)
910 	{
911 		g_file_info_set_sort_order(gFileInfo, sortOrder);
912 	}
913 
914 	/**
915 	 * Sets the symbolic icon for a given #GFileInfo.
916 	 * See %G_FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON.
917 	 *
918 	 * Params:
919 	 *     icon = a #GIcon.
920 	 *
921 	 * Since: 2.34
922 	 */
923 	public void setSymbolicIcon(IconIF icon)
924 	{
925 		g_file_info_set_symbolic_icon(gFileInfo, (icon is null) ? null : icon.getIconStruct());
926 	}
927 
928 	/**
929 	 * Sets the %G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET attribute in the file info
930 	 * to the given symlink target.
931 	 *
932 	 * Params:
933 	 *     symlinkTarget = a static string containing a path to a symlink target.
934 	 */
935 	public void setSymlinkTarget(string symlinkTarget)
936 	{
937 		g_file_info_set_symlink_target(gFileInfo, Str.toStringz(symlinkTarget));
938 	}
939 
940 	/**
941 	 * Unsets a mask set by g_file_info_set_attribute_mask(), if one
942 	 * is set.
943 	 */
944 	public void unsetAttributeMask()
945 	{
946 		g_file_info_unset_attribute_mask(gFileInfo);
947 	}
948 }