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.IconIF; 29 private import gio.c.functions; 30 public import gio.c.types; 31 private import glib.ConstructionException; 32 private import glib.DateTime; 33 private import glib.Str; 34 private import glib.TimeVal; 35 private import gobject.ObjectG; 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(bool transferOwnership = false) 72 { 73 if (transferOwnership) 74 ownedRef = false; 75 return gFileInfo; 76 } 77 78 /** the main Gtk struct as a void* */ 79 protected override void* getStruct() 80 { 81 return cast(void*)gFileInfo; 82 } 83 84 /** 85 * Sets our main struct and passes it to the parent class. 86 */ 87 public this (GFileInfo* gFileInfo, bool ownedRef = false) 88 { 89 this.gFileInfo = gFileInfo; 90 super(cast(GObject*)gFileInfo, ownedRef); 91 } 92 93 94 /** */ 95 public static GType getType() 96 { 97 return g_file_info_get_type(); 98 } 99 100 /** 101 * Creates a new file info structure. 102 * 103 * Returns: a #GFileInfo. 104 * 105 * Throws: ConstructionException GTK+ fails to create the object. 106 */ 107 public this() 108 { 109 auto p = g_file_info_new(); 110 111 if(p is null) 112 { 113 throw new ConstructionException("null returned by new"); 114 } 115 116 this(cast(GFileInfo*) p, true); 117 } 118 119 /** 120 * Clears the status information from @info. 121 */ 122 public void clearStatus() 123 { 124 g_file_info_clear_status(gFileInfo); 125 } 126 127 /** 128 * First clears all of the [GFileAttribute][gio-GFileAttribute] of @dest_info, 129 * and then copies all of the file attributes from @src_info to @dest_info. 130 * 131 * Params: 132 * destInfo = destination to copy attributes to. 133 */ 134 public void copyInto(FileInfo destInfo) 135 { 136 g_file_info_copy_into(gFileInfo, (destInfo is null) ? null : destInfo.getFileInfoStruct()); 137 } 138 139 /** 140 * Duplicates a file info structure. 141 * 142 * Returns: a duplicate #GFileInfo of @other. 143 */ 144 public FileInfo dup() 145 { 146 auto p = g_file_info_dup(gFileInfo); 147 148 if(p is null) 149 { 150 return null; 151 } 152 153 return ObjectG.getDObject!(FileInfo)(cast(GFileInfo*) p, true); 154 } 155 156 /** 157 * Gets the value of a attribute, formated as a string. 158 * This escapes things as needed to make the string valid 159 * utf8. 160 * 161 * Params: 162 * attribute = a file attribute key. 163 * 164 * Returns: a UTF-8 string associated with the given @attribute. 165 * When you're done with the string it must be freed with g_free(). 166 */ 167 public string getAttributeAsString(string attribute) 168 { 169 auto retStr = g_file_info_get_attribute_as_string(gFileInfo, Str.toStringz(attribute)); 170 171 scope(exit) Str.freeString(retStr); 172 return Str.toString(retStr); 173 } 174 175 /** 176 * Gets the value of a boolean attribute. If the attribute does not 177 * contain a boolean value, %FALSE will be returned. 178 * 179 * Params: 180 * attribute = a file attribute key. 181 * 182 * Returns: the boolean value contained within the attribute. 183 */ 184 public bool getAttributeBoolean(string attribute) 185 { 186 return g_file_info_get_attribute_boolean(gFileInfo, Str.toStringz(attribute)) != 0; 187 } 188 189 /** 190 * Gets the value of a byte string attribute. If the attribute does 191 * not contain a byte string, %NULL will be returned. 192 * 193 * Params: 194 * attribute = a file attribute key. 195 * 196 * Returns: the contents of the @attribute value as a byte string, or 197 * %NULL otherwise. 198 */ 199 public string getAttributeByteString(string attribute) 200 { 201 return Str.toString(g_file_info_get_attribute_byte_string(gFileInfo, Str.toStringz(attribute))); 202 } 203 204 /** 205 * Gets the attribute type, value and status for an attribute key. 206 * 207 * Params: 208 * attribute = a file attribute key 209 * type = return location for the attribute type, or %NULL 210 * valuePp = return location for the 211 * attribute value, or %NULL; the attribute value will not be %NULL 212 * status = return location for the attribute status, or %NULL 213 * 214 * Returns: %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 * Returns: 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 * Returns: 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 * Returns: 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 * Returns: 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 * Returns: 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 * Returns: 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 * Returns: 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 * Returns: 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 * Returns: 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 * Returns: 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 * Returns: 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, true); 393 } 394 395 /** 396 * Gets a display name for a file. 397 * 398 * Returns: 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 * Returns: 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 * Returns: 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 * Returns: 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 * Returns: #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!(IconIF)(cast(GIcon*) p); 452 } 453 454 /** 455 * Checks if a file is a backup file. 456 * 457 * Returns: %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 * Returns: %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 * Returns: %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, true); 498 } 499 500 /** 501 * Gets the name for a file. 502 * 503 * Returns: 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 * Returns: 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 * Returns: 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 * Returns: #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!(IconIF)(cast(GIcon*) p); 548 } 549 550 /** 551 * Gets the symlink target for a given #GFileInfo. 552 * 553 * Returns: 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 * Returns: %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 * Returns: %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, or %NULL to list 596 * all attributes. 597 * 598 * Returns: 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 auto retStr = g_file_info_list_attributes(gFileInfo, Str.toStringz(nameSpace)); 605 606 scope(exit) Str.freeStringArray(retStr); 607 return Str.toStringArray(retStr); 608 } 609 610 /** 611 * Removes all cases of @attribute from @info if it exists. 612 * 613 * Params: 614 * attribute = a file attribute key. 615 */ 616 public void removeAttribute(string attribute) 617 { 618 g_file_info_remove_attribute(gFileInfo, Str.toStringz(attribute)); 619 } 620 621 /** 622 * Sets the @attribute to contain the given value, if possible. To unset the 623 * attribute, use %G_ATTRIBUTE_TYPE_INVALID for @type. 624 * 625 * Params: 626 * attribute = a file attribute key. 627 * type = a #GFileAttributeType 628 * valueP = pointer to the value 629 */ 630 public void setAttribute(string attribute, GFileAttributeType type, void* valueP) 631 { 632 g_file_info_set_attribute(gFileInfo, Str.toStringz(attribute), type, valueP); 633 } 634 635 /** 636 * Sets the @attribute to contain the given @attr_value, 637 * if possible. 638 * 639 * Params: 640 * attribute = a file attribute key. 641 * attrValue = a boolean value. 642 */ 643 public void setAttributeBoolean(string attribute, bool attrValue) 644 { 645 g_file_info_set_attribute_boolean(gFileInfo, Str.toStringz(attribute), attrValue); 646 } 647 648 /** 649 * Sets the @attribute to contain the given @attr_value, 650 * if possible. 651 * 652 * Params: 653 * attribute = a file attribute key. 654 * attrValue = a byte string. 655 */ 656 public void setAttributeByteString(string attribute, string attrValue) 657 { 658 g_file_info_set_attribute_byte_string(gFileInfo, Str.toStringz(attribute), Str.toStringz(attrValue)); 659 } 660 661 /** 662 * Sets the @attribute to contain the given @attr_value, 663 * if possible. 664 * 665 * Params: 666 * attribute = a file attribute key. 667 * attrValue = a signed 32-bit integer 668 */ 669 public void setAttributeInt32(string attribute, int attrValue) 670 { 671 g_file_info_set_attribute_int32(gFileInfo, Str.toStringz(attribute), attrValue); 672 } 673 674 /** 675 * Sets the @attribute to contain the given @attr_value, 676 * if possible. 677 * 678 * Params: 679 * attribute = attribute name to set. 680 * attrValue = int64 value to set attribute to. 681 */ 682 public void setAttributeInt64(string attribute, long attrValue) 683 { 684 g_file_info_set_attribute_int64(gFileInfo, Str.toStringz(attribute), attrValue); 685 } 686 687 /** 688 * Sets @mask on @info to match specific attribute types. 689 * 690 * Params: 691 * mask = a #GFileAttributeMatcher. 692 */ 693 public void setAttributeMask(FileAttributeMatcher mask) 694 { 695 g_file_info_set_attribute_mask(gFileInfo, (mask is null) ? null : mask.getFileAttributeMatcherStruct()); 696 } 697 698 /** 699 * Sets the @attribute to contain the given @attr_value, 700 * if possible. 701 * 702 * Params: 703 * attribute = a file attribute key. 704 * attrValue = a #GObject. 705 */ 706 public void setAttributeObject(string attribute, ObjectG attrValue) 707 { 708 g_file_info_set_attribute_object(gFileInfo, Str.toStringz(attribute), (attrValue is null) ? null : attrValue.getObjectGStruct()); 709 } 710 711 /** 712 * Sets the attribute status for an attribute key. This is only 713 * needed by external code that implement g_file_set_attributes_from_info() 714 * or similar functions. 715 * 716 * The attribute must exist in @info for this to work. Otherwise %FALSE 717 * is returned and @info is unchanged. 718 * 719 * Params: 720 * attribute = a file attribute key 721 * status = a #GFileAttributeStatus 722 * 723 * Returns: %TRUE if the status was changed, %FALSE if the key was not set. 724 * 725 * Since: 2.22 726 */ 727 public bool setAttributeStatus(string attribute, GFileAttributeStatus status) 728 { 729 return g_file_info_set_attribute_status(gFileInfo, Str.toStringz(attribute), status) != 0; 730 } 731 732 /** 733 * Sets the @attribute to contain the given @attr_value, 734 * if possible. 735 * 736 * Params: 737 * attribute = a file attribute key. 738 * attrValue = a UTF-8 string. 739 */ 740 public void setAttributeString(string attribute, string attrValue) 741 { 742 g_file_info_set_attribute_string(gFileInfo, Str.toStringz(attribute), Str.toStringz(attrValue)); 743 } 744 745 /** 746 * Sets the @attribute to contain the given @attr_value, 747 * if possible. 748 * 749 * Sinze: 2.22 750 * 751 * Params: 752 * attribute = a file attribute key 753 * attrValue = a %NULL terminated array of UTF-8 strings. 754 */ 755 public void setAttributeStringv(string attribute, string[] attrValue) 756 { 757 g_file_info_set_attribute_stringv(gFileInfo, Str.toStringz(attribute), Str.toStringzArray(attrValue)); 758 } 759 760 /** 761 * Sets the @attribute to contain the given @attr_value, 762 * if possible. 763 * 764 * Params: 765 * attribute = a file attribute key. 766 * attrValue = an unsigned 32-bit integer. 767 */ 768 public void setAttributeUint32(string attribute, uint attrValue) 769 { 770 g_file_info_set_attribute_uint32(gFileInfo, Str.toStringz(attribute), attrValue); 771 } 772 773 /** 774 * Sets the @attribute to contain the given @attr_value, 775 * if possible. 776 * 777 * Params: 778 * attribute = a file attribute key. 779 * attrValue = an unsigned 64-bit integer. 780 */ 781 public void setAttributeUint64(string attribute, ulong attrValue) 782 { 783 g_file_info_set_attribute_uint64(gFileInfo, Str.toStringz(attribute), attrValue); 784 } 785 786 /** 787 * Sets the content type attribute for a given #GFileInfo. 788 * See %G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE. 789 * 790 * Params: 791 * contentType = a content type. See [GContentType][gio-GContentType] 792 */ 793 public void setContentType(string contentType) 794 { 795 g_file_info_set_content_type(gFileInfo, Str.toStringz(contentType)); 796 } 797 798 /** 799 * Sets the display name for the current #GFileInfo. 800 * See %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME. 801 * 802 * Params: 803 * displayName = a string containing a display name. 804 */ 805 public void setDisplayName(string displayName) 806 { 807 g_file_info_set_display_name(gFileInfo, Str.toStringz(displayName)); 808 } 809 810 /** 811 * Sets the edit name for the current file. 812 * See %G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME. 813 * 814 * Params: 815 * editName = a string containing an edit name. 816 */ 817 public void setEditName(string editName) 818 { 819 g_file_info_set_edit_name(gFileInfo, Str.toStringz(editName)); 820 } 821 822 /** 823 * Sets the file type in a #GFileInfo to @type. 824 * See %G_FILE_ATTRIBUTE_STANDARD_TYPE. 825 * 826 * Params: 827 * type = a #GFileType. 828 */ 829 public void setFileType(GFileType type) 830 { 831 g_file_info_set_file_type(gFileInfo, type); 832 } 833 834 /** 835 * Sets the icon for a given #GFileInfo. 836 * See %G_FILE_ATTRIBUTE_STANDARD_ICON. 837 * 838 * Params: 839 * icon = a #GIcon. 840 */ 841 public void setIcon(IconIF icon) 842 { 843 g_file_info_set_icon(gFileInfo, (icon is null) ? null : icon.getIconStruct()); 844 } 845 846 /** 847 * Sets the "is_hidden" attribute in a #GFileInfo according to @is_hidden. 848 * See %G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN. 849 * 850 * Params: 851 * isHidden = a #gboolean. 852 */ 853 public void setIsHidden(bool isHidden) 854 { 855 g_file_info_set_is_hidden(gFileInfo, isHidden); 856 } 857 858 /** 859 * Sets the "is_symlink" attribute in a #GFileInfo according to @is_symlink. 860 * See %G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK. 861 * 862 * Params: 863 * isSymlink = a #gboolean. 864 */ 865 public void setIsSymlink(bool isSymlink) 866 { 867 g_file_info_set_is_symlink(gFileInfo, isSymlink); 868 } 869 870 /** 871 * Sets the %G_FILE_ATTRIBUTE_TIME_MODIFIED attribute in the file 872 * info to the given time value. 873 * 874 * Params: 875 * mtime = a #GTimeVal. 876 */ 877 public void setModificationTime(TimeVal mtime) 878 { 879 g_file_info_set_modification_time(gFileInfo, (mtime is null) ? null : mtime.getTimeValStruct()); 880 } 881 882 /** 883 * Sets the name attribute for the current #GFileInfo. 884 * See %G_FILE_ATTRIBUTE_STANDARD_NAME. 885 * 886 * Params: 887 * name = a string containing a name. 888 */ 889 public void setName(string name) 890 { 891 g_file_info_set_name(gFileInfo, Str.toStringz(name)); 892 } 893 894 /** 895 * Sets the %G_FILE_ATTRIBUTE_STANDARD_SIZE attribute in the file info 896 * to the given size. 897 * 898 * Params: 899 * size = a #goffset containing the file's size. 900 */ 901 public void setSize(long size) 902 { 903 g_file_info_set_size(gFileInfo, size); 904 } 905 906 /** 907 * Sets the sort order attribute in the file info structure. See 908 * %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER. 909 * 910 * Params: 911 * sortOrder = a sort order integer. 912 */ 913 public void setSortOrder(int sortOrder) 914 { 915 g_file_info_set_sort_order(gFileInfo, sortOrder); 916 } 917 918 /** 919 * Sets the symbolic icon for a given #GFileInfo. 920 * See %G_FILE_ATTRIBUTE_STANDARD_SYMBOLIC_ICON. 921 * 922 * Params: 923 * icon = a #GIcon. 924 * 925 * Since: 2.34 926 */ 927 public void setSymbolicIcon(IconIF icon) 928 { 929 g_file_info_set_symbolic_icon(gFileInfo, (icon is null) ? null : icon.getIconStruct()); 930 } 931 932 /** 933 * Sets the %G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET attribute in the file info 934 * to the given symlink target. 935 * 936 * Params: 937 * symlinkTarget = a static string containing a path to a symlink target. 938 */ 939 public void setSymlinkTarget(string symlinkTarget) 940 { 941 g_file_info_set_symlink_target(gFileInfo, Str.toStringz(symlinkTarget)); 942 } 943 944 /** 945 * Unsets a mask set by g_file_info_set_attribute_mask(), if one 946 * is set. 947 */ 948 public void unsetAttributeMask() 949 { 950 g_file_info_unset_attribute_mask(gFileInfo); 951 } 952 }