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:
@@ -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()); }
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user