Bug 316732 - Allow for hashing on nsIFile by introducing a new nsIHashable interface and implementing it for the file types r=darin
This commit is contained in:
@@ -1750,6 +1750,28 @@ nsLocalFile::GetTarget(nsAString &_retval)
|
||||
{
|
||||
GET_UCS(GetNativeTarget, _retval);
|
||||
}
|
||||
|
||||
// nsIHashable
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLocalFile::Equals(nsIHashable* aOther, PRBool *aResult)
|
||||
{
|
||||
nsCOMPtr<nsIFile> otherFile(do_QueryInterface(aOther));
|
||||
if (!otherFile) {
|
||||
*aResult = PR_FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return Equals(otherFile, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLocalFile::GetHashCode(PRUint32 *aResult)
|
||||
{
|
||||
*aResult = nsCRT::HashCode(mPath.get());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_NewLocalFile(const nsAString &path, PRBool followLinks, nsILocalFile* *result)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user