1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397
// // DO NOT EDIT. THIS FILE IS GENERATED FROM ../../../dist/idl/nsIFile.idl // /// `interface nsIFile : nsISupports` /// /// ```text /// /** /// * An nsIFile is an abstract representation of a filename. It manages /// * filename encoding issues, pathname component separators ('/' vs. '\\' /// * vs. ':') and weird stuff like differing volumes with identical names, as /// * on pre-Darwin Macintoshes. /// * /// * This file has long introduced itself to new hackers with this opening /// * paragraph: /// * /// * This is the only correct cross-platform way to specify a file. /// * Strings are not such a way. If you grew up on windows or unix, you /// * may think they are. Welcome to reality. /// * /// * While taking the pose struck here to heart would be uncalled for, one /// * may safely conclude that writing cross-platform code is an embittering /// * experience. /// * /// * All methods with string parameters have two forms. The preferred /// * form operates on UCS-2 encoded characters strings. An alternate /// * form operates on characters strings encoded in the "native" charset. /// * /// * A string containing characters encoded in the native charset cannot /// * be safely passed to javascript via xpconnect. Therefore, the "native /// * methods" are not scriptable. /// */ /// ``` /// // The actual type definition for the interface. This struct has methods // declared on it which will call through its vtable. You never want to pass // this type around by value, always pass it behind a reference. #[repr(C)] pub struct nsIFile { vtable: *const nsIFileVTable, /// This field is a phantomdata to ensure that the VTable type and any /// struct containing it is not safe to send across threads, as XPCOM is /// generally not threadsafe. /// /// XPCOM interfaces in general are not safe to send across threads. __nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>, } // Implementing XpCom for an interface exposes its IID, which allows for easy // use of the `.query_interface<T>` helper method. This also defines that // method for nsIFile. unsafe impl XpCom for nsIFile { const IID: nsIID = nsID(0x2fa6884a, 0xae65, 0x412a, [0x9d, 0x4c, 0xce, 0x6e, 0x34, 0x54, 0x4b, 0xa1]); } // We need to implement the RefCounted trait so we can be used with `RefPtr`. // This trait teaches `RefPtr` how to manage our memory. unsafe impl RefCounted for nsIFile { #[inline] unsafe fn addref(&self) { self.AddRef(); } #[inline] unsafe fn release(&self) { self.Release(); } } // This trait is implemented on all types which can be coerced to from nsIFile. // It is used in the implementation of `fn coerce<T>`. We hide it from the // documentation, because it clutters it up a lot. #[doc(hidden)] pub trait nsIFileCoerce { /// Cheaply cast a value of this type from a `nsIFile`. fn coerce_from(v: &nsIFile) -> &Self; } // The trivial implementation: We can obviously coerce ourselves to ourselves. impl nsIFileCoerce for nsIFile { #[inline] fn coerce_from(v: &nsIFile) -> &Self { v } } impl nsIFile { /// Cast this `nsIFile` to one of its base interfaces. #[inline] pub fn coerce<T: nsIFileCoerce>(&self) -> &T { T::coerce_from(self) } } // Every interface struct type implements `Deref` to its base interface. This // causes methods on the base interfaces to be directly avaliable on the // object. For example, you can call `.AddRef` or `.QueryInterface` directly // on any interface which inherits from `nsISupports`. impl ::std::ops::Deref for nsIFile { type Target = nsISupports; #[inline] fn deref(&self) -> &nsISupports { unsafe { ::std::mem::transmute(self) } } } // Ensure we can use .coerce() to cast to our base types as well. Any type which // our base interface can coerce from should be coercable from us as well. impl<T: nsISupportsCoerce> nsIFileCoerce for T { #[inline] fn coerce_from(v: &nsIFile) -> &Self { T::coerce_from(v) } } // This struct represents the interface's VTable. A pointer to a statically // allocated version of this struct is at the beginning of every nsIFile // object. It contains one pointer field for each method in the interface. In // the case where we can't generate a binding for a method, we include a void // pointer. #[doc(hidden)] #[repr(C)] pub struct nsIFileVTable { /// We need to include the members from the base interface's vtable at the start /// of the VTable definition. pub __base: nsISupportsVTable, /* void append (in AString node); */ pub Append: unsafe extern "system" fn (this: *const nsIFile, node: &::nsstring::nsAString) -> nsresult, /* [noscript] void appendNative (in ACString node); */ pub AppendNative: unsafe extern "system" fn (this: *const nsIFile, node: &::nsstring::nsACString) -> nsresult, /* void normalize (); */ pub Normalize: unsafe extern "system" fn (this: *const nsIFile) -> nsresult, /* [must_use] void create (in unsigned long type, in unsigned long permissions); */ pub Create: unsafe extern "system" fn (this: *const nsIFile, type_: libc::uint32_t, permissions: libc::uint32_t) -> nsresult, /* attribute AString leafName; */ pub GetLeafName: unsafe extern "system" fn (this: *const nsIFile, aLeafName: &mut ::nsstring::nsAString) -> nsresult, /* attribute AString leafName; */ pub SetLeafName: unsafe extern "system" fn (this: *const nsIFile, aLeafName: &::nsstring::nsAString) -> nsresult, /* [noscript] attribute ACString nativeLeafName; */ pub GetNativeLeafName: unsafe extern "system" fn (this: *const nsIFile, aNativeLeafName: &mut ::nsstring::nsACString) -> nsresult, /* [noscript] attribute ACString nativeLeafName; */ pub SetNativeLeafName: unsafe extern "system" fn (this: *const nsIFile, aNativeLeafName: &::nsstring::nsACString) -> nsresult, /* void copyTo (in nsIFile newParentDir, in AString newName); */ pub CopyTo: unsafe extern "system" fn (this: *const nsIFile, newParentDir: *const nsIFile, newName: &::nsstring::nsAString) -> nsresult, /* [noscript] void CopyToNative (in nsIFile newParentDir, in ACString newName); */ pub CopyToNative: unsafe extern "system" fn (this: *const nsIFile, newParentDir: *const nsIFile, newName: &::nsstring::nsACString) -> nsresult, /* void copyToFollowingLinks (in nsIFile newParentDir, in AString newName); */ pub CopyToFollowingLinks: unsafe extern "system" fn (this: *const nsIFile, newParentDir: *const nsIFile, newName: &::nsstring::nsAString) -> nsresult, /* [noscript] void copyToFollowingLinksNative (in nsIFile newParentDir, in ACString newName); */ pub CopyToFollowingLinksNative: unsafe extern "system" fn (this: *const nsIFile, newParentDir: *const nsIFile, newName: &::nsstring::nsACString) -> nsresult, /* void moveTo (in nsIFile newParentDir, in AString newName); */ pub MoveTo: unsafe extern "system" fn (this: *const nsIFile, newParentDir: *const nsIFile, newName: &::nsstring::nsAString) -> nsresult, /* [noscript] void moveToNative (in nsIFile newParentDir, in ACString newName); */ pub MoveToNative: unsafe extern "system" fn (this: *const nsIFile, newParentDir: *const nsIFile, newName: &::nsstring::nsACString) -> nsresult, /* void renameTo (in nsIFile newParentDir, in AString newName); */ pub RenameTo: unsafe extern "system" fn (this: *const nsIFile, newParentDir: *const nsIFile, newName: &::nsstring::nsAString) -> nsresult, /* [noscript] void renameToNative (in nsIFile newParentDir, in ACString newName); */ pub RenameToNative: unsafe extern "system" fn (this: *const nsIFile, newParentDir: *const nsIFile, newName: &::nsstring::nsACString) -> nsresult, /* void remove (in boolean recursive); */ pub Remove: unsafe extern "system" fn (this: *const nsIFile, recursive: bool) -> nsresult, /* attribute unsigned long permissions; */ pub GetPermissions: unsafe extern "system" fn (this: *const nsIFile, aPermissions: *mut libc::uint32_t) -> nsresult, /* attribute unsigned long permissions; */ pub SetPermissions: unsafe extern "system" fn (this: *const nsIFile, aPermissions: libc::uint32_t) -> nsresult, /* attribute unsigned long permissionsOfLink; */ pub GetPermissionsOfLink: unsafe extern "system" fn (this: *const nsIFile, aPermissionsOfLink: *mut libc::uint32_t) -> nsresult, /* attribute unsigned long permissionsOfLink; */ pub SetPermissionsOfLink: unsafe extern "system" fn (this: *const nsIFile, aPermissionsOfLink: libc::uint32_t) -> nsresult, /* attribute PRTime lastModifiedTime; */ pub GetLastModifiedTime: unsafe extern "system" fn (this: *const nsIFile, aLastModifiedTime: *mut PRTime) -> nsresult, /* attribute PRTime lastModifiedTime; */ pub SetLastModifiedTime: unsafe extern "system" fn (this: *const nsIFile, aLastModifiedTime: PRTime) -> nsresult, /* attribute PRTime lastModifiedTimeOfLink; */ pub GetLastModifiedTimeOfLink: unsafe extern "system" fn (this: *const nsIFile, aLastModifiedTimeOfLink: *mut PRTime) -> nsresult, /* attribute PRTime lastModifiedTimeOfLink; */ pub SetLastModifiedTimeOfLink: unsafe extern "system" fn (this: *const nsIFile, aLastModifiedTimeOfLink: PRTime) -> nsresult, /* attribute int64_t fileSize; */ pub GetFileSize: unsafe extern "system" fn (this: *const nsIFile, aFileSize: *mut int64_t) -> nsresult, /* attribute int64_t fileSize; */ pub SetFileSize: unsafe extern "system" fn (this: *const nsIFile, aFileSize: int64_t) -> nsresult, /* readonly attribute int64_t fileSizeOfLink; */ pub GetFileSizeOfLink: unsafe extern "system" fn (this: *const nsIFile, aFileSizeOfLink: *mut int64_t) -> nsresult, /* readonly attribute AString target; */ pub GetTarget: unsafe extern "system" fn (this: *const nsIFile, aTarget: &mut ::nsstring::nsAString) -> nsresult, /* [noscript] readonly attribute ACString nativeTarget; */ pub GetNativeTarget: unsafe extern "system" fn (this: *const nsIFile, aNativeTarget: &mut ::nsstring::nsACString) -> nsresult, /* readonly attribute AString path; */ pub GetPath: unsafe extern "system" fn (this: *const nsIFile, aPath: &mut ::nsstring::nsAString) -> nsresult, /* [noscript] readonly attribute ACString nativePath; */ pub GetNativePath: unsafe extern "system" fn (this: *const nsIFile, aNativePath: &mut ::nsstring::nsACString) -> nsresult, /* boolean exists (); */ pub Exists: unsafe extern "system" fn (this: *const nsIFile, _retval: *mut bool) -> nsresult, /* boolean isWritable (); */ pub IsWritable: unsafe extern "system" fn (this: *const nsIFile, _retval: *mut bool) -> nsresult, /* boolean isReadable (); */ pub IsReadable: unsafe extern "system" fn (this: *const nsIFile, _retval: *mut bool) -> nsresult, /* boolean isExecutable (); */ pub IsExecutable: unsafe extern "system" fn (this: *const nsIFile, _retval: *mut bool) -> nsresult, /* boolean isHidden (); */ pub IsHidden: unsafe extern "system" fn (this: *const nsIFile, _retval: *mut bool) -> nsresult, /* boolean isDirectory (); */ pub IsDirectory: unsafe extern "system" fn (this: *const nsIFile, _retval: *mut bool) -> nsresult, /* boolean isFile (); */ pub IsFile: unsafe extern "system" fn (this: *const nsIFile, _retval: *mut bool) -> nsresult, /* boolean isSymlink (); */ pub IsSymlink: unsafe extern "system" fn (this: *const nsIFile, _retval: *mut bool) -> nsresult, /* boolean isSpecial (); */ pub IsSpecial: unsafe extern "system" fn (this: *const nsIFile, _retval: *mut bool) -> nsresult, /* [must_use] void createUnique (in unsigned long type, in unsigned long permissions); */ pub CreateUnique: unsafe extern "system" fn (this: *const nsIFile, type_: libc::uint32_t, permissions: libc::uint32_t) -> nsresult, /* nsIFile clone (); */ pub Clone: unsafe extern "system" fn (this: *const nsIFile, _retval: *mut *const nsIFile) -> nsresult, /* boolean equals (in nsIFile inFile); */ pub Equals: unsafe extern "system" fn (this: *const nsIFile, inFile: *const nsIFile, _retval: *mut bool) -> nsresult, /* boolean contains (in nsIFile inFile); */ pub Contains: unsafe extern "system" fn (this: *const nsIFile, inFile: *const nsIFile, _retval: *mut bool) -> nsresult, /* readonly attribute nsIFile parent; */ pub GetParent: unsafe extern "system" fn (this: *const nsIFile, aParent: *mut *const nsIFile) -> nsresult, /* readonly attribute nsISimpleEnumerator directoryEntries; */ pub GetDirectoryEntries: unsafe extern "system" fn (this: *const nsIFile, aDirectoryEntries: *mut *const nsISimpleEnumerator) -> nsresult, /* void initWithPath (in AString filePath); */ pub InitWithPath: unsafe extern "system" fn (this: *const nsIFile, filePath: &::nsstring::nsAString) -> nsresult, /* [noscript] void initWithNativePath (in ACString filePath); */ pub InitWithNativePath: unsafe extern "system" fn (this: *const nsIFile, filePath: &::nsstring::nsACString) -> nsresult, /* void initWithFile (in nsIFile aFile); */ pub InitWithFile: unsafe extern "system" fn (this: *const nsIFile, aFile: *const nsIFile) -> nsresult, /* attribute boolean followLinks; */ pub GetFollowLinks: unsafe extern "system" fn (this: *const nsIFile, aFollowLinks: *mut bool) -> nsresult, /* attribute boolean followLinks; */ pub SetFollowLinks: unsafe extern "system" fn (this: *const nsIFile, aFollowLinks: bool) -> nsresult, /* [must_use,noscript] PRFileDescStar openNSPRFileDesc (in long flags, in long mode); */ /// Unable to generate binding because `native type PRFileDesc is unsupported` pub OpenNSPRFileDesc: *const ::libc::c_void, /* [must_use,noscript] FILE openANSIFileDesc (in string mode); */ /// Unable to generate binding because `native type FILE is unsupported` pub OpenANSIFileDesc: *const ::libc::c_void, /* [must_use,noscript] PRLibraryStar load (); */ /// Unable to generate binding because `native type PRLibrary is unsupported` pub Load: *const ::libc::c_void, /* [must_use] readonly attribute int64_t diskSpaceAvailable; */ pub GetDiskSpaceAvailable: unsafe extern "system" fn (this: *const nsIFile, aDiskSpaceAvailable: *mut int64_t) -> nsresult, /* void appendRelativePath (in AString relativeFilePath); */ pub AppendRelativePath: unsafe extern "system" fn (this: *const nsIFile, relativeFilePath: &::nsstring::nsAString) -> nsresult, /* [noscript] void appendRelativeNativePath (in ACString relativeFilePath); */ pub AppendRelativeNativePath: unsafe extern "system" fn (this: *const nsIFile, relativeFilePath: &::nsstring::nsACString) -> nsresult, /* [must_use] attribute ACString persistentDescriptor; */ pub GetPersistentDescriptor: unsafe extern "system" fn (this: *const nsIFile, aPersistentDescriptor: &mut ::nsstring::nsACString) -> nsresult, /* [must_use] attribute ACString persistentDescriptor; */ pub SetPersistentDescriptor: unsafe extern "system" fn (this: *const nsIFile, aPersistentDescriptor: &::nsstring::nsACString) -> nsresult, /* [must_use] void reveal (); */ pub Reveal: unsafe extern "system" fn (this: *const nsIFile) -> nsresult, /* [must_use] void launch (); */ pub Launch: unsafe extern "system" fn (this: *const nsIFile) -> nsresult, /* [must_use] ACString getRelativeDescriptor (in nsIFile fromFile); */ pub GetRelativeDescriptor: unsafe extern "system" fn (this: *const nsIFile, fromFile: *const nsIFile, _retval: &mut ::nsstring::nsACString) -> nsresult, /* [must_use] void setRelativeDescriptor (in nsIFile fromFile, in ACString relativeDesc); */ pub SetRelativeDescriptor: unsafe extern "system" fn (this: *const nsIFile, fromFile: *const nsIFile, relativeDesc: &::nsstring::nsACString) -> nsresult, /* [must_use] AUTF8String getRelativePath (in nsIFile fromFile); */ pub GetRelativePath: unsafe extern "system" fn (this: *const nsIFile, fromFile: *const nsIFile, _retval: &mut ::nsstring::nsACString) -> nsresult, /* [must_use] void setRelativePath (in nsIFile fromFile, in AUTF8String relativeDesc); */ pub SetRelativePath: unsafe extern "system" fn (this: *const nsIFile, fromFile: *const nsIFile, relativeDesc: &::nsstring::nsACString) -> nsresult, } // The implementations of the function wrappers which are exposed to rust code. // Call these methods rather than manually calling through the VTable struct. impl nsIFile { /// ```text /// /** /// * Create Types /// * /// * NORMAL_FILE_TYPE - A normal file. /// * DIRECTORY_TYPE - A directory/folder. /// */ /// ``` /// pub const NORMAL_FILE_TYPE: i64 = 0; pub const DIRECTORY_TYPE: i64 = 1; /// ```text /// /** /// * Flag for openNSPRFileDesc(), to hint to the OS that the file will be /// * read sequentially with agressive readahead. /// */ /// ``` /// pub const OS_READAHEAD: i64 = 1073741824; /// ```text /// /** /// * Flag for openNSPRFileDesc(). Deprecated and unreliable! /// * Instead use NS_OpenAnonymousTemporaryFile() to create a temporary /// * file which will be deleted upon close! /// */ /// ``` /// pub const DELETE_ON_CLOSE: i64 = 2147483648; /// ```text /// /** /// * append[Native] /// * /// * This function is used for constructing a descendent of the /// * current nsIFile. /// * /// * @param node /// * A string which is intended to be a child node of the nsIFile. /// * For the |appendNative| method, the node must be in the native /// * filesystem charset. /// */ /// ``` /// /// `void append (in AString node);` #[inline] pub unsafe fn Append(&self, node: &::nsstring::nsAString) -> nsresult { ((*self.vtable).Append)(self, node) } /// `[noscript] void appendNative (in ACString node);` #[inline] pub unsafe fn AppendNative(&self, node: &::nsstring::nsACString) -> nsresult { ((*self.vtable).AppendNative)(self, node) } /// ```text /// /** /// * Normalize the pathName (e.g. removing .. and . components on Unix). /// */ /// ``` /// /// `void normalize ();` #[inline] pub unsafe fn Normalize(&self, ) -> nsresult { ((*self.vtable).Normalize)(self, ) } /// ```text /// /** /// * create /// * /// * This function will create a new file or directory in the /// * file system. Any nodes that have not been created or /// * resolved, will be. If the file or directory already /// * exists create() will return NS_ERROR_FILE_ALREADY_EXISTS. /// * /// * @param type /// * This specifies the type of file system object /// * to be made. The only two types at this time /// * are file and directory which are defined above. /// * If the type is unrecongnized, we will return an /// * error (NS_ERROR_FILE_UNKNOWN_TYPE). /// * /// * @param permissions /// * The unix style octal permissions. This may /// * be ignored on systems that do not need to do /// * permissions. /// */ /// ``` /// /// `[must_use] void create (in unsigned long type, in unsigned long permissions);` #[inline] pub unsafe fn Create(&self, type_: libc::uint32_t, permissions: libc::uint32_t) -> nsresult { ((*self.vtable).Create)(self, type_, permissions) } /// ```text /// /** /// * Accessor to the leaf name of the file itself. /// * For the |nativeLeafName| method, the nativeLeafName must /// * be in the native filesystem charset. /// */ /// ``` /// /// `attribute AString leafName;` #[inline] pub unsafe fn GetLeafName(&self, aLeafName: &mut ::nsstring::nsAString) -> nsresult { ((*self.vtable).GetLeafName)(self, aLeafName) } /// ```text /// /** /// * Accessor to the leaf name of the file itself. /// * For the |nativeLeafName| method, the nativeLeafName must /// * be in the native filesystem charset. /// */ /// ``` /// /// `attribute AString leafName;` #[inline] pub unsafe fn SetLeafName(&self, aLeafName: &::nsstring::nsAString) -> nsresult { ((*self.vtable).SetLeafName)(self, aLeafName) } /// `[noscript] attribute ACString nativeLeafName;` #[inline] pub unsafe fn GetNativeLeafName(&self, aNativeLeafName: &mut ::nsstring::nsACString) -> nsresult { ((*self.vtable).GetNativeLeafName)(self, aNativeLeafName) } /// `[noscript] attribute ACString nativeLeafName;` #[inline] pub unsafe fn SetNativeLeafName(&self, aNativeLeafName: &::nsstring::nsACString) -> nsresult { ((*self.vtable).SetNativeLeafName)(self, aNativeLeafName) } /// ```text /// /** /// * copyTo[Native] /// * /// * This will copy this file to the specified newParentDir. /// * If a newName is specified, the file will be renamed. /// * If 'this' is not created we will return an error /// * (NS_ERROR_FILE_TARGET_DOES_NOT_EXIST). /// * /// * copyTo may fail if the file already exists in the destination /// * directory. /// * /// * copyTo will NOT resolve aliases/shortcuts during the copy. /// * /// * @param newParentDir /// * This param is the destination directory. If the /// * newParentDir is null, copyTo() will use the parent /// * directory of this file. If the newParentDir is not /// * empty and is not a directory, an error will be /// * returned (NS_ERROR_FILE_DESTINATION_NOT_DIR). For the /// * |CopyToNative| method, the newName must be in the /// * native filesystem charset. /// * /// * @param newName /// * This param allows you to specify a new name for /// * the file to be copied. This param may be empty, in /// * which case the current leaf name will be used. /// */ /// ``` /// /// `void copyTo (in nsIFile newParentDir, in AString newName);` #[inline] pub unsafe fn CopyTo(&self, newParentDir: *const nsIFile, newName: &::nsstring::nsAString) -> nsresult { ((*self.vtable).CopyTo)(self, newParentDir, newName) } /// `[noscript] void CopyToNative (in nsIFile newParentDir, in ACString newName);` #[inline] pub unsafe fn CopyToNative(&self, newParentDir: *const nsIFile, newName: &::nsstring::nsACString) -> nsresult { ((*self.vtable).CopyToNative)(self, newParentDir, newName) } /// ```text /// /** /// * copyToFollowingLinks[Native] /// * /// * This function is identical to copyTo with the exception that, /// * as the name implies, it follows symbolic links. The XP_UNIX /// * implementation always follow symbolic links when copying. For /// * the |CopyToFollowingLinks| method, the newName must be in the /// * native filesystem charset. /// */ /// ``` /// /// `void copyToFollowingLinks (in nsIFile newParentDir, in AString newName);` #[inline] pub unsafe fn CopyToFollowingLinks(&self, newParentDir: *const nsIFile, newName: &::nsstring::nsAString) -> nsresult { ((*self.vtable).CopyToFollowingLinks)(self, newParentDir, newName) } /// `[noscript] void copyToFollowingLinksNative (in nsIFile newParentDir, in ACString newName);` #[inline] pub unsafe fn CopyToFollowingLinksNative(&self, newParentDir: *const nsIFile, newName: &::nsstring::nsACString) -> nsresult { ((*self.vtable).CopyToFollowingLinksNative)(self, newParentDir, newName) } /// ```text /// /** /// * moveTo[Native] /// * /// * A method to move this file or directory to newParentDir. /// * If a newName is specified, the file or directory will be renamed. /// * If 'this' is not created we will return an error /// * (NS_ERROR_FILE_TARGET_DOES_NOT_EXIST). /// * If 'this' is a file, and the destination file already exists, moveTo /// * will replace the old file. /// * This object is updated to refer to the new file. /// * /// * moveTo will NOT resolve aliases/shortcuts during the copy. /// * moveTo will do the right thing and allow copies across volumes. /// * moveTo will return an error (NS_ERROR_FILE_DIR_NOT_EMPTY) if 'this' is /// * a directory and the destination directory is not empty. /// * moveTo will return an error (NS_ERROR_FILE_ACCESS_DENIED) if 'this' is /// * a directory and the destination directory is not writable. /// * /// * @param newParentDir /// * This param is the destination directory. If the /// * newParentDir is empty, moveTo() will rename the file /// * within its current directory. If the newParentDir is /// * not empty and does not name a directory, an error will /// * be returned (NS_ERROR_FILE_DESTINATION_NOT_DIR). For /// * the |moveToNative| method, the newName must be in the /// * native filesystem charset. /// * /// * @param newName /// * This param allows you to specify a new name for /// * the file to be moved. This param may be empty, in /// * which case the current leaf name will be used. /// */ /// ``` /// /// `void moveTo (in nsIFile newParentDir, in AString newName);` #[inline] pub unsafe fn MoveTo(&self, newParentDir: *const nsIFile, newName: &::nsstring::nsAString) -> nsresult { ((*self.vtable).MoveTo)(self, newParentDir, newName) } /// `[noscript] void moveToNative (in nsIFile newParentDir, in ACString newName);` #[inline] pub unsafe fn MoveToNative(&self, newParentDir: *const nsIFile, newName: &::nsstring::nsACString) -> nsresult { ((*self.vtable).MoveToNative)(self, newParentDir, newName) } /// ```text /// /** /// * renameTo /// * /// * This method is identical to moveTo except that if this file or directory /// * is moved to a a different volume, it fails and returns an error /// * (NS_ERROR_FILE_ACCESS_DENIED). /// * This object will still point to the old location after renaming. /// */ /// ``` /// /// `void renameTo (in nsIFile newParentDir, in AString newName);` #[inline] pub unsafe fn RenameTo(&self, newParentDir: *const nsIFile, newName: &::nsstring::nsAString) -> nsresult { ((*self.vtable).RenameTo)(self, newParentDir, newName) } /// `[noscript] void renameToNative (in nsIFile newParentDir, in ACString newName);` #[inline] pub unsafe fn RenameToNative(&self, newParentDir: *const nsIFile, newName: &::nsstring::nsACString) -> nsresult { ((*self.vtable).RenameToNative)(self, newParentDir, newName) } /// ```text /// /** /// * This will try to delete this file. The 'recursive' flag /// * must be PR_TRUE to delete directories which are not empty. /// * /// * This will not resolve any symlinks. /// */ /// ``` /// /// `void remove (in boolean recursive);` #[inline] pub unsafe fn Remove(&self, recursive: bool) -> nsresult { ((*self.vtable).Remove)(self, recursive) } /// ```text /// /** /// * Attributes of nsIFile. /// */ /// ``` /// /// `attribute unsigned long permissions;` #[inline] pub unsafe fn GetPermissions(&self, aPermissions: *mut libc::uint32_t) -> nsresult { ((*self.vtable).GetPermissions)(self, aPermissions) } /// ```text /// /** /// * Attributes of nsIFile. /// */ /// ``` /// /// `attribute unsigned long permissions;` #[inline] pub unsafe fn SetPermissions(&self, aPermissions: libc::uint32_t) -> nsresult { ((*self.vtable).SetPermissions)(self, aPermissions) } /// `attribute unsigned long permissionsOfLink;` #[inline] pub unsafe fn GetPermissionsOfLink(&self, aPermissionsOfLink: *mut libc::uint32_t) -> nsresult { ((*self.vtable).GetPermissionsOfLink)(self, aPermissionsOfLink) } /// `attribute unsigned long permissionsOfLink;` #[inline] pub unsafe fn SetPermissionsOfLink(&self, aPermissionsOfLink: libc::uint32_t) -> nsresult { ((*self.vtable).SetPermissionsOfLink)(self, aPermissionsOfLink) } /// ```text /// /** /// * File Times are to be in milliseconds from /// * midnight (00:00:00), January 1, 1970 Greenwich Mean /// * Time (GMT). /// */ /// ``` /// /// `attribute PRTime lastModifiedTime;` #[inline] pub unsafe fn GetLastModifiedTime(&self, aLastModifiedTime: *mut PRTime) -> nsresult { ((*self.vtable).GetLastModifiedTime)(self, aLastModifiedTime) } /// ```text /// /** /// * File Times are to be in milliseconds from /// * midnight (00:00:00), January 1, 1970 Greenwich Mean /// * Time (GMT). /// */ /// ``` /// /// `attribute PRTime lastModifiedTime;` #[inline] pub unsafe fn SetLastModifiedTime(&self, aLastModifiedTime: PRTime) -> nsresult { ((*self.vtable).SetLastModifiedTime)(self, aLastModifiedTime) } /// `attribute PRTime lastModifiedTimeOfLink;` #[inline] pub unsafe fn GetLastModifiedTimeOfLink(&self, aLastModifiedTimeOfLink: *mut PRTime) -> nsresult { ((*self.vtable).GetLastModifiedTimeOfLink)(self, aLastModifiedTimeOfLink) } /// `attribute PRTime lastModifiedTimeOfLink;` #[inline] pub unsafe fn SetLastModifiedTimeOfLink(&self, aLastModifiedTimeOfLink: PRTime) -> nsresult { ((*self.vtable).SetLastModifiedTimeOfLink)(self, aLastModifiedTimeOfLink) } /// ```text /// /** /// * WARNING! On the Mac, getting/setting the file size with nsIFile /// * only deals with the size of the data fork. If you need to /// * know the size of the combined data and resource forks use the /// * GetFileSizeWithResFork() method defined on nsILocalFileMac. /// */ /// ``` /// /// `attribute int64_t fileSize;` #[inline] pub unsafe fn GetFileSize(&self, aFileSize: *mut int64_t) -> nsresult { ((*self.vtable).GetFileSize)(self, aFileSize) } /// ```text /// /** /// * WARNING! On the Mac, getting/setting the file size with nsIFile /// * only deals with the size of the data fork. If you need to /// * know the size of the combined data and resource forks use the /// * GetFileSizeWithResFork() method defined on nsILocalFileMac. /// */ /// ``` /// /// `attribute int64_t fileSize;` #[inline] pub unsafe fn SetFileSize(&self, aFileSize: int64_t) -> nsresult { ((*self.vtable).SetFileSize)(self, aFileSize) } /// `readonly attribute int64_t fileSizeOfLink;` #[inline] pub unsafe fn GetFileSizeOfLink(&self, aFileSizeOfLink: *mut int64_t) -> nsresult { ((*self.vtable).GetFileSizeOfLink)(self, aFileSizeOfLink) } /// ```text /// /** /// * target & path /// * /// * Accessor to the string path. The native version of these /// * strings are not guaranteed to be a usable path to pass to /// * NSPR or the C stdlib. There are problems that affect /// * platforms on which a path does not fully specify a file /// * because two volumes can have the same name (e.g., mac). /// * This is solved by holding "private", native data in the /// * nsIFile implementation. This native data is lost when /// * you convert to a string. /// * /// * DO NOT PASS TO USE WITH NSPR OR STDLIB! /// * /// * target /// * Find out what the symlink points at. Will give error /// * (NS_ERROR_FILE_INVALID_PATH) if not a symlink. /// * /// * path /// * Find out what the nsIFile points at. /// * /// * Note that the ACString attributes are returned in the /// * native filesystem charset. /// * /// */ /// ``` /// /// `readonly attribute AString target;` #[inline] pub unsafe fn GetTarget(&self, aTarget: &mut ::nsstring::nsAString) -> nsresult { ((*self.vtable).GetTarget)(self, aTarget) } /// `[noscript] readonly attribute ACString nativeTarget;` #[inline] pub unsafe fn GetNativeTarget(&self, aNativeTarget: &mut ::nsstring::nsACString) -> nsresult { ((*self.vtable).GetNativeTarget)(self, aNativeTarget) } /// `readonly attribute AString path;` #[inline] pub unsafe fn GetPath(&self, aPath: &mut ::nsstring::nsAString) -> nsresult { ((*self.vtable).GetPath)(self, aPath) } /// `[noscript] readonly attribute ACString nativePath;` #[inline] pub unsafe fn GetNativePath(&self, aNativePath: &mut ::nsstring::nsACString) -> nsresult { ((*self.vtable).GetNativePath)(self, aNativePath) } /// `boolean exists ();` #[inline] pub unsafe fn Exists(&self, _retval: *mut bool) -> nsresult { ((*self.vtable).Exists)(self, _retval) } /// `boolean isWritable ();` #[inline] pub unsafe fn IsWritable(&self, _retval: *mut bool) -> nsresult { ((*self.vtable).IsWritable)(self, _retval) } /// `boolean isReadable ();` #[inline] pub unsafe fn IsReadable(&self, _retval: *mut bool) -> nsresult { ((*self.vtable).IsReadable)(self, _retval) } /// `boolean isExecutable ();` #[inline] pub unsafe fn IsExecutable(&self, _retval: *mut bool) -> nsresult { ((*self.vtable).IsExecutable)(self, _retval) } /// `boolean isHidden ();` #[inline] pub unsafe fn IsHidden(&self, _retval: *mut bool) -> nsresult { ((*self.vtable).IsHidden)(self, _retval) } /// `boolean isDirectory ();` #[inline] pub unsafe fn IsDirectory(&self, _retval: *mut bool) -> nsresult { ((*self.vtable).IsDirectory)(self, _retval) } /// `boolean isFile ();` #[inline] pub unsafe fn IsFile(&self, _retval: *mut bool) -> nsresult { ((*self.vtable).IsFile)(self, _retval) } /// `boolean isSymlink ();` #[inline] pub unsafe fn IsSymlink(&self, _retval: *mut bool) -> nsresult { ((*self.vtable).IsSymlink)(self, _retval) } /// ```text /// /** /// * Not a regular file, not a directory, not a symlink. /// */ /// ``` /// /// `boolean isSpecial ();` #[inline] pub unsafe fn IsSpecial(&self, _retval: *mut bool) -> nsresult { ((*self.vtable).IsSpecial)(self, _retval) } /// ```text /// /** /// * createUnique /// * /// * This function will create a new file or directory in the /// * file system. Any nodes that have not been created or /// * resolved, will be. If this file already exists, we try /// * variations on the leaf name "suggestedName" until we find /// * one that did not already exist. /// * /// * If the search for nonexistent files takes too long /// * (thousands of the variants already exist), we give up and /// * return NS_ERROR_FILE_TOO_BIG. /// * /// * @param type /// * This specifies the type of file system object /// * to be made. The only two types at this time /// * are file and directory which are defined above. /// * If the type is unrecongnized, we will return an /// * error (NS_ERROR_FILE_UNKNOWN_TYPE). /// * /// * @param permissions /// * The unix style octal permissions. This may /// * be ignored on systems that do not need to do /// * permissions. /// */ /// ``` /// /// `[must_use] void createUnique (in unsigned long type, in unsigned long permissions);` #[inline] pub unsafe fn CreateUnique(&self, type_: libc::uint32_t, permissions: libc::uint32_t) -> nsresult { ((*self.vtable).CreateUnique)(self, type_, permissions) } /// ```text /// /** /// * clone() /// * /// * This function will allocate and initialize a nsIFile object to the /// * exact location of the |this| nsIFile. /// * /// * @param file /// * A nsIFile which this object will be initialize /// * with. /// * /// */ /// ``` /// /// `nsIFile clone ();` #[inline] pub unsafe fn Clone(&self, _retval: *mut *const nsIFile) -> nsresult { ((*self.vtable).Clone)(self, _retval) } /// ```text /// /** /// * Will determine if the inFile equals this. /// */ /// ``` /// /// `boolean equals (in nsIFile inFile);` #[inline] pub unsafe fn Equals(&self, inFile: *const nsIFile, _retval: *mut bool) -> nsresult { ((*self.vtable).Equals)(self, inFile, _retval) } /// ```text /// /** /// * Will determine if inFile is a descendant of this file. /// * This routine looks in subdirectories too. /// */ /// ``` /// /// `boolean contains (in nsIFile inFile);` #[inline] pub unsafe fn Contains(&self, inFile: *const nsIFile, _retval: *mut bool) -> nsresult { ((*self.vtable).Contains)(self, inFile, _retval) } /// ```text /// /** /// * Parent will be null when this is at the top of the volume. /// */ /// ``` /// /// `readonly attribute nsIFile parent;` #[inline] pub unsafe fn GetParent(&self, aParent: *mut *const nsIFile) -> nsresult { ((*self.vtable).GetParent)(self, aParent) } /// ```text /// /** /// * Returns an enumeration of the elements in a directory. Each /// * element in the enumeration is an nsIFile. /// * /// * @throws NS_ERROR_FILE_NOT_DIRECTORY if the current nsIFile does /// * not specify a directory. /// */ /// ``` /// /// `readonly attribute nsISimpleEnumerator directoryEntries;` #[inline] pub unsafe fn GetDirectoryEntries(&self, aDirectoryEntries: *mut *const nsISimpleEnumerator) -> nsresult { ((*self.vtable).GetDirectoryEntries)(self, aDirectoryEntries) } /// ```text /// /** /// * initWith[Native]Path /// * /// * This function will initialize the nsIFile object. Any /// * internal state information will be reset. /// * /// * @param filePath /// * A string which specifies a full file path to a /// * location. Relative paths will be treated as an /// * error (NS_ERROR_FILE_UNRECOGNIZED_PATH). For /// * initWithNativePath, the filePath must be in the native /// * filesystem charset. /// */ /// ``` /// /// `void initWithPath (in AString filePath);` #[inline] pub unsafe fn InitWithPath(&self, filePath: &::nsstring::nsAString) -> nsresult { ((*self.vtable).InitWithPath)(self, filePath) } /// `[noscript] void initWithNativePath (in ACString filePath);` #[inline] pub unsafe fn InitWithNativePath(&self, filePath: &::nsstring::nsACString) -> nsresult { ((*self.vtable).InitWithNativePath)(self, filePath) } /// ```text /// /** /// * initWithFile /// * /// * Initialize this object with another file /// * /// * @param aFile /// * the file this becomes equivalent to /// */ /// ``` /// /// `void initWithFile (in nsIFile aFile);` #[inline] pub unsafe fn InitWithFile(&self, aFile: *const nsIFile) -> nsresult { ((*self.vtable).InitWithFile)(self, aFile) } /// ```text /// /** /// * followLinks /// * /// * This attribute will determine if the nsLocalFile will auto /// * resolve symbolic links. By default, this value will be false /// * on all non unix systems. On unix, this attribute is effectively /// * a noop. /// */ /// ``` /// /// `attribute boolean followLinks;` #[inline] pub unsafe fn GetFollowLinks(&self, aFollowLinks: *mut bool) -> nsresult { ((*self.vtable).GetFollowLinks)(self, aFollowLinks) } /// ```text /// /** /// * followLinks /// * /// * This attribute will determine if the nsLocalFile will auto /// * resolve symbolic links. By default, this value will be false /// * on all non unix systems. On unix, this attribute is effectively /// * a noop. /// */ /// ``` /// /// `attribute boolean followLinks;` #[inline] pub unsafe fn SetFollowLinks(&self, aFollowLinks: bool) -> nsresult { ((*self.vtable).SetFollowLinks)(self, aFollowLinks) } /// ```text /// /** /// * Return the result of PR_Open on the file. The caller is /// * responsible for calling PR_Close on the result. On success, the /// * returned PRFileDescr must be non-null. /// * /// * @param flags the PR_Open flags from prio.h, plus optionally /// * OS_READAHEAD or DELETE_ON_CLOSE. OS_READAHEAD is a hint to the /// * OS that the file will be read sequentially with agressive /// * readahead. DELETE_ON_CLOSE is unreliable on Windows and is deprecated. /// * Instead use NS_OpenAnonymousTemporaryFile() to create a temporary /// * file which will be deleted upon close. /// */ /// ``` /// /// `[must_use,noscript] PRFileDescStar openNSPRFileDesc (in long flags, in long mode);` const _OpenNSPRFileDesc: () = (); /// ```text /// /** /// * Return the result of fopen on the file. The caller is /// * responsible for calling fclose on the result. On success, the /// * returned FILE pointer must be non-null. /// */ /// ``` /// /// `[must_use,noscript] FILE openANSIFileDesc (in string mode);` const _OpenANSIFileDesc: () = (); /// ```text /// /** /// * Return the result of PR_LoadLibrary on the file. The caller is /// * responsible for calling PR_UnloadLibrary on the result. /// */ /// ``` /// /// `[must_use,noscript] PRLibraryStar load ();` const _Load: () = (); /// `[must_use] readonly attribute int64_t diskSpaceAvailable;` #[inline] pub unsafe fn GetDiskSpaceAvailable(&self, aDiskSpaceAvailable: *mut int64_t) -> nsresult { ((*self.vtable).GetDiskSpaceAvailable)(self, aDiskSpaceAvailable) } /// ```text /// /** /// * appendRelative[Native]Path /// * /// * Append a relative path to the current path of the nsIFile object. /// * /// * @param relativeFilePath /// * relativeFilePath is a native relative path. For security reasons, /// * this cannot contain .. or cannot start with a directory separator. /// * For the |appendRelativeNativePath| method, the relativeFilePath /// * must be in the native filesystem charset. /// */ /// ``` /// /// `void appendRelativePath (in AString relativeFilePath);` #[inline] pub unsafe fn AppendRelativePath(&self, relativeFilePath: &::nsstring::nsAString) -> nsresult { ((*self.vtable).AppendRelativePath)(self, relativeFilePath) } /// `[noscript] void appendRelativeNativePath (in ACString relativeFilePath);` #[inline] pub unsafe fn AppendRelativeNativePath(&self, relativeFilePath: &::nsstring::nsACString) -> nsresult { ((*self.vtable).AppendRelativeNativePath)(self, relativeFilePath) } /// ```text /// /** /// * Accessor to a null terminated string which will specify /// * the file in a persistent manner for disk storage. /// * /// * The character set of this attribute is undefined. DO NOT TRY TO /// * INTERPRET IT AS HUMAN READABLE TEXT! /// */ /// ``` /// /// `[must_use] attribute ACString persistentDescriptor;` #[inline] pub unsafe fn GetPersistentDescriptor(&self, aPersistentDescriptor: &mut ::nsstring::nsACString) -> nsresult { ((*self.vtable).GetPersistentDescriptor)(self, aPersistentDescriptor) } /// ```text /// /** /// * Accessor to a null terminated string which will specify /// * the file in a persistent manner for disk storage. /// * /// * The character set of this attribute is undefined. DO NOT TRY TO /// * INTERPRET IT AS HUMAN READABLE TEXT! /// */ /// ``` /// /// `[must_use] attribute ACString persistentDescriptor;` #[inline] pub unsafe fn SetPersistentDescriptor(&self, aPersistentDescriptor: &::nsstring::nsACString) -> nsresult { ((*self.vtable).SetPersistentDescriptor)(self, aPersistentDescriptor) } /// ```text /// /** /// * reveal /// * /// * Ask the operating system to open the folder which contains /// * this file or folder. This routine only works on platforms which /// * support the ability to open a folder and is run async on Windows. /// * This routine must be called on the main. /// */ /// ``` /// /// `[must_use] void reveal ();` #[inline] pub unsafe fn Reveal(&self, ) -> nsresult { ((*self.vtable).Reveal)(self, ) } /// ```text /// /** /// * launch /// * /// * Ask the operating system to attempt to open the file. /// * this really just simulates "double clicking" the file on your platform. /// * This routine only works on platforms which support this functionality /// * and is run async on Windows. This routine must be called on the /// * main thread. /// */ /// ``` /// /// `[must_use] void launch ();` #[inline] pub unsafe fn Launch(&self, ) -> nsresult { ((*self.vtable).Launch)(self, ) } /// ```text /// /** /// * getRelativeDescriptor /// * /// * Returns a relative file path in an opaque, XP format. It is therefore /// * not a native path. /// * /// * The character set of the string returned from this function is /// * undefined. DO NOT TRY TO INTERPRET IT AS HUMAN READABLE TEXT! /// * /// * @param fromFile /// * the file from which the descriptor is relative. /// * Throws if fromFile is null. /// */ /// ``` /// /// `[must_use] ACString getRelativeDescriptor (in nsIFile fromFile);` #[inline] pub unsafe fn GetRelativeDescriptor(&self, fromFile: *const nsIFile, _retval: &mut ::nsstring::nsACString) -> nsresult { ((*self.vtable).GetRelativeDescriptor)(self, fromFile, _retval) } /// ```text /// /** /// * setRelativeDescriptor /// * /// * Initializes the file to the location relative to fromFile using /// * a string returned by getRelativeDescriptor. /// * /// * @param fromFile /// * the file to which the descriptor is relative /// * @param relative /// * the relative descriptor obtained from getRelativeDescriptor /// */ /// ``` /// /// `[must_use] void setRelativeDescriptor (in nsIFile fromFile, in ACString relativeDesc);` #[inline] pub unsafe fn SetRelativeDescriptor(&self, fromFile: *const nsIFile, relativeDesc: &::nsstring::nsACString) -> nsresult { ((*self.vtable).SetRelativeDescriptor)(self, fromFile, relativeDesc) } /// ```text /// /** /// * getRelativePath /// * /// * Returns a relative file from 'fromFile' to this file as a UTF-8 string. /// * Going up the directory tree is represented via "../". '/' is used as /// * the path segment separator. This is not a native path, since it's UTF-8 /// * encoded. /// * /// * @param fromFile /// * the file from which the path is relative. /// * Throws if fromFile is null. /// */ /// ``` /// /// `[must_use] AUTF8String getRelativePath (in nsIFile fromFile);` #[inline] pub unsafe fn GetRelativePath(&self, fromFile: *const nsIFile, _retval: &mut ::nsstring::nsACString) -> nsresult { ((*self.vtable).GetRelativePath)(self, fromFile, _retval) } /// ```text /// /** /// * setRelativePath /// * /// * Initializes the file to the location relative to fromFile using /// * a string returned by getRelativePath. /// * /// * @param fromFile /// * the file from which the path is relative /// * @param relative /// * the relative path obtained from getRelativePath /// */ /// ``` /// /// `[must_use] void setRelativePath (in nsIFile fromFile, in AUTF8String relativeDesc);` #[inline] pub unsafe fn SetRelativePath(&self, fromFile: *const nsIFile, relativeDesc: &::nsstring::nsACString) -> nsresult { ((*self.vtable).SetRelativePath)(self, fromFile, relativeDesc) } }