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