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