Adding fix for 6181. It is currently ifdef'ed out. Looking for a mac person to

verify.


git-svn-id: svn://10.0.0.236/trunk@43448 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dougt%netscape.com
1999-08-18 02:17:21 +00:00
parent 148b371427
commit 9ce9c8b2b7
2 changed files with 34 additions and 1 deletions

View File

@@ -360,7 +360,10 @@ class NS_COM nsFileSpec
ConstStr255Param GetLeafPName() const { return mSpec.name; }
OSErr GetCatInfo(CInfoPBRec& outInfo) const;
#if DOUGT_UNTESTED
OSErr SetFileTypeAndCreator(OSType type, OSType creator);
OSErr GetFileTypeAndCreator(OSType* type, OSType* creator);
#endif
#endif // end of Macintosh utility methods.
PRBool Valid() const { return NS_SUCCEEDED(Error()); }

View File

@@ -1073,6 +1073,36 @@ OSErr nsFileSpec::GetCatInfo(CInfoPBRec& outInfo) const
dipb->ioNamePtr = const_cast<nsFileSpec*>(this)->mSpec.name;
return PBGetCatInfoSync(&outInfo);
} // nsFileSpec::GetCatInfo()
#if DOUGT_UNTESTED
//----------------------------------------------------------------------------------------
OSErr nsFileSpec::SetFileTypeAndCreator(OSType type, OSType creator)
//----------------------------------------------------------------------------------------
{
FInfo info;
OSErr err = ::FSpGetFInfo (mSpec, &info);
if (err != noErr)
return err;
info.fdType = type;
info.fdCreator = creator;
err = ::FSpSetFInfo (mSpec, &info);
return err;
}
//----------------------------------------------------------------------------------------
OSErr nsFileSpec::GetFileTypeAndCreator(OSType* type, OSType* creator)
//----------------------------------------------------------------------------------------
{
FInfo info;
OSErr err = ::FSpGetFInfo (mSpec, &info);
if (err != noErr)
return err;
*type = info.fdType;
*creator = info.fdCreator;
return noErr;
}
#endif
//----------------------------------------------------------------------------------------
PRUint32 nsFileSpec::GetDiskSpaceAvailable() const