From 28a72e5ab2f2af2dc183c8cd142f6d86c04da711 Mon Sep 17 00:00:00 2001 From: "mkaply%us.ibm.com" Date: Fri, 18 Nov 2005 18:54:19 +0000 Subject: [PATCH] OS/2 version of 316732 --- xpcom/io/nsLocalFileOS2.cpp | 21 +++++++++++++++++++++ xpcom/io/nsLocalFileOS2.h | 7 ++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/xpcom/io/nsLocalFileOS2.cpp b/xpcom/io/nsLocalFileOS2.cpp index ac79cf53b90..8b8072bde07 100644 --- a/xpcom/io/nsLocalFileOS2.cpp +++ b/xpcom/io/nsLocalFileOS2.cpp @@ -2345,6 +2345,27 @@ nsLocalFile::GetTarget(nsAString &_retval) return rv; } +// nsIHashable + +NS_IMETHODIMP +nsLocalFile::Equals(nsIHashable* aOther, PRBool *aResult) +{ + nsCOMPtr 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(mWorkingPath.get()); + return NS_OK; +} + nsresult NS_NewLocalFile(const nsAString &path, PRBool followLinks, nsILocalFile* *result) { diff --git a/xpcom/io/nsLocalFileOS2.h b/xpcom/io/nsLocalFileOS2.h index 7b9bcd5b057..2649ec95016 100644 --- a/xpcom/io/nsLocalFileOS2.h +++ b/xpcom/io/nsLocalFileOS2.h @@ -55,6 +55,7 @@ #include "nsIFile.h" #include "nsIFactory.h" #include "nsILocalFileOS2.h" +#include "nsIHashable.h" #define INCL_DOSFILEMGR #define INCL_DOSERRORS @@ -70,7 +71,8 @@ class TypeEaEnumerator; -class NS_COM nsLocalFile : public nsILocalFileOS2 +class NS_COM nsLocalFile : public nsILocalFileOS2, + public nsIHashable { public: NS_DEFINE_STATIC_CID_ACCESSOR(NS_LOCAL_FILE_CID) @@ -91,6 +93,9 @@ public: // nsILocalFileOS2 interface NS_DECL_NSILOCALFILEOS2 + // nsIHashable interface + NS_DECL_NSIHASHABLE + public: static void GlobalInit(); static void GlobalShutdown();