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
|
/*
* DO NOT EDIT. THIS FILE IS GENERATED FROM c:/mozilla/xpcom/io/nsIFile.idl
*/
#ifndef __gen_nsIFile_h__
#define __gen_nsIFile_h__
#ifndef __gen_nsISupports_h__
#include "nsISupports.h"
#endif
/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
class nsISimpleEnumerator; /* forward declaration */
/* starting interface: nsIFile */
#define NS_IFILE_IID_STR "c8c0a080-0868-11d3-915f-d9d889d48e3c"
#define NS_IFILE_IID \
{0xc8c0a080, 0x0868, 0x11d3, \
{ 0x91, 0x5f, 0xd9, 0xd8, 0x89, 0xd4, 0x8e, 0x3c }}
/**
* 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.
*
* 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.
*
* @status FROZEN
*/
class NS_NO_VTABLE nsIFile : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IFILE_IID)
/**
* Create Types
*
* NORMAL_FILE_TYPE - A normal file.
* DIRECTORY_TYPE - A directory/folder.
*/
enum { NORMAL_FILE_TYPE = 0U };
enum { DIRECTORY_TYPE = 1U };
/**
* 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); */
NS_IMETHOD Append(const nsAString & node) = 0;
/* [noscript] void appendNative (in ACString node); */
NS_IMETHOD AppendNative(const nsACString & node) = 0;
/**
* Normalize the pathName (e.g. removing .. and . components on Unix).
*/
/* void normalize (); */
NS_IMETHOD Normalize(void) = 0;
/**
* 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.
*/
/* void create (in unsigned long type, in unsigned long permissions); */
NS_IMETHOD Create(PRUint32 type, PRUint32 permissions) = 0;
/**
* 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; */
NS_IMETHOD GetLeafName(nsAString & aLeafName) = 0;
NS_IMETHOD SetLeafName(const nsAString & aLeafName) = 0;
/* [noscript] attribute ACString nativeLeafName; */
NS_IMETHOD GetNativeLeafName(nsACString & aNativeLeafName) = 0;
NS_IMETHOD SetNativeLeafName(const nsACString & aNativeLeafName) = 0;
/**
* 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); */
NS_IMETHOD CopyTo(nsIFile *newParentDir, const nsAString & newName) = 0;
/* [noscript] void CopyToNative (in nsIFile newParentDir, in ACString newName); */
NS_IMETHOD CopyToNative(nsIFile *newParentDir, const nsACString & newName) = 0;
/**
* 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); */
NS_IMETHOD CopyToFollowingLinks(nsIFile *newParentDir, const nsAString & newName) = 0;
/* [noscript] void copyToFollowingLinksNative (in nsIFile newParentDir, in ACString newName); */
NS_IMETHOD CopyToFollowingLinksNative(nsIFile *newParentDir, const nsACString & newName) = 0;
/**
* 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.
*
* 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); */
NS_IMETHOD MoveTo(nsIFile *newParentDir, const nsAString & newName) = 0;
/* [noscript] void moveToNative (in nsIFile newParentDir, in ACString newName); */
NS_IMETHOD MoveToNative(nsIFile *newParentDir, const nsACString & newName) = 0;
/**
* 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); */
NS_IMETHOD Remove(PRBool recursive) = 0;
/**
* Attributes of nsIFile.
*/
/* attribute unsigned long permissions; */
NS_IMETHOD GetPermissions(PRUint32 *aPermissions) = 0;
NS_IMETHOD SetPermissions(PRUint32 aPermissions) = 0;
/* attribute unsigned long permissionsOfLink; */
NS_IMETHOD GetPermissionsOfLink(PRUint32 *aPermissionsOfLink) = 0;
NS_IMETHOD SetPermissionsOfLink(PRUint32 aPermissionsOfLink) = 0;
/**
* File Times are to be in milliseconds from
* midnight (00:00:00), January 1, 1970 Greenwich Mean
* Time (GMT).
*/
/* attribute PRInt64 lastModifiedTime; */
NS_IMETHOD GetLastModifiedTime(PRInt64 *aLastModifiedTime) = 0;
NS_IMETHOD SetLastModifiedTime(PRInt64 aLastModifiedTime) = 0;
/* attribute PRInt64 lastModifiedTimeOfLink; */
NS_IMETHOD GetLastModifiedTimeOfLink(PRInt64 *aLastModifiedTimeOfLink) = 0;
NS_IMETHOD SetLastModifiedTimeOfLink(PRInt64 aLastModifiedTimeOfLink) = 0;
/**
* 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 PRInt64 fileSize; */
NS_IMETHOD GetFileSize(PRInt64 *aFileSize) = 0;
NS_IMETHOD SetFileSize(PRInt64 aFileSize) = 0;
/* readonly attribute PRInt64 fileSizeOfLink; */
NS_IMETHOD GetFileSizeOfLink(PRInt64 *aFileSizeOfLink) = 0;
/**
* 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., XP_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; */
NS_IMETHOD GetTarget(nsAString & aTarget) = 0;
/* [noscript] readonly attribute ACString nativeTarget; */
NS_IMETHOD GetNativeTarget(nsACString & aNativeTarget) = 0;
/* readonly attribute AString path; */
NS_IMETHOD GetPath(nsAString & aPath) = 0;
/* [noscript] readonly attribute ACString nativePath; */
NS_IMETHOD GetNativePath(nsACString & aNativePath) = 0;
/* boolean exists (); */
NS_IMETHOD Exists(PRBool *_retval) = 0;
/* boolean isWritable (); */
NS_IMETHOD IsWritable(PRBool *_retval) = 0;
/* boolean isReadable (); */
NS_IMETHOD IsReadable(PRBool *_retval) = 0;
/* boolean isExecutable (); */
NS_IMETHOD IsExecutable(PRBool *_retval) = 0;
/* boolean isHidden (); */
NS_IMETHOD IsHidden(PRBool *_retval) = 0;
/* boolean isDirectory (); */
NS_IMETHOD IsDirectory(PRBool *_retval) = 0;
/* boolean isFile (); */
NS_IMETHOD IsFile(PRBool *_retval) = 0;
/* boolean isSymlink (); */
NS_IMETHOD IsSymlink(PRBool *_retval) = 0;
/**
* Not a regular file, not a directory, not a symlink.
*/
/* boolean isSpecial (); */
NS_IMETHOD IsSpecial(PRBool *_retval) = 0;
/**
* 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.
*/
/* void createUnique (in unsigned long type, in unsigned long permissions); */
NS_IMETHOD CreateUnique(PRUint32 type, PRUint32 permissions) = 0;
/**
* 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 (); */
NS_IMETHOD Clone(nsIFile **_retval) = 0;
/**
* Will determine if the inFile equals this.
*/
/* boolean equals (in nsIFile inFile); */
NS_IMETHOD Equals(nsIFile *inFile, PRBool *_retval) = 0;
/**
* Will determine if inFile is a descendant of this file
* If |recur| is true, look in subdirectories too
*/
/* boolean contains (in nsIFile inFile, in boolean recur); */
NS_IMETHOD Contains(nsIFile *inFile, PRBool recur, PRBool *_retval) = 0;
/**
* Parent will be null when this is at the top of the volume.
*/
/* readonly attribute nsIFile parent; */
NS_IMETHOD GetParent(nsIFile * *aParent) = 0;
/**
* Returns an enumeration of the elements in a directory. Each
* element in the enumeration is an nsIFile.
*
* @return NS_ERROR_FILE_NOT_DIRECTORY if the current nsIFile does
* not specify a directory.
*/
/* readonly attribute nsISimpleEnumerator directoryEntries; */
NS_IMETHOD GetDirectoryEntries(nsISimpleEnumerator * *aDirectoryEntries) = 0;
};
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIFILE \
NS_IMETHOD Append(const nsAString & node); \
NS_IMETHOD AppendNative(const nsACString & node); \
NS_IMETHOD Normalize(void); \
NS_IMETHOD Create(PRUint32 type, PRUint32 permissions); \
NS_IMETHOD GetLeafName(nsAString & aLeafName); \
NS_IMETHOD SetLeafName(const nsAString & aLeafName); \
NS_IMETHOD GetNativeLeafName(nsACString & aNativeLeafName); \
NS_IMETHOD SetNativeLeafName(const nsACString & aNativeLeafName); \
NS_IMETHOD CopyTo(nsIFile *newParentDir, const nsAString & newName); \
NS_IMETHOD CopyToNative(nsIFile *newParentDir, const nsACString & newName); \
NS_IMETHOD CopyToFollowingLinks(nsIFile *newParentDir, const nsAString & newName); \
NS_IMETHOD CopyToFollowingLinksNative(nsIFile *newParentDir, const nsACString & newName); \
NS_IMETHOD MoveTo(nsIFile *newParentDir, const nsAString & newName); \
NS_IMETHOD MoveToNative(nsIFile *newParentDir, const nsACString & newName); \
NS_IMETHOD Remove(PRBool recursive); \
NS_IMETHOD GetPermissions(PRUint32 *aPermissions); \
NS_IMETHOD SetPermissions(PRUint32 aPermissions); \
NS_IMETHOD GetPermissionsOfLink(PRUint32 *aPermissionsOfLink); \
NS_IMETHOD SetPermissionsOfLink(PRUint32 aPermissionsOfLink); \
NS_IMETHOD GetLastModifiedTime(PRInt64 *aLastModifiedTime); \
NS_IMETHOD SetLastModifiedTime(PRInt64 aLastModifiedTime); \
NS_IMETHOD GetLastModifiedTimeOfLink(PRInt64 *aLastModifiedTimeOfLink); \
NS_IMETHOD SetLastModifiedTimeOfLink(PRInt64 aLastModifiedTimeOfLink); \
NS_IMETHOD GetFileSize(PRInt64 *aFileSize); \
NS_IMETHOD SetFileSize(PRInt64 aFileSize); \
NS_IMETHOD GetFileSizeOfLink(PRInt64 *aFileSizeOfLink); \
NS_IMETHOD GetTarget(nsAString & aTarget); \
NS_IMETHOD GetNativeTarget(nsACString & aNativeTarget); \
NS_IMETHOD GetPath(nsAString & aPath); \
NS_IMETHOD GetNativePath(nsACString & aNativePath); \
NS_IMETHOD Exists(PRBool *_retval); \
NS_IMETHOD IsWritable(PRBool *_retval); \
NS_IMETHOD IsReadable(PRBool *_retval); \
NS_IMETHOD IsExecutable(PRBool *_retval); \
NS_IMETHOD IsHidden(PRBool *_retval); \
NS_IMETHOD IsDirectory(PRBool *_retval); \
NS_IMETHOD IsFile(PRBool *_retval); \
NS_IMETHOD IsSymlink(PRBool *_retval); \
NS_IMETHOD IsSpecial(PRBool *_retval); \
NS_IMETHOD CreateUnique(PRUint32 type, PRUint32 permissions); \
NS_IMETHOD Clone(nsIFile **_retval); \
NS_IMETHOD Equals(nsIFile *inFile, PRBool *_retval); \
NS_IMETHOD Contains(nsIFile *inFile, PRBool recur, PRBool *_retval); \
NS_IMETHOD GetParent(nsIFile * *aParent); \
NS_IMETHOD GetDirectoryEntries(nsISimpleEnumerator * *aDirectoryEntries);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIFILE(_to) \
NS_IMETHOD Append(const nsAString & node) { return _to Append(node); } \
NS_IMETHOD AppendNative(const nsACString & node) { return _to AppendNative(node); } \
NS_IMETHOD Normalize(void) { return _to Normalize(); } \
NS_IMETHOD Create(PRUint32 type, PRUint32 permissions) { return _to Create(type, permissions); } \
NS_IMETHOD GetLeafName(nsAString & aLeafName) { return _to GetLeafName(aLeafName); } \
NS_IMETHOD SetLeafName(const nsAString & aLeafName) { return _to SetLeafName(aLeafName); } \
NS_IMETHOD GetNativeLeafName(nsACString & aNativeLeafName) { return _to GetNativeLeafName(aNativeLeafName); } \
NS_IMETHOD SetNativeLeafName(const nsACString & aNativeLeafName) { return _to SetNativeLeafName(aNativeLeafName); } \
NS_IMETHOD CopyTo(nsIFile *newParentDir, const nsAString & newName) { return _to CopyTo(newParentDir, newName); } \
NS_IMETHOD CopyToNative(nsIFile *newParentDir, const nsACString & newName) { return _to CopyToNative(newParentDir, newName); } \
NS_IMETHOD CopyToFollowingLinks(nsIFile *newParentDir, const nsAString & newName) { return _to CopyToFollowingLinks(newParentDir, newName); } \
NS_IMETHOD CopyToFollowingLinksNative(nsIFile *newParentDir, const nsACString & newName) { return _to CopyToFollowingLinksNative(newParentDir, newName); } \
NS_IMETHOD MoveTo(nsIFile *newParentDir, const nsAString & newName) { return _to MoveTo(newParentDir, newName); } \
NS_IMETHOD MoveToNative(nsIFile *newParentDir, const nsACString & newName) { return _to MoveToNative(newParentDir, newName); } \
NS_IMETHOD Remove(PRBool recursive) { return _to Remove(recursive); } \
NS_IMETHOD GetPermissions(PRUint32 *aPermissions) { return _to GetPermissions(aPermissions); } \
NS_IMETHOD SetPermissions(PRUint32 aPermissions) { return _to SetPermissions(aPermissions); } \
NS_IMETHOD GetPermissionsOfLink(PRUint32 *aPermissionsOfLink) { return _to GetPermissionsOfLink(aPermissionsOfLink); } \
NS_IMETHOD SetPermissionsOfLink(PRUint32 aPermissionsOfLink) { return _to SetPermissionsOfLink(aPermissionsOfLink); } \
NS_IMETHOD GetLastModifiedTime(PRInt64 *aLastModifiedTime) { return _to GetLastModifiedTime(aLastModifiedTime); } \
NS_IMETHOD SetLastModifiedTime(PRInt64 aLastModifiedTime) { return _to SetLastModifiedTime(aLastModifiedTime); } \
NS_IMETHOD GetLastModifiedTimeOfLink(PRInt64 *aLastModifiedTimeOfLink) { return _to GetLastModifiedTimeOfLink(aLastModifiedTimeOfLink); } \
NS_IMETHOD SetLastModifiedTimeOfLink(PRInt64 aLastModifiedTimeOfLink) { return _to SetLastModifiedTimeOfLink(aLastModifiedTimeOfLink); } \
NS_IMETHOD GetFileSize(PRInt64 *aFileSize) { return _to GetFileSize(aFileSize); } \
NS_IMETHOD SetFileSize(PRInt64 aFileSize) { return _to SetFileSize(aFileSize); } \
NS_IMETHOD GetFileSizeOfLink(PRInt64 *aFileSizeOfLink) { return _to GetFileSizeOfLink(aFileSizeOfLink); } \
NS_IMETHOD GetTarget(nsAString & aTarget) { return _to GetTarget(aTarget); } \
NS_IMETHOD GetNativeTarget(nsACString & aNativeTarget) { return _to GetNativeTarget(aNativeTarget); } \
NS_IMETHOD GetPath(nsAString & aPath) { return _to GetPath(aPath); } \
NS_IMETHOD GetNativePath(nsACString & aNativePath) { return _to GetNativePath(aNativePath); } \
NS_IMETHOD Exists(PRBool *_retval) { return _to Exists(_retval); } \
NS_IMETHOD IsWritable(PRBool *_retval) { return _to IsWritable(_retval); } \
NS_IMETHOD IsReadable(PRBool *_retval) { return _to IsReadable(_retval); } \
NS_IMETHOD IsExecutable(PRBool *_retval) { return _to IsExecutable(_retval); } \
NS_IMETHOD IsHidden(PRBool *_retval) { return _to IsHidden(_retval); } \
NS_IMETHOD IsDirectory(PRBool *_retval) { return _to IsDirectory(_retval); } \
NS_IMETHOD IsFile(PRBool *_retval) { return _to IsFile(_retval); } \
NS_IMETHOD IsSymlink(PRBool *_retval) { return _to IsSymlink(_retval); } \
NS_IMETHOD IsSpecial(PRBool *_retval) { return _to IsSpecial(_retval); } \
NS_IMETHOD CreateUnique(PRUint32 type, PRUint32 permissions) { return _to CreateUnique(type, permissions); } \
NS_IMETHOD Clone(nsIFile **_retval) { return _to Clone(_retval); } \
NS_IMETHOD Equals(nsIFile *inFile, PRBool *_retval) { return _to Equals(inFile, _retval); } \
NS_IMETHOD Contains(nsIFile *inFile, PRBool recur, PRBool *_retval) { return _to Contains(inFile, recur, _retval); } \
NS_IMETHOD GetParent(nsIFile * *aParent) { return _to GetParent(aParent); } \
NS_IMETHOD GetDirectoryEntries(nsISimpleEnumerator * *aDirectoryEntries) { return _to GetDirectoryEntries(aDirectoryEntries); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIFILE(_to) \
NS_IMETHOD Append(const nsAString & node) { return !_to ? NS_ERROR_NULL_POINTER : _to->Append(node); } \
NS_IMETHOD AppendNative(const nsACString & node) { return !_to ? NS_ERROR_NULL_POINTER : _to->AppendNative(node); } \
NS_IMETHOD Normalize(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Normalize(); } \
NS_IMETHOD Create(PRUint32 type, PRUint32 permissions) { return !_to ? NS_ERROR_NULL_POINTER : _to->Create(type, permissions); } \
NS_IMETHOD GetLeafName(nsAString & aLeafName) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLeafName(aLeafName); } \
NS_IMETHOD SetLeafName(const nsAString & aLeafName) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetLeafName(aLeafName); } \
NS_IMETHOD GetNativeLeafName(nsACString & aNativeLeafName) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetNativeLeafName(aNativeLeafName); } \
NS_IMETHOD SetNativeLeafName(const nsACString & aNativeLeafName) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetNativeLeafName(aNativeLeafName); } \
NS_IMETHOD CopyTo(nsIFile *newParentDir, const nsAString & newName) { return !_to ? NS_ERROR_NULL_POINTER : _to->CopyTo(newParentDir, newName); } \
NS_IMETHOD CopyToNative(nsIFile *newParentDir, const nsACString & newName) { return !_to ? NS_ERROR_NULL_POINTER : _to->CopyToNative(newParentDir, newName); } \
NS_IMETHOD CopyToFollowingLinks(nsIFile *newParentDir, const nsAString & newName) { return !_to ? NS_ERROR_NULL_POINTER : _to->CopyToFollowingLinks(newParentDir, newName); } \
NS_IMETHOD CopyToFollowingLinksNative(nsIFile *newParentDir, const nsACString & newName) { return !_to ? NS_ERROR_NULL_POINTER : _to->CopyToFollowingLinksNative(newParentDir, newName); } \
NS_IMETHOD MoveTo(nsIFile *newParentDir, const nsAString & newName) { return !_to ? NS_ERROR_NULL_POINTER : _to->MoveTo(newParentDir, newName); } \
NS_IMETHOD MoveToNative(nsIFile *newParentDir, const nsACString & newName) { return !_to ? NS_ERROR_NULL_POINTER : _to->MoveToNative(newParentDir, newName); } \
NS_IMETHOD Remove(PRBool recursive) { return !_to ? NS_ERROR_NULL_POINTER : _to->Remove(recursive); } \
NS_IMETHOD GetPermissions(PRUint32 *aPermissions) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPermissions(aPermissions); } \
NS_IMETHOD SetPermissions(PRUint32 aPermissions) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetPermissions(aPermissions); } \
NS_IMETHOD GetPermissionsOfLink(PRUint32 *aPermissionsOfLink) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPermissionsOfLink(aPermissionsOfLink); } \
NS_IMETHOD SetPermissionsOfLink(PRUint32 aPermissionsOfLink) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetPermissionsOfLink(aPermissionsOfLink); } \
NS_IMETHOD GetLastModifiedTime(PRInt64 *aLastModifiedTime) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLastModifiedTime(aLastModifiedTime); } \
NS_IMETHOD SetLastModifiedTime(PRInt64 aLastModifiedTime) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetLastModifiedTime(aLastModifiedTime); } \
NS_IMETHOD GetLastModifiedTimeOfLink(PRInt64 *aLastModifiedTimeOfLink) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLastModifiedTimeOfLink(aLastModifiedTimeOfLink); } \
NS_IMETHOD SetLastModifiedTimeOfLink(PRInt64 aLastModifiedTimeOfLink) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetLastModifiedTimeOfLink(aLastModifiedTimeOfLink); } \
NS_IMETHOD GetFileSize(PRInt64 *aFileSize) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFileSize(aFileSize); } \
NS_IMETHOD SetFileSize(PRInt64 aFileSize) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetFileSize(aFileSize); } \
NS_IMETHOD GetFileSizeOfLink(PRInt64 *aFileSizeOfLink) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFileSizeOfLink(aFileSizeOfLink); } \
NS_IMETHOD GetTarget(nsAString & aTarget) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetTarget(aTarget); } \
NS_IMETHOD GetNativeTarget(nsACString & aNativeTarget) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetNativeTarget(aNativeTarget); } \
NS_IMETHOD GetPath(nsAString & aPath) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPath(aPath); } \
NS_IMETHOD GetNativePath(nsACString & aNativePath) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetNativePath(aNativePath); } \
NS_IMETHOD Exists(PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->Exists(_retval); } \
NS_IMETHOD IsWritable(PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->IsWritable(_retval); } \
NS_IMETHOD IsReadable(PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->IsReadable(_retval); } \
NS_IMETHOD IsExecutable(PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->IsExecutable(_retval); } \
NS_IMETHOD IsHidden(PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->IsHidden(_retval); } \
NS_IMETHOD IsDirectory(PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->IsDirectory(_retval); } \
NS_IMETHOD IsFile(PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->IsFile(_retval); } \
NS_IMETHOD IsSymlink(PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->IsSymlink(_retval); } \
NS_IMETHOD IsSpecial(PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->IsSpecial(_retval); } \
NS_IMETHOD CreateUnique(PRUint32 type, PRUint32 permissions) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateUnique(type, permissions); } \
NS_IMETHOD Clone(nsIFile **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->Clone(_retval); } \
NS_IMETHOD Equals(nsIFile *inFile, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->Equals(inFile, _retval); } \
NS_IMETHOD Contains(nsIFile *inFile, PRBool recur, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->Contains(inFile, recur, _retval); } \
NS_IMETHOD GetParent(nsIFile * *aParent) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetParent(aParent); } \
NS_IMETHOD GetDirectoryEntries(nsISimpleEnumerator * *aDirectoryEntries) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDirectoryEntries(aDirectoryEntries); }
#if 0
/* Use the code below as a template for the implementation class for this interface. */
/* Header file */
class nsFile : public nsIFile
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIFILE
nsFile();
private:
~nsFile();
protected:
/* additional members */
};
/* Implementation file */
NS_IMPL_ISUPPORTS1(nsFile, nsIFile)
nsFile::nsFile()
{
/* member initializers and constructor code */
}
nsFile::~nsFile()
{
/* destructor code */
}
/* void append (in AString node); */
NS_IMETHODIMP nsFile::Append(const nsAString & node)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* [noscript] void appendNative (in ACString node); */
NS_IMETHODIMP nsFile::AppendNative(const nsACString & node)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void normalize (); */
NS_IMETHODIMP nsFile::Normalize()
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void create (in unsigned long type, in unsigned long permissions); */
NS_IMETHODIMP nsFile::Create(PRUint32 type, PRUint32 permissions)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* attribute AString leafName; */
NS_IMETHODIMP nsFile::GetLeafName(nsAString & aLeafName)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsFile::SetLeafName(const nsAString & aLeafName)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* [noscript] attribute ACString nativeLeafName; */
NS_IMETHODIMP nsFile::GetNativeLeafName(nsACString & aNativeLeafName)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsFile::SetNativeLeafName(const nsACString & aNativeLeafName)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void copyTo (in nsIFile newParentDir, in AString newName); */
NS_IMETHODIMP nsFile::CopyTo(nsIFile *newParentDir, const nsAString & newName)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* [noscript] void CopyToNative (in nsIFile newParentDir, in ACString newName); */
NS_IMETHODIMP nsFile::CopyToNative(nsIFile *newParentDir, const nsACString & newName)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void copyToFollowingLinks (in nsIFile newParentDir, in AString newName); */
NS_IMETHODIMP nsFile::CopyToFollowingLinks(nsIFile *newParentDir, const nsAString & newName)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* [noscript] void copyToFollowingLinksNative (in nsIFile newParentDir, in ACString newName); */
NS_IMETHODIMP nsFile::CopyToFollowingLinksNative(nsIFile *newParentDir, const nsACString & newName)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void moveTo (in nsIFile newParentDir, in AString newName); */
NS_IMETHODIMP nsFile::MoveTo(nsIFile *newParentDir, const nsAString & newName)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* [noscript] void moveToNative (in nsIFile newParentDir, in ACString newName); */
NS_IMETHODIMP nsFile::MoveToNative(nsIFile *newParentDir, const nsACString & newName)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void remove (in boolean recursive); */
NS_IMETHODIMP nsFile::Remove(PRBool recursive)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* attribute unsigned long permissions; */
NS_IMETHODIMP nsFile::GetPermissions(PRUint32 *aPermissions)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsFile::SetPermissions(PRUint32 aPermissions)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* attribute unsigned long permissionsOfLink; */
NS_IMETHODIMP nsFile::GetPermissionsOfLink(PRUint32 *aPermissionsOfLink)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsFile::SetPermissionsOfLink(PRUint32 aPermissionsOfLink)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* attribute PRInt64 lastModifiedTime; */
NS_IMETHODIMP nsFile::GetLastModifiedTime(PRInt64 *aLastModifiedTime)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsFile::SetLastModifiedTime(PRInt64 aLastModifiedTime)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* attribute PRInt64 lastModifiedTimeOfLink; */
NS_IMETHODIMP nsFile::GetLastModifiedTimeOfLink(PRInt64 *aLastModifiedTimeOfLink)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsFile::SetLastModifiedTimeOfLink(PRInt64 aLastModifiedTimeOfLink)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* attribute PRInt64 fileSize; */
NS_IMETHODIMP nsFile::GetFileSize(PRInt64 *aFileSize)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsFile::SetFileSize(PRInt64 aFileSize)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* readonly attribute PRInt64 fileSizeOfLink; */
NS_IMETHODIMP nsFile::GetFileSizeOfLink(PRInt64 *aFileSizeOfLink)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* readonly attribute AString target; */
NS_IMETHODIMP nsFile::GetTarget(nsAString & aTarget)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* [noscript] readonly attribute ACString nativeTarget; */
NS_IMETHODIMP nsFile::GetNativeTarget(nsACString & aNativeTarget)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* readonly attribute AString path; */
NS_IMETHODIMP nsFile::GetPath(nsAString & aPath)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* [noscript] readonly attribute ACString nativePath; */
NS_IMETHODIMP nsFile::GetNativePath(nsACString & aNativePath)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* boolean exists (); */
NS_IMETHODIMP nsFile::Exists(PRBool *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* boolean isWritable (); */
NS_IMETHODIMP nsFile::IsWritable(PRBool *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* boolean isReadable (); */
NS_IMETHODIMP nsFile::IsReadable(PRBool *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* boolean isExecutable (); */
NS_IMETHODIMP nsFile::IsExecutable(PRBool *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* boolean isHidden (); */
NS_IMETHODIMP nsFile::IsHidden(PRBool *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* boolean isDirectory (); */
NS_IMETHODIMP nsFile::IsDirectory(PRBool *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* boolean isFile (); */
NS_IMETHODIMP nsFile::IsFile(PRBool *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* boolean isSymlink (); */
NS_IMETHODIMP nsFile::IsSymlink(PRBool *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* boolean isSpecial (); */
NS_IMETHODIMP nsFile::IsSpecial(PRBool *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void createUnique (in unsigned long type, in unsigned long permissions); */
NS_IMETHODIMP nsFile::CreateUnique(PRUint32 type, PRUint32 permissions)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* nsIFile clone (); */
NS_IMETHODIMP nsFile::Clone(nsIFile **_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* boolean equals (in nsIFile inFile); */
NS_IMETHODIMP nsFile::Equals(nsIFile *inFile, PRBool *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* boolean contains (in nsIFile inFile, in boolean recur); */
NS_IMETHODIMP nsFile::Contains(nsIFile *inFile, PRBool recur, PRBool *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* readonly attribute nsIFile parent; */
NS_IMETHODIMP nsFile::GetParent(nsIFile * *aParent)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* readonly attribute nsISimpleEnumerator directoryEntries; */
NS_IMETHODIMP nsFile::GetDirectoryEntries(nsISimpleEnumerator * *aDirectoryEntries)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* End of implementation class template. */
#endif
#ifdef MOZILLA_INTERNAL_API
#include "nsDirectoryServiceUtils.h"
#endif
#endif /* __gen_nsIFile_h__ */
|