From 9ce9c8b2b7448308dc6dacd49b35bcbbde8090b3 Mon Sep 17 00:00:00 2001 From: "dougt%netscape.com" Date: Wed, 18 Aug 1999 02:17:21 +0000 Subject: [PATCH] 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 --- mozilla/xpcom/io/nsFileSpec.h | 5 ++++- mozilla/xpcom/io/nsFileSpecMac.cpp | 30 ++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/mozilla/xpcom/io/nsFileSpec.h b/mozilla/xpcom/io/nsFileSpec.h index 8e30ae92d1c..4da56996d67 100644 --- a/mozilla/xpcom/io/nsFileSpec.h +++ b/mozilla/xpcom/io/nsFileSpec.h @@ -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()); } diff --git a/mozilla/xpcom/io/nsFileSpecMac.cpp b/mozilla/xpcom/io/nsFileSpecMac.cpp index 8d807142bcc..0774c785021 100644 --- a/mozilla/xpcom/io/nsFileSpecMac.cpp +++ b/mozilla/xpcom/io/nsFileSpecMac.cpp @@ -1073,6 +1073,36 @@ OSErr nsFileSpec::GetCatInfo(CInfoPBRec& outInfo) const dipb->ioNamePtr = const_cast(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