1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* ***** BEGIN LICENSE BLOCK *****
3
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
5
* The contents of this file are subject to the Netscape Public License
6
* Version 1.1 (the "License"); you may not use this file except in
7
* compliance with the License. You may obtain a copy of the License at
8
* http://www.mozilla.org/NPL/
10
* Software distributed under the License is distributed on an "AS IS" basis,
11
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12
* for the specific language governing rights and limitations under the
15
* The Original Code is mozilla.org code.
17
* The Initial Developer of the Original Code is
18
* Netscape Communications Corporation.
19
* Portions created by the Initial Developer are Copyright (C) 1998
20
* the Initial Developer. All Rights Reserved.
24
* Alternatively, the contents of this file may be used under the terms of
25
* either the GNU General Public License Version 2 or later (the "GPL"), or
26
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27
* in which case the provisions of the GPL or the LGPL are applicable instead
28
* of those above. If you wish to allow use of your version of this file only
29
* under the terms of either the GPL or the LGPL, and not to allow others to
30
* use your version of this file under the terms of the NPL, indicate your
31
* decision by deleting the provisions above and replace them with the notice
32
* and other provisions required by the GPL or the LGPL. If you do not delete
33
* the provisions above, a recipient may use your version of this file under
34
* the terms of any one of the NPL, the GPL or the LGPL.
36
* ***** END LICENSE BLOCK ***** */
41
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
42
THESE CLASSES ARE DEPRECATED AND UNSUPPORTED! USE |nsIFile| and |nsILocalFile|.
43
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
54
// First checked in on 98/11/20 by John R. McMullen in the wrong directory.
55
// Checked in again 98/12/04.
56
// Polished version 98/12/08.
58
//========================================================================================
62
// nsFilePath, nsFileURL, nsFileSpec, nsPersistentFileDescriptor
63
// nsDirectoryIterator.
65
// Q. How should I represent files at run time?
66
// A. Use nsFileSpec. Using char* will lose information on some platforms.
68
// Q. Then what are nsFilePath and nsFileURL for?
69
// A. Only when you need a char* parameter for legacy code.
71
// Q. How should I represent files in a persistent way (eg, in a disk file)?
72
// A. Use nsPersistentFileDescriptor. Convert to and from nsFileSpec at run time.
74
// This suite provides the following services:
76
// 1. Encapsulates all platform-specific file details, so that files can be
77
// described correctly without any platform #ifdefs
79
// 2. Type safety. This will fix the problems that used to occur because people
80
// confused file paths. They used to use const char*, which could mean three
81
// or four different things. Bugs were introduced as people coded, right up
82
// to the moment Communicator 4.5 shipped.
84
// 3. Used in conjunction with nsFileStream.h (q.v.), this supports all the power
85
// and readability of the ansi stream syntax.
89
// nsFilePath myPath("/Development/iotest.txt");
91
// nsOutputFileStream testStream(nsFileSpec(myPath));
92
// testStream << "Hello World" << nsEndl;
94
// 4. Handy methods for manipulating file specifiers safely, e.g. MakeUnique(),
95
// SetLeafName(), Exists().
97
// 5. Easy cross-conversion.
101
// Initialize a URL from a string
103
// nsFileURL fileURL("file:///Development/MPW/MPW%20Shell");
105
// Initialize a Unix-style path from a URL
107
// nsFilePath filePath(fileURL);
109
// Initialize a file spec from a URL
111
// nsFileSpec fileSpec(fileURL);
113
// Make the spec unique.
115
// fileSpec.MakeUnique();
117
// Assign the spec to a URL (causing conversion)
119
// fileURL = fileSpec;
121
// Assign a unix path using a string
123
// filePath = "/Development/MPW/SysErrs.err";
125
// Assign to a file spec using a unix path (causing conversion).
127
// fileSpec = filePath;
131
// fileSpec.MakeUnique();
133
// 6. Fixes a bug that have been there for a long time, and
134
// is inevitable if you use NSPR alone, where files are described as paths.
136
// The problem affects platforms (Macintosh) in which a path does not fully
137
// specify a file, because two volumes can have the same name. This
138
// is solved by holding a "private" native file spec inside the
139
// nsFilePath and nsFileURL classes, which is used when appropriate.
141
//========================================================================================
146
#include "xpcomobsolete.h"
148
#include "nsString.h"
149
#include "nsReadableUtils.h"
153
//========================================================================================
154
// Compiler-specific macros, as needed
155
//========================================================================================
156
#if !defined(NS_USING_NAMESPACE) && (defined(__MWERKS__) || defined(_MSC_VER))
157
#define NS_USING_NAMESPACE
160
#ifdef NS_USING_NAMESPACE
162
#define NS_NAMESPACE_PROTOTYPE
163
#define NS_NAMESPACE namespace
164
#define NS_NAMESPACE_END
165
#define NS_EXPLICIT explicit
168
#define NS_NAMESPACE_PROTOTYPE static
169
#define NS_NAMESPACE struct
170
#define NS_NAMESPACE_END ;
174
//=========================== End Compiler-specific macros ===============================
176
#include "nsILocalFile.h"
177
#include "nsCOMPtr.h"
181
#include "nsILocalFileMac.h"
182
#elif defined(XP_UNIX) || defined(XP_BEOS)
184
#elif defined(XP_WIN)
186
// This clashes with some of the Win32 system headers (specifically,
187
// winbase.h). Hopefully they'll have been included first; else we may
188
// have problems. We could include winbase.h before doing this;
189
// unfortunately, it's bring in too much crap and'd slow stuff down
190
// more than it's worth doing.
191
#ifdef CreateDirectory
192
#undef CreateDirectory
196
#elif defined(XP_OS2)
198
#define INCL_DOSERRORS
205
//========================================================================================
206
// Here are the allowable ways to describe a file.
207
//========================================================================================
209
class nsFileSpec; // Preferred. For i/o use nsInputFileStream, nsOutputFileStream
212
class nsNSPRPath; // This can be passed to NSPR file I/O routines, if you must.
213
class nsPersistentFileDescriptor; // Used for storage across program launches.
215
#define kFileURLPrefix "file://"
216
#define kFileURLPrefixLength (7)
218
class nsOutputStream;
220
class nsIOutputStream;
221
class nsIInputStream;
222
class nsOutputFileStream;
223
class nsInputFileStream;
224
class nsOutputConsoleStream;
226
class nsIUnicodeEncoder;
227
class nsIUnicodeDecoder;
229
//========================================================================================
230
// Conversion of native file errors to nsresult values. These are really only for use
231
// in the file module, clients of this interface shouldn't really need them.
232
// Error results returned from this interface have, in the low-order 16 bits,
233
// native errors that are masked to 16 bits. Assumption: a native error of 0 is success
234
// on all platforms. Note the way we define this using an inline function. This
235
// avoids multiple evaluation if people go NS_FILE_RESULT(function_call()).
236
#define NS_FILE_RESULT(x) ns_file_convert_result((PRInt32)x)
237
nsresult ns_file_convert_result(PRInt32 nativeErr);
238
#define NS_FILE_FAILURE NS_FILE_RESULT(-1)
240
//========================================================================================
241
class nsSimpleCharString
242
// An envelope for char*: reference counted. Used internally by all the nsFileSpec
244
//========================================================================================
247
nsSimpleCharString();
248
nsSimpleCharString(const char*);
249
nsSimpleCharString(const nsString&);
250
nsSimpleCharString(const nsSimpleCharString&);
251
nsSimpleCharString(const char* inData, PRUint32 inLength);
253
~nsSimpleCharString();
255
void operator = (const char*);
256
void operator = (const nsString&);
257
void operator = (const nsSimpleCharString&);
259
operator const char*() const { return mData ? mData->mString : 0; }
262
ReallocData(Length()); // requires detaching if shared...
263
return mData ? mData->mString : 0;
265
PRBool operator == (const char*);
266
PRBool operator == (const nsString&);
267
PRBool operator == (const nsSimpleCharString&);
269
void operator += (const char* inString);
270
nsSimpleCharString operator + (const char* inString) const;
272
char operator [](int i) const { return mData ? mData->mString[i] : '\0'; }
273
char& operator [](int i)
275
if (i >= (int)Length())
276
ReallocData((PRUint32)i + 1);
277
return mData->mString[i]; // caveat appelator
279
char& operator [](unsigned int i) { return (*this)[(int)i]; }
281
void Catenate(const char* inString1, const char* inString2);
284
PRBool IsEmpty() const { return Length() == 0; }
286
PRUint32 Length() const { return mData ? mData->mLength : 0; }
287
void SetLength(PRUint32 inLength) { ReallocData(inLength); }
288
void CopyFrom(const char* inData, PRUint32 inLength);
289
void LeafReplace(char inSeparator, const char* inLeafName);
290
char* GetLeaf(char inSeparator) const; // use PR_Free()
297
void ReallocData(PRUint32 inLength);
299
//--------------------------------------------------
301
//--------------------------------------------------
311
}; // class nsSimpleCharString
313
//========================================================================================
314
class NS_COM_OBSOLETE nsFileSpec
315
// This is whatever each platform really prefers to describe files as. Declared first
316
// because the other two types have an embedded nsFileSpec object.
317
//========================================================================================
322
// These two meathods take *native* file paths.
323
NS_EXPLICIT nsFileSpec(const char* inNativePath, PRBool inCreateDirs = PR_FALSE);
324
NS_EXPLICIT nsFileSpec(const nsString& inNativePath, PRBool inCreateDirs = PR_FALSE);
327
NS_EXPLICIT nsFileSpec(const nsFilePath& inPath);
328
NS_EXPLICIT nsFileSpec(const nsFileURL& inURL);
329
nsFileSpec(const nsFileSpec& inPath);
330
virtual ~nsFileSpec();
332
// These two operands take *native* file paths.
333
void operator = (const char* inNativePath);
335
void operator = (const nsFilePath& inPath);
336
void operator = (const nsFileURL& inURL);
337
void operator = (const nsFileSpec& inOther);
338
void operator = (const nsPersistentFileDescriptor& inOther);
340
PRBool operator ==(const nsFileSpec& inOther) const;
341
PRBool operator !=(const nsFileSpec& inOther) const;
344
// Returns a native path, and allows the
345
// path to be "passed" to legacy code. This practice
346
// is VERY EVIL and should only be used to support legacy
347
// code. Using it guarantees bugs on Macintosh.
348
// The path is cached and freed by the nsFileSpec destructor
349
// so do not delete (or free) it. See also nsNSPRPath below,
350
// if you really must pass a string to PR_OpenFile().
351
// Doing so will introduce two automatic bugs.
352
const char* GetCString() const;
354
// Same as GetCString (please read the comments).
355
// Do not try to free this!
356
operator const char* () const { return GetCString(); }
358
// Same as GetCString (please read the comments).
359
// Do not try to free this!
360
const char* GetNativePathCString() const { return GetCString(); }
362
PRBool IsChildOf(nsFileSpec &possibleParent);
365
// For Macintosh people, this is meant to be useful in its own right as a C++ version
366
// of the FSSpec struct.
370
ConstStr255Param name,
371
PRBool resolveAlias = PR_TRUE);
373
nsFileSpec(const FSSpec& inSpec, PRBool resolveAlias = PR_TRUE);
374
void operator = (const FSSpec& inSpec);
376
operator FSSpec* () { return &mSpec; }
377
operator const FSSpec* const () { return &mSpec; }
378
operator FSSpec& () { return mSpec; }
379
operator const FSSpec& () const { return mSpec; }
381
const FSSpec& GetFSSpec() const { return mSpec; }
382
FSSpec& GetFSSpec() { return mSpec; }
383
ConstFSSpecPtr GetFSSpecPtr() const { return &mSpec; }
384
FSSpecPtr GetFSSpecPtr() { return &mSpec; }
385
void MakeAliasSafe();
386
void MakeUnique(ConstStr255Param inSuggestedLeafName);
387
StringPtr GetLeafPName() { return mSpec.name; }
388
ConstStr255Param GetLeafPName() const { return mSpec.name; }
390
OSErr GetCatInfo(CInfoPBRec& outInfo) const;
392
OSErr SetFileTypeAndCreator(OSType type, OSType creator);
393
OSErr GetFileTypeAndCreator(OSType* type, OSType* creator);
395
#endif // end of Macintosh utility methods.
397
PRBool Valid() const { return NS_SUCCEEDED(Error()); }
398
nsresult Error() const
401
if (mPath.IsEmpty() && NS_SUCCEEDED(mError))
402
((nsFileSpec*)this)->mError = NS_ERROR_NOT_INITIALIZED;
406
PRBool Failed() const { return (PRBool)NS_FAILED(Error()); }
408
//--------------------------------------------------
409
// Queries and path algebra. These do not modify the disk.
410
//--------------------------------------------------
412
char* GetLeafName() const; // Allocated. Use nsCRT::free().
413
// inLeafName can be a relative path, so this allows
414
// one kind of concatenation of "paths".
415
void SetLeafName(const char* inLeafName);
417
// Return the filespec of the parent directory. Used
418
// in conjunction with GetLeafName(), this lets you
419
// parse a path into a list of node names. Beware,
420
// however, that the top node is still not a name,
421
// but a spec. Volumes on Macintosh can have identical
422
// names. Perhaps could be used for an operator --() ?
423
void GetParent(nsFileSpec& outSpec) const;
426
// ie nsFileSpec::TimeStamp. This is 32 bits now,
427
// but might change, eg, to a 64-bit class. So use the
428
// typedef, and use a streaming operator to convert
429
// to a string, so that your code won't break. It's
430
// none of your business what the number means. Don't
431
// rely on the implementation.
432
typedef PRUint32 TimeStamp;
434
// This will return different values on different
435
// platforms, even for the same file (eg, on a server).
436
// But if the platform is constant, it will increase after
437
// every file modification.
438
void GetModDate(TimeStamp& outStamp) const;
440
PRBool ModDateChanged(const TimeStamp& oldStamp) const
443
GetModDate(newStamp);
444
return newStamp != oldStamp;
447
PRUint32 GetFileSize() const;
448
PRInt64 GetDiskSpaceAvailable() const;
450
nsFileSpec operator + (const char* inRelativeUnixPath) const;
452
// Concatenate the relative path to this directory.
453
// Used for constructing the filespec of a descendant.
454
// This must be a directory for this to work. This differs
455
// from SetLeafName(), since the latter will work
456
// starting with a sibling of the directory and throws
457
// away its leaf information, whereas this one assumes
458
// this is a directory, and the relative path starts
460
void operator += (const char* inRelativeUnixPath);
464
void MakeUnique(const char* inSuggestedLeafName);
467
PRBool IsDirectory() const; // More stringent than Exists()
468
PRBool IsFile() const; // More stringent than Exists()
469
PRBool Exists() const;
471
PRBool IsHidden() const;
473
PRBool IsSymlink() const;
475
//--------------------------------------------------
476
// Creation and deletion of objects. These can modify the disk.
477
//--------------------------------------------------
479
// Called for the spec of an alias. Modifies the spec to
480
// point to the original. Sets mError.
481
nsresult ResolveSymlink(PRBool& wasSymlink);
483
void CreateDirectory(int mode = 0775 /* for unix */);
484
void CreateDir(int mode = 0775) { CreateDirectory(mode); }
485
// workaround for yet another VC++ bug with long identifiers.
486
void Delete(PRBool inRecursive) const;
487
nsresult Truncate(PRInt32 aNewLength) const;
488
void RecursiveCopy(nsFileSpec newDir) const;
490
nsresult Rename(const char* inNewName); // not const: gets updated
491
nsresult CopyToDir(const nsFileSpec& inNewParentDirectory) const;
492
nsresult MoveToDir(const nsFileSpec& inNewParentDirectory);
493
nsresult Execute(const char* args) const;
497
//--------------------------------------------------
499
//--------------------------------------------------
503
// Clear the nsFileSpec contents, resetting it
504
// to the uninitialized state;
507
friend class nsFilePath;
508
friend class nsFileURL;
509
friend class nsDirectoryIterator;
513
nsSimpleCharString mPath;
517
NS_EXPLICIT nsFileSpec(const nsPersistentFileDescriptor& inURL);
519
}; // class nsFileSpec
521
// FOR HISTORICAL REASONS:
523
typedef nsFileSpec nsNativeFileSpec;
525
//========================================================================================
526
class NS_COM_OBSOLETE nsFileURL
527
// This is an escaped string that looks like "file:///foo/bar/mumble%20fish". Since URLs
528
// are the standard way of doing things in mozilla, this allows a string constructor,
529
// which just stashes the string with no conversion.
530
//========================================================================================
533
nsFileURL(const nsFileURL& inURL);
534
NS_EXPLICIT nsFileURL(const char* inURLString, PRBool inCreateDirs = PR_FALSE);
535
NS_EXPLICIT nsFileURL(const nsString& inURLString, PRBool inCreateDirs = PR_FALSE);
536
NS_EXPLICIT nsFileURL(const nsFilePath& inPath);
537
NS_EXPLICIT nsFileURL(const nsFileSpec& inPath);
538
virtual ~nsFileURL();
540
// nsString GetString() const { return mPath; }
541
// may be needed for implementation reasons,
542
// but should not provide a conversion constructor.
544
void operator = (const nsFileURL& inURL);
545
void operator = (const char* inURLString);
546
void operator = (const nsString& inURLString)
548
*this = NS_LossyConvertUCS2toASCII(inURLString).get();
550
void operator = (const nsFilePath& inOther);
551
void operator = (const nsFileSpec& inOther);
553
void operator +=(const char* inRelativeUnixPath);
554
nsFileURL operator +(const char* inRelativeUnixPath) const;
555
operator const char* () const { return (const char*)mURL; } // deprecated.
556
const char* GetURLString() const { return (const char*)mURL; }
557
// Not allocated, so don't free it.
558
const char* GetAsString() const { return (const char*)mURL; }
559
// Not allocated, so don't free it.
562
// Accessor to allow quick assignment to a mFileSpec
563
const nsFileSpec& GetFileSpec() const { return mFileSpec; }
566
//--------------------------------------------------
568
//--------------------------------------------------
571
friend class nsFilePath; // to allow construction of nsFilePath
572
nsSimpleCharString mURL;
575
// Since the path on the macintosh does not uniquely specify a file (volumes
576
// can have the same name), stash the secret nsFileSpec, too.
577
nsFileSpec mFileSpec;
579
}; // class nsFileURL
581
//========================================================================================
582
class NS_COM_OBSOLETE nsFilePath
583
// This is a string that looks like "/foo/bar/mumble fish". Same as nsFileURL, but
584
// without the "file:// prefix", and NOT %20 ENCODED! Strings passed in must be
585
// valid unix-style paths in this format.
586
//========================================================================================
589
nsFilePath(const nsFilePath& inPath);
590
NS_EXPLICIT nsFilePath(const char* inUnixPathString, PRBool inCreateDirs = PR_FALSE);
591
NS_EXPLICIT nsFilePath(const nsString& inUnixPathString, PRBool inCreateDirs = PR_FALSE);
592
NS_EXPLICIT nsFilePath(const nsFileURL& inURL);
593
NS_EXPLICIT nsFilePath(const nsFileSpec& inPath);
594
virtual ~nsFilePath();
597
operator const char* () const { return mPath; }
598
// This will return a UNIX string. If you
599
// need a string that can be passed into
600
// NSPR, take a look at the nsNSPRPath class.
602
void operator = (const nsFilePath& inPath);
603
void operator = (const char* inUnixPathString);
604
void operator = (const nsString& inUnixPathString)
606
*this = NS_LossyConvertUCS2toASCII(inUnixPathString).get();
608
void operator = (const nsFileURL& inURL);
609
void operator = (const nsFileSpec& inOther);
611
void operator +=(const char* inRelativeUnixPath);
612
nsFilePath operator +(const char* inRelativeUnixPath) const;
616
// Accessor to allow quick assignment to a mFileSpec
617
const nsFileSpec& GetFileSpec() const { return mFileSpec; }
620
//--------------------------------------------------
622
//--------------------------------------------------
626
nsSimpleCharString mPath;
628
// Since the path on the macintosh does not uniquely specify a file (volumes
629
// can have the same name), stash the secret nsFileSpec, too.
630
nsFileSpec mFileSpec;
632
}; // class nsFilePath
634
//========================================================================================
635
class nsPersistentFileDescriptor
636
// To save information about a file's location in another file, initialize
637
// one of these from your nsFileSpec, and then write this out to your output stream.
638
// To retrieve the info, create one of these, read its value from an input stream.
639
// and then make an nsFileSpec from it.
640
//========================================================================================
643
nsPersistentFileDescriptor() {}
644
// For use prior to reading in from a stream
645
nsPersistentFileDescriptor(const nsPersistentFileDescriptor& inEncodedData);
646
virtual ~nsPersistentFileDescriptor();
647
void operator = (const nsPersistentFileDescriptor& inEncodedData);
650
NS_EXPLICIT nsPersistentFileDescriptor(const nsFileSpec& inSpec);
651
void operator = (const nsFileSpec& inSpec);
653
// The following four functions are declared here (as friends). Their implementations
654
// are in mozilla/base/src/nsFileSpecStreaming.cpp.
656
friend nsresult Read(nsIInputStream* aStream, nsPersistentFileDescriptor&);
657
friend nsresult Write(nsIOutputStream* aStream, const nsPersistentFileDescriptor&);
658
// writes the data to a file
659
friend NS_COM_OBSOLETE nsInputStream& operator >> (nsInputStream&, nsPersistentFileDescriptor&);
660
// reads the data from a file
661
friend NS_COM_OBSOLETE nsOutputStream& operator << (nsOutputStream&, const nsPersistentFileDescriptor&);
662
// writes the data to a file
663
friend class nsFileSpec;
665
void GetData(nsAFlatCString& outData) const;
666
void SetData(const nsAFlatCString& inData);
667
void SetData(const char* inData, PRInt32 inSize);
669
//--------------------------------------------------
671
//--------------------------------------------------
675
nsSimpleCharString mDescriptorString;
677
}; // class nsPersistentFileDescriptor
679
//========================================================================================
680
class NS_COM_OBSOLETE nsDirectoryIterator
683
// nsFileSpec parentDir(...); // directory over whose children we shall iterate
684
// for (nsDirectoryIterator i(parentDir, PR_FALSE); i.Exists(); i++)
686
// // do something with i.Spec()
691
// for (nsDirectoryIterator i(parentDir, PR_TRUE); i.Exists(); i--)
693
// // do something with i.Spec()
695
// This one passed the PR_TRUE flag which will resolve any symlink encountered.
696
//========================================================================================
699
nsDirectoryIterator( const nsFileSpec& parent,
700
PRBool resoveSymLinks);
702
// Macintosh currently doesn't allocate, so needn't clean up.
703
virtual ~nsDirectoryIterator();
705
PRBool Exists() const { return mExists; }
706
nsDirectoryIterator& operator ++(); // moves to the next item, if any.
707
nsDirectoryIterator& operator ++(int) { return ++(*this); } // post-increment.
708
nsDirectoryIterator& operator --(); // moves to the previous item, if any.
709
nsDirectoryIterator& operator --(int) { return --(*this); } // post-decrement.
710
operator nsFileSpec&() { return mCurrent; }
712
nsFileSpec& Spec() { return mCurrent; }
720
//--------------------------------------------------
722
//--------------------------------------------------
728
PRBool mResoveSymLinks;
730
#if (defined(XP_UNIX) || defined(XP_BEOS) || defined (XP_WIN) || defined(XP_OS2))
731
nsFileSpec mStarting;
739
#elif defined(XP_UNIX) || defined(XP_BEOS)
741
#elif defined(XP_WIN) || defined(XP_OS2)
742
PRDir* mDir; // XXX why not use PRDir for Unix too?
744
}; // class nsDirectoryIterator
746
//========================================================================================
747
class NS_COM_OBSOLETE nsNSPRPath
748
// This class will allow you to pass any one of the nsFile* classes directly into NSPR
749
// without the need to worry about whether you have the right kind of filepath or not.
750
// It will also take care of cleaning up any allocated memory.
751
//========================================================================================
754
NS_EXPLICIT nsNSPRPath(const nsFileSpec& inSpec)
755
: mFilePath(inSpec), modifiedNSPRPath(nsnull) {}
756
NS_EXPLICIT nsNSPRPath(const nsFileURL& inURL)
757
: mFilePath(inURL), modifiedNSPRPath(nsnull) {}
758
NS_EXPLICIT nsNSPRPath(const nsFilePath& inUnixPath)
759
: mFilePath(inUnixPath), modifiedNSPRPath(nsnull) {}
761
virtual ~nsNSPRPath();
763
operator const char*() const;
765
// that NSPR file routines expect on each platform.
766
// Concerning constness, this can modify
767
// modifiedNSPRPath, but it's really just "mutable".
769
//--------------------------------------------------
771
//--------------------------------------------------
775
nsFilePath mFilePath;
776
char* modifiedNSPRPath; // Currently used only on XP_WIN,XP_OS2
777
}; // class nsNSPRPath
780
NS_COM_OBSOLETE nsresult NS_FileSpecToIFile(nsFileSpec* fileSpec, nsILocalFile* *result);
782
#endif // _FILESPEC_H_