From f54a574f0383e43a29037b69bdaf27362bcee578 Mon Sep 17 00:00:00 2001 From: "mccabe%netscape.com" Date: Sun, 22 Aug 1999 11:25:50 +0000 Subject: [PATCH] Replace manual method declarations in implementations of xpcom/ interfaces with NS_DECL_NSIFOO. git-svn-id: svn://10.0.0.236/trunk@44056 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/src/nsRangeList.cpp | 12 +- .../mailnews/addrbook/src/nsAddrDatabase.cpp | 5 +- .../base/src/nsMessageViewDataSource.h | 40 +---- mozilla/mailnews/base/util/nsMsgUtils.h | 5 +- mozilla/mailnews/compose/src/nsMsgSendLater.h | 5 +- .../mailnews/db/msgdb/src/nsMsgDatabase.cpp | 10 +- mozilla/mailnews/db/msgdb/src/nsMsgThread.cpp | 5 +- mozilla/mailnews/mime/src/plugin_inst.h | 2 +- mozilla/modules/libreg/xpcom/nsRegistry.cpp | 5 +- mozilla/modules/plugin/bad/badapter.cpp | 32 +--- .../plugin/samples/backward/badapter.cpp | 32 +--- mozilla/modules/plugin/src/npglue.h | 1 + .../modules/plugin/src/nsPluginInputStream.h | 32 +--- .../plugin/src/nsPluginManagerStream.h | 4 +- .../protocol/http/src/nsHTTPEncodeStream.h | 5 +- .../embed/gtk/lib/GtkMozillaInputStream.h | 6 +- mozilla/widget/src/xpwidgets/nsBaseWidget.h | 8 +- mozilla/xpcom/base/nsWeakReference.h | 5 +- mozilla/xpcom/components/mozRegistry.cpp | 5 +- mozilla/xpcom/components/nsRegistry.cpp | 5 +- mozilla/xpcom/ds/nsConjoiningEnumerator.cpp | 18 +-- mozilla/xpcom/ds/nsHashtableEnumerator.cpp | 9 +- mozilla/xpcom/ds/nsSupportsArrayEnumerator.h | 8 +- mozilla/xpcom/ds/nsSupportsPrimitives.h | 80 ++-------- mozilla/xpcom/glue/nsWeakReference.h | 5 +- mozilla/xpcom/io/nsByteBufferInputStream.h | 13 +- mozilla/xpcom/io/nsFileSpecImpl.h | 142 +----------------- mozilla/xpcom/io/nsIBaseStream.idl | 1 + mozilla/xpcom/io/nsPipe.cpp | 22 +-- 29 files changed, 72 insertions(+), 450 deletions(-) diff --git a/mozilla/layout/base/src/nsRangeList.cpp b/mozilla/layout/base/src/nsRangeList.cpp index e7aa8e741f6..497d5a9423d 100644 --- a/mozilla/layout/base/src/nsRangeList.cpp +++ b/mozilla/layout/base/src/nsRangeList.cpp @@ -261,17 +261,9 @@ see the nsIEnumerator for more details*/ NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr); - NS_IMETHOD First(); + NS_DECL_NSIENUMERATOR - NS_IMETHOD Last(); - - NS_IMETHOD Next(); - - NS_IMETHOD Prev(); - - NS_IMETHOD CurrentItem(nsISupports **aRange); - - NS_IMETHOD IsDone(); + NS_DECL_NSIBIDIRECTIONALENUMERATOR /*END nsIEnumerator interfaces*/ /*BEGIN Helper Methods*/ diff --git a/mozilla/mailnews/addrbook/src/nsAddrDatabase.cpp b/mozilla/mailnews/addrbook/src/nsAddrDatabase.cpp index 2647c723de2..4b19dc051cf 100644 --- a/mozilla/mailnews/addrbook/src/nsAddrDatabase.cpp +++ b/mozilla/mailnews/addrbook/src/nsAddrDatabase.cpp @@ -2112,10 +2112,7 @@ public: NS_DECL_ISUPPORTS // nsIEnumerator methods: - NS_IMETHOD First(void); - NS_IMETHOD Next(void); - NS_IMETHOD CurrentItem(nsISupports **aItem); - NS_IMETHOD IsDone(void); + NS_DECL_NSIENUMERATOR // nsAddrDBEnumerator methods: diff --git a/mozilla/mailnews/base/src/nsMessageViewDataSource.h b/mozilla/mailnews/base/src/nsMessageViewDataSource.h index 3a7fb215b0a..ab28116cde2 100644 --- a/mozilla/mailnews/base/src/nsMessageViewDataSource.h +++ b/mozilla/mailnews/base/src/nsMessageViewDataSource.h @@ -201,25 +201,7 @@ public: nsMessageViewMessageEnumerator(nsIEnumerator *srcEnumerator, PRUint32 showStatus); virtual ~nsMessageViewMessageEnumerator(); - //nsIEnumerator interface - /** First will reset the list. will return NS_FAILED if no items - */ - NS_IMETHOD First(void); - - /** Next will advance the list. will return failed if already at end - */ - NS_IMETHOD Next(void); - - /** CurrentItem will return the CurrentItem item it will fail if the list is empty - * @param aItem return value - */ - NS_IMETHOD CurrentItem(nsISupports **aItem); - - /** return if the collection is at the end. that is the beginning following a call to Prev - * and it is the end of the list following a call to next - * @param aItem return value - */ - NS_IMETHOD IsDone(void); + NS_DECL_NSIENUMERATOR protected: nsresult SetAtNextItem(); @@ -242,25 +224,7 @@ public: nsMessageViewThreadEnumerator(nsIEnumerator *srcEnumerator, nsIMsgFolder *srcFolder); virtual ~nsMessageViewThreadEnumerator(); - //nsIEnumerator interface - /** First will reset the list. will return NS_FAILED if no items - */ - NS_IMETHOD First(void); - - /** Next will advance the list. will return failed if already at end - */ - NS_IMETHOD Next(void); - - /** CurrentItem will return the CurrentItem item it will fail if the list is empty - * @param aItem return value - */ - NS_IMETHOD CurrentItem(nsISupports **aItem); - - /** return if the collection is at the end. that is the beginning following a call to Prev - * and it is the end of the list following a call to next - * @param aItem return value - */ - NS_IMETHOD IsDone(void); + NS_DECL_NSIENUMERATOR protected: nsresult GetMessagesForCurrentThread(); diff --git a/mozilla/mailnews/base/util/nsMsgUtils.h b/mozilla/mailnews/base/util/nsMsgUtils.h index 7aa210d3878..510a78eea3a 100644 --- a/mozilla/mailnews/base/util/nsMsgUtils.h +++ b/mozilla/mailnews/base/util/nsMsgUtils.h @@ -48,10 +48,7 @@ public: nsMessageFromMsgHdrEnumerator(){} //Default constructor that does nothing so nsComPtr will work. virtual ~nsMessageFromMsgHdrEnumerator(); - NS_IMETHOD First(void); - NS_IMETHOD Next(void); - NS_IMETHOD CurrentItem(nsISupports **aItem); - NS_IMETHOD IsDone(void); + NS_DECL_NSIENUMERATOR }; NS_MSG_BASE nsresult NS_NewMessageFromMsgHdrEnumerator(nsIEnumerator *srcEnumerator, diff --git a/mozilla/mailnews/compose/src/nsMsgSendLater.h b/mozilla/mailnews/compose/src/nsMsgSendLater.h index 00e700eda0d..6de9de6bcb1 100644 --- a/mozilla/mailnews/compose/src/nsMsgSendLater.h +++ b/mozilla/mailnews/compose/src/nsMsgSendLater.h @@ -74,11 +74,10 @@ public: NS_DECL_ISUPPORTS // nsIBaseStream interface - NS_IMETHOD Close(void); + NS_DECL_NSIBASESTREAM // nsIOutputStream interface - NS_IMETHOD Write(const char* aBuf, PRUint32 aCount, PRUint32 *aWriteCount); - NS_IMETHOD Flush(void); + NS_DECL_NSIOUTPUTSTREAM // nsIMsgSendLater support NS_IMETHOD SendUnsentMessages(nsIMsgIdentity *identity, diff --git a/mozilla/mailnews/db/msgdb/src/nsMsgDatabase.cpp b/mozilla/mailnews/db/msgdb/src/nsMsgDatabase.cpp index 872827be7de..bd87499786d 100644 --- a/mozilla/mailnews/db/msgdb/src/nsMsgDatabase.cpp +++ b/mozilla/mailnews/db/msgdb/src/nsMsgDatabase.cpp @@ -1573,10 +1573,7 @@ public: NS_DECL_ISUPPORTS // nsIEnumerator methods: - NS_IMETHOD First(void); - NS_IMETHOD Next(void); - NS_IMETHOD CurrentItem(nsISupports **aItem); - NS_IMETHOD IsDone(void); + NS_DECL_NSIENUMERATOR // nsMsgDBEnumerator methods: typedef nsresult (*nsMsgDBEnumeratorFilter)(nsIMsgDBHdr* hdr, void* closure); @@ -1750,10 +1747,7 @@ public: NS_DECL_ISUPPORTS // nsIEnumerator methods: - NS_IMETHOD First(void); - NS_IMETHOD Next(void); - NS_IMETHOD CurrentItem(nsISupports **aItem); - NS_IMETHOD IsDone(void); + NS_DECL_NSIENUMERATOR // nsMsgDBEnumerator methods: typedef nsresult (*nsMsgDBThreadEnumeratorFilter)(nsIMsgThread* hdr, void* closure); diff --git a/mozilla/mailnews/db/msgdb/src/nsMsgThread.cpp b/mozilla/mailnews/db/msgdb/src/nsMsgThread.cpp index 7908498cb6d..52eaba237e1 100644 --- a/mozilla/mailnews/db/msgdb/src/nsMsgThread.cpp +++ b/mozilla/mailnews/db/msgdb/src/nsMsgThread.cpp @@ -492,10 +492,7 @@ public: NS_DECL_ISUPPORTS // nsIEnumerator methods: - NS_IMETHOD First(void); - NS_IMETHOD Next(void); - NS_IMETHOD CurrentItem(nsISupports **aItem); - NS_IMETHOD IsDone(void); + NS_DECL_NSIENUMERATOR // nsMsgThreadEnumerator methods: typedef nsresult (*nsMsgThreadEnumeratorFilter)(nsIMsgDBHdr* hdr, void* closure); diff --git a/mozilla/mailnews/mime/src/plugin_inst.h b/mozilla/mailnews/mime/src/plugin_inst.h index 71f7e3b6f40..d5cfd85100b 100644 --- a/mozilla/mailnews/mime/src/plugin_inst.h +++ b/mozilla/mailnews/mime/src/plugin_inst.h @@ -62,7 +62,7 @@ public: // nsIBaseStream interface - NS_IMETHOD Close(void); + NS_DECL_NSIBASESTREAM //////////////////////////////////////////////////////////////////////////// // MimePluginInstance specific methods: diff --git a/mozilla/modules/libreg/xpcom/nsRegistry.cpp b/mozilla/modules/libreg/xpcom/nsRegistry.cpp index f0183ebd62c..5a90745f3cf 100644 --- a/mozilla/modules/libreg/xpcom/nsRegistry.cpp +++ b/mozilla/modules/libreg/xpcom/nsRegistry.cpp @@ -123,10 +123,7 @@ struct nsRegSubtreeEnumerator : public nsIEnumerator { NS_DECL_ISUPPORTS // This class implements the nsIEnumerator interface functions. - NS_IMETHOD First(); - NS_IMETHOD Next(); - NS_IMETHOD CurrentItem(nsISupports **aItem); - NS_IMETHOD IsDone(); + NS_DECL_NSIENUMERATOR // ctor/dtor nsRegSubtreeEnumerator( HREG hReg, RKEY rKey, PRBool all ); diff --git a/mozilla/modules/plugin/bad/badapter.cpp b/mozilla/modules/plugin/bad/badapter.cpp index 7e02accb58b..d6a43f03412 100644 --- a/mozilla/modules/plugin/bad/badapter.cpp +++ b/mozilla/modules/plugin/bad/badapter.cpp @@ -396,36 +396,8 @@ public: NS_DECL_ISUPPORTS - //////////////////////////////////////////////////////////////////////////// - // from nsIBaseStream: - - /** Close the stream. */ - NS_IMETHOD - Close(void); - - //////////////////////////////////////////////////////////////////////////// - // from nsIInputStream: - - /** Return the number of bytes in the stream - * @param aLength out parameter to hold the length - * of the stream. if an error occurs, the length - * will be undefined - * @return error status - */ - NS_IMETHOD - GetLength(PRUint32 *aLength); - - /** Read data from the stream. - * @param aErrorCode the error code if an error occurs - * @param aBuf the buffer into which the data is read - * @param aCount the maximum number of bytes to read - * @param aReadCount out parameter to hold the number of - * bytes read, eof if 0. if an error occurs, the - * read count will be undefined - * @return error status - */ - NS_IMETHOD - Read(char* aBuf, PRUint32 aCount, PRUint32 *aReadCount); + NS_DECL_NSIBASESTREAM + NS_DECL_NSIINPUTSTREAM //////////////////////////////////////////////////////////////////////////// // from nsIPluginInputStream: diff --git a/mozilla/modules/plugin/samples/backward/badapter.cpp b/mozilla/modules/plugin/samples/backward/badapter.cpp index 7e02accb58b..d6a43f03412 100644 --- a/mozilla/modules/plugin/samples/backward/badapter.cpp +++ b/mozilla/modules/plugin/samples/backward/badapter.cpp @@ -396,36 +396,8 @@ public: NS_DECL_ISUPPORTS - //////////////////////////////////////////////////////////////////////////// - // from nsIBaseStream: - - /** Close the stream. */ - NS_IMETHOD - Close(void); - - //////////////////////////////////////////////////////////////////////////// - // from nsIInputStream: - - /** Return the number of bytes in the stream - * @param aLength out parameter to hold the length - * of the stream. if an error occurs, the length - * will be undefined - * @return error status - */ - NS_IMETHOD - GetLength(PRUint32 *aLength); - - /** Read data from the stream. - * @param aErrorCode the error code if an error occurs - * @param aBuf the buffer into which the data is read - * @param aCount the maximum number of bytes to read - * @param aReadCount out parameter to hold the number of - * bytes read, eof if 0. if an error occurs, the - * read count will be undefined - * @return error status - */ - NS_IMETHOD - Read(char* aBuf, PRUint32 aCount, PRUint32 *aReadCount); + NS_DECL_NSIBASESTREAM + NS_DECL_NSIINPUTSTREAM //////////////////////////////////////////////////////////////////////////// // from nsIPluginInputStream: diff --git a/mozilla/modules/plugin/src/npglue.h b/mozilla/modules/plugin/src/npglue.h index 49ad83303eb..5fb396589fc 100644 --- a/mozilla/modules/plugin/src/npglue.h +++ b/mozilla/modules/plugin/src/npglue.h @@ -660,6 +660,7 @@ public: //////////////////////////////////////////////////////////////////////////// // from nsIBaseStream: + NS_DECL_NSIBASESTREAM NS_IMETHOD Close(void); diff --git a/mozilla/modules/plugin/src/nsPluginInputStream.h b/mozilla/modules/plugin/src/nsPluginInputStream.h index 64b96a1b4c1..090102ff48d 100644 --- a/mozilla/modules/plugin/src/nsPluginInputStream.h +++ b/mozilla/modules/plugin/src/nsPluginInputStream.h @@ -41,37 +41,9 @@ public: NS_DECL_ISUPPORTS - //////////////////////////////////////////////////////////////////////////// - // from nsIBaseStream: + NS_DECL_NSIBASESTREAM - /** Close the stream. */ - NS_IMETHOD - Close(void); - - //////////////////////////////////////////////////////////////////////////// - // from nsIInputStream: - - /** Return the number of bytes in the stream - * @param aLength out parameter to hold the length - * of the stream. if an error occurs, the length - * will be undefined - * @return error status - */ - NS_IMETHOD - GetLength(PRInt32 *aLength); - - /** Read data from the stream. - * @param aErrorCode the error code if an error occurs - * @param aBuf the buffer into which the data is read - * @param aOffset the start offset of the data - * @param aCount the maximum number of bytes to read - * @param aReadCount out parameter to hold the number of - * bytes read, eof if 0. if an error occurs, the - * read count will be undefined - * @return error status - */ - NS_IMETHOD - Read(char* aBuf, PRInt32 aOffset, PRInt32 aCount, PRInt32 *aReadCount); + NS_DECL_NSIINPUTSTREAM //////////////////////////////////////////////////////////////////////////// // from nsIPluginInputStream: diff --git a/mozilla/modules/plugin/src/nsPluginManagerStream.h b/mozilla/modules/plugin/src/nsPluginManagerStream.h index 0f8f9e1a820..826e9296475 100644 --- a/mozilla/modules/plugin/src/nsPluginManagerStream.h +++ b/mozilla/modules/plugin/src/nsPluginManagerStream.h @@ -27,9 +27,7 @@ public: //////////////////////////////////////////////////////////////////////////// // from nsIBaseStream: - - NS_IMETHOD - Close(void); + NS_DECL_NSIBASESTREAM //////////////////////////////////////////////////////////////////////////// // from nsIOutputStream: diff --git a/mozilla/netwerk/protocol/http/src/nsHTTPEncodeStream.h b/mozilla/netwerk/protocol/http/src/nsHTTPEncodeStream.h index e3ac4e2fdf4..2ca165427fb 100644 --- a/mozilla/netwerk/protocol/http/src/nsHTTPEncodeStream.h +++ b/mozilla/netwerk/protocol/http/src/nsHTTPEncodeStream.h @@ -29,11 +29,10 @@ public: NS_DECL_ISUPPORTS // nsIBaseStream methods: - NS_IMETHOD Close(void); + NS_DECL_NSIBASESTREAM // nsIInputStream methods: - NS_IMETHOD GetLength(PRUint32 *result); - NS_IMETHOD Read(char * buf, PRUint32 count, PRUint32 *result); + NS_DECL_NSIINPUTSTREAM // nsHTTPEncodeStream methods: nsHTTPEncodeStream(); diff --git a/mozilla/webshell/embed/gtk/lib/GtkMozillaInputStream.h b/mozilla/webshell/embed/gtk/lib/GtkMozillaInputStream.h index 2584fc7874b..0bb0305684f 100644 --- a/mozilla/webshell/embed/gtk/lib/GtkMozillaInputStream.h +++ b/mozilla/webshell/embed/gtk/lib/GtkMozillaInputStream.h @@ -28,12 +28,10 @@ public: NS_DECL_ISUPPORTS // nsIInputStream interface - NS_IMETHOD GetLength(PRUint32 *aLength); - - NS_IMETHOD Read(char* aBuf, PRUint32 aCount, PRUint32 *aReadCount); + NS_DECL_NSIINPUTSTREAM // nsIBaseStream interface - NS_IMETHOD Close(void); + NS_DECL_NSIBASESTREAM // Specific interface NS_IMETHOD Fill(const char *buffer, PRUint32 aCount); diff --git a/mozilla/widget/src/xpwidgets/nsBaseWidget.h b/mozilla/widget/src/xpwidgets/nsBaseWidget.h index f8384b87c00..61c635f3293 100644 --- a/mozilla/widget/src/xpwidgets/nsBaseWidget.h +++ b/mozilla/widget/src/xpwidgets/nsBaseWidget.h @@ -141,12 +141,8 @@ protected: Enumerator(nsBaseWidget & inParent); virtual ~Enumerator(); - NS_IMETHOD First(); - NS_IMETHOD Last(); - NS_IMETHOD Next(); - NS_IMETHOD Prev(); - NS_IMETHOD CurrentItem(nsISupports **aItem); - NS_IMETHOD IsDone(); + NS_DECL_NSIENUMERATOR + NS_DECL_NSIBIDIRECTIONALENUMERATOR private: PRUint32 mCurrentPosition; diff --git a/mozilla/xpcom/base/nsWeakReference.h b/mozilla/xpcom/base/nsWeakReference.h index 9e2265e47dc..1664b84dcad 100644 --- a/mozilla/xpcom/base/nsWeakReference.h +++ b/mozilla/xpcom/base/nsWeakReference.h @@ -38,7 +38,7 @@ class NS_COM nsSupportsWeakReference : public nsISupportsWeakReference inline virtual ~nsSupportsWeakReference(); - NS_IMETHOD GetWeakReference( nsIWeakReference** ); + NS_DECL_NSISUPPORTSWEAKREFERENCE private: friend class nsWeakReference; @@ -62,8 +62,7 @@ class NS_COM nsWeakReference : public nsIWeakReference NS_IMETHOD QueryInterface( const nsIID&, void** ); // nsIWeakReference... - NS_IMETHOD QueryReferent( const nsIID&, void** ); - + NS_DECL_NSIWEAKREFERENCE private: friend class nsSupportsWeakReference; diff --git a/mozilla/xpcom/components/mozRegistry.cpp b/mozilla/xpcom/components/mozRegistry.cpp index dae56e6c7d9..bc3929018a9 100644 --- a/mozilla/xpcom/components/mozRegistry.cpp +++ b/mozilla/xpcom/components/mozRegistry.cpp @@ -100,10 +100,7 @@ struct mozRegSubtreeEnumerator : public nsIEnumerator { NS_DECL_ISUPPORTS // This class implements the nsIEnumerator interface functions. - NS_IMETHOD First(); - NS_IMETHOD Next(); - NS_IMETHOD CurrentItem(nsISupports **aItem); - NS_IMETHOD IsDone(); + NS_DECL_NSIENUMERATOR // ctor/dtor mozRegSubtreeEnumerator( HREG hReg, RKEY rKey, PRBool all ); diff --git a/mozilla/xpcom/components/nsRegistry.cpp b/mozilla/xpcom/components/nsRegistry.cpp index f0183ebd62c..5a90745f3cf 100644 --- a/mozilla/xpcom/components/nsRegistry.cpp +++ b/mozilla/xpcom/components/nsRegistry.cpp @@ -123,10 +123,7 @@ struct nsRegSubtreeEnumerator : public nsIEnumerator { NS_DECL_ISUPPORTS // This class implements the nsIEnumerator interface functions. - NS_IMETHOD First(); - NS_IMETHOD Next(); - NS_IMETHOD CurrentItem(nsISupports **aItem); - NS_IMETHOD IsDone(); + NS_DECL_NSIENUMERATOR // ctor/dtor nsRegSubtreeEnumerator( HREG hReg, RKEY rKey, PRBool all ); diff --git a/mozilla/xpcom/ds/nsConjoiningEnumerator.cpp b/mozilla/xpcom/ds/nsConjoiningEnumerator.cpp index 1f64c0084d7..b7d9a2f326f 100644 --- a/mozilla/xpcom/ds/nsConjoiningEnumerator.cpp +++ b/mozilla/xpcom/ds/nsConjoiningEnumerator.cpp @@ -28,14 +28,10 @@ public: NS_DECL_ISUPPORTS // nsIEnumerator methods: - NS_IMETHOD First(void); - NS_IMETHOD Next(void); - NS_IMETHOD CurrentItem(nsISupports **aItem); - NS_IMETHOD IsDone(void); + NS_DECL_NSIENUMERATOR // nsIBidirectionalEnumerator methods: - NS_IMETHOD Last(void); - NS_IMETHOD Prev(void); + NS_DECL_NSIBIDIRECTIONALENUMERATOR // nsConjoiningEnumerator methods: nsConjoiningEnumerator(nsIEnumerator* first, nsIEnumerator* second); @@ -190,10 +186,7 @@ public: NS_DECL_ISUPPORTS // nsIEnumerator methods: - NS_IMETHOD First(void); - NS_IMETHOD Next(void); - NS_IMETHOD CurrentItem(nsISupports **aItem); - NS_IMETHOD IsDone(void); + NS_DECL_NSIENUMERATOR // nsIntersectionEnumerator methods: nsIntersectionEnumerator(nsIEnumerator* first, nsIEnumerator* second); @@ -290,10 +283,7 @@ public: NS_DECL_ISUPPORTS // nsIEnumerator methods: - NS_IMETHOD First(void); - NS_IMETHOD Next(void); - NS_IMETHOD CurrentItem(nsISupports **aItem); - NS_IMETHOD IsDone(void); + NS_DECL_NSIENUMERATOR // nsUnionEnumerator methods: nsUnionEnumerator(nsIEnumerator* first, nsIEnumerator* second); diff --git a/mozilla/xpcom/ds/nsHashtableEnumerator.cpp b/mozilla/xpcom/ds/nsHashtableEnumerator.cpp index fc01f7ae812..e1050892302 100644 --- a/mozilla/xpcom/ds/nsHashtableEnumerator.cpp +++ b/mozilla/xpcom/ds/nsHashtableEnumerator.cpp @@ -29,13 +29,8 @@ class nsHashtableEnumerator : public nsIBidirectionalEnumerator { public: NS_DECL_ISUPPORTS - - NS_IMETHOD First (); - NS_IMETHOD Last (); - NS_IMETHOD Prev (); - NS_IMETHOD Next (); - NS_IMETHOD CurrentItem (nsISupports **retval); - NS_IMETHOD IsDone (); + NS_DECL_NSIENUMERATOR + NS_DECL_NSIBIDIRECTIONALENUMERATOR public: virtual ~nsHashtableEnumerator (); diff --git a/mozilla/xpcom/ds/nsSupportsArrayEnumerator.h b/mozilla/xpcom/ds/nsSupportsArrayEnumerator.h index 86c52dde46e..91009f54203 100644 --- a/mozilla/xpcom/ds/nsSupportsArrayEnumerator.h +++ b/mozilla/xpcom/ds/nsSupportsArrayEnumerator.h @@ -31,14 +31,10 @@ public: virtual ~nsSupportsArrayEnumerator(); // nsIEnumerator methods: - NS_IMETHOD First(); - NS_IMETHOD Next(); - NS_IMETHOD CurrentItem(nsISupports **aItem); - NS_IMETHOD IsDone(); + NS_DECL_NSIENUMERATOR // nsIBidirectionalEnumerator methods: - NS_IMETHOD Last(); - NS_IMETHOD Prev(); + NS_DECL_NSIBIDIRECTIONALENUMERATOR protected: nsISupportsArray* mArray; diff --git a/mozilla/xpcom/ds/nsSupportsPrimitives.h b/mozilla/xpcom/ds/nsSupportsPrimitives.h index 61362168172..5fc785fb3be 100644 --- a/mozilla/xpcom/ds/nsSupportsPrimitives.h +++ b/mozilla/xpcom/ds/nsSupportsPrimitives.h @@ -25,10 +25,7 @@ class nsSupportsIDImpl : public nsISupportsID { public: NS_DECL_ISUPPORTS - - NS_IMETHOD GetData(nsID **aData); - NS_IMETHOD SetData(nsID *aData); - NS_IMETHOD toString(char **_retval); + NS_DECL_NSISUPPORTSID nsSupportsIDImpl(); virtual ~nsSupportsIDImpl(); @@ -43,10 +40,7 @@ class nsSupportsStringImpl : public nsISupportsString { public: NS_DECL_ISUPPORTS - - NS_IMETHOD GetData(char **aData); - NS_IMETHOD SetData(char *aData); - NS_IMETHOD toString(char **_retval); + NS_DECL_NSISUPPORTSSTRING nsSupportsStringImpl(); virtual ~nsSupportsStringImpl(); @@ -61,10 +55,7 @@ class nsSupportsWStringImpl : public nsISupportsWString { public: NS_DECL_ISUPPORTS - - NS_IMETHOD GetData(PRUnichar **aData); - NS_IMETHOD SetData(PRUnichar *aData); - NS_IMETHOD toString(PRUnichar **_retval); + NS_DECL_NSISUPPORTSWSTRING nsSupportsWStringImpl(); virtual ~nsSupportsWStringImpl(); @@ -79,10 +70,7 @@ class nsSupportsPRBoolImpl : public nsISupportsPRBool { public: NS_DECL_ISUPPORTS - - NS_IMETHOD GetData(PRBool *aData); - NS_IMETHOD SetData(PRBool aData); - NS_IMETHOD toString(char **_retval); + NS_DECL_NSISUPPORTSPRBOOL nsSupportsPRBoolImpl(); virtual ~nsSupportsPRBoolImpl(); @@ -97,10 +85,7 @@ class nsSupportsPRUint8Impl : public nsISupportsPRUint8 { public: NS_DECL_ISUPPORTS - - NS_IMETHOD GetData(PRUint8 *aData); - NS_IMETHOD SetData(PRUint8 aData); - NS_IMETHOD toString(char **_retval); + NS_DECL_NSISUPPORTSPRUINT8 nsSupportsPRUint8Impl(); virtual ~nsSupportsPRUint8Impl(); @@ -115,10 +100,7 @@ class nsSupportsPRUint16Impl : public nsISupportsPRUint16 { public: NS_DECL_ISUPPORTS - - NS_IMETHOD GetData(PRUint16 *aData); - NS_IMETHOD SetData(PRUint16 aData); - NS_IMETHOD toString(char **_retval); + NS_DECL_NSISUPPORTSPRUINT16 nsSupportsPRUint16Impl(); virtual ~nsSupportsPRUint16Impl(); @@ -133,10 +115,7 @@ class nsSupportsPRUint32Impl : public nsISupportsPRUint32 { public: NS_DECL_ISUPPORTS - - NS_IMETHOD GetData(PRUint32 *aData); - NS_IMETHOD SetData(PRUint32 aData); - NS_IMETHOD toString(char **_retval); + NS_DECL_NSISUPPORTSPRUINT32 nsSupportsPRUint32Impl(); virtual ~nsSupportsPRUint32Impl(); @@ -151,10 +130,7 @@ class nsSupportsPRUint64Impl : public nsISupportsPRUint64 { public: NS_DECL_ISUPPORTS - - NS_IMETHOD GetData(PRUint64 *aData); - NS_IMETHOD SetData(PRUint64 aData); - NS_IMETHOD toString(char **_retval); + NS_DECL_NSISUPPORTSPRUINT64 nsSupportsPRUint64Impl(); virtual ~nsSupportsPRUint64Impl(); @@ -169,10 +145,7 @@ class nsSupportsPRTimeImpl : public nsISupportsPRTime { public: NS_DECL_ISUPPORTS - - NS_IMETHOD GetData(PRTime *aData); - NS_IMETHOD SetData(PRTime aData); - NS_IMETHOD toString(char **_retval); + NS_DECL_NSISUPPORTSPRTIME nsSupportsPRTimeImpl(); virtual ~nsSupportsPRTimeImpl(); @@ -187,10 +160,7 @@ class nsSupportsCharImpl : public nsISupportsChar { public: NS_DECL_ISUPPORTS - - NS_IMETHOD GetData(char *aData); - NS_IMETHOD SetData(char aData); - NS_IMETHOD toString(char **_retval); + NS_DECL_NSISUPPORTSCHAR nsSupportsCharImpl(); virtual ~nsSupportsCharImpl(); @@ -205,10 +175,7 @@ class nsSupportsPRInt16Impl : public nsISupportsPRInt16 { public: NS_DECL_ISUPPORTS - - NS_IMETHOD GetData(PRInt16 *aData); - NS_IMETHOD SetData(PRInt16 aData); - NS_IMETHOD toString(char **_retval); + NS_DECL_NSISUPPORTSPRINT16 nsSupportsPRInt16Impl(); virtual ~nsSupportsPRInt16Impl(); @@ -223,10 +190,7 @@ class nsSupportsPRInt32Impl : public nsISupportsPRInt32 { public: NS_DECL_ISUPPORTS - - NS_IMETHOD GetData(PRInt32 *aData); - NS_IMETHOD SetData(PRInt32 aData); - NS_IMETHOD toString(char **_retval); + NS_DECL_NSISUPPORTSPRINT32 nsSupportsPRInt32Impl(); virtual ~nsSupportsPRInt32Impl(); @@ -241,10 +205,7 @@ class nsSupportsPRInt64Impl : public nsISupportsPRInt64 { public: NS_DECL_ISUPPORTS - - NS_IMETHOD GetData(PRInt64 *aData); - NS_IMETHOD SetData(PRInt64 aData); - NS_IMETHOD toString(char **_retval); + NS_DECL_NSISUPPORTSPRINT64 nsSupportsPRInt64Impl(); virtual ~nsSupportsPRInt64Impl(); @@ -259,10 +220,7 @@ class nsSupportsFloatImpl : public nsISupportsFloat { public: NS_DECL_ISUPPORTS - - NS_IMETHOD GetData(float *aData); - NS_IMETHOD SetData(float aData); - NS_IMETHOD toString(char **_retval); + NS_DECL_NSISUPPORTSFLOAT nsSupportsFloatImpl(); virtual ~nsSupportsFloatImpl(); @@ -277,10 +235,7 @@ class nsSupportsDoubleImpl : public nsISupportsDouble { public: NS_DECL_ISUPPORTS - - NS_IMETHOD GetData(double *aData); - NS_IMETHOD SetData(double aData); - NS_IMETHOD toString(char **_retval); + NS_DECL_NSISUPPORTSDOUBLE nsSupportsDoubleImpl(); virtual ~nsSupportsDoubleImpl(); @@ -295,10 +250,7 @@ class nsSupportsVoidImpl : public nsISupportsVoid { public: NS_DECL_ISUPPORTS - - NS_IMETHOD GetData(const void * *aData); - NS_IMETHOD SetData(void * aData); - NS_IMETHOD toString(char **_retval); + NS_DECL_NSISUPPORTSVOID nsSupportsVoidImpl(); virtual ~nsSupportsVoidImpl(); diff --git a/mozilla/xpcom/glue/nsWeakReference.h b/mozilla/xpcom/glue/nsWeakReference.h index 9e2265e47dc..1664b84dcad 100644 --- a/mozilla/xpcom/glue/nsWeakReference.h +++ b/mozilla/xpcom/glue/nsWeakReference.h @@ -38,7 +38,7 @@ class NS_COM nsSupportsWeakReference : public nsISupportsWeakReference inline virtual ~nsSupportsWeakReference(); - NS_IMETHOD GetWeakReference( nsIWeakReference** ); + NS_DECL_NSISUPPORTSWEAKREFERENCE private: friend class nsWeakReference; @@ -62,8 +62,7 @@ class NS_COM nsWeakReference : public nsIWeakReference NS_IMETHOD QueryInterface( const nsIID&, void** ); // nsIWeakReference... - NS_IMETHOD QueryReferent( const nsIID&, void** ); - + NS_DECL_NSIWEAKREFERENCE private: friend class nsSupportsWeakReference; diff --git a/mozilla/xpcom/io/nsByteBufferInputStream.h b/mozilla/xpcom/io/nsByteBufferInputStream.h index a0a2982bcd8..51cb0e4436e 100644 --- a/mozilla/xpcom/io/nsByteBufferInputStream.h +++ b/mozilla/xpcom/io/nsByteBufferInputStream.h @@ -32,14 +32,14 @@ public: NS_DECL_ISUPPORTS // nsIBaseStream methods: - NS_IMETHOD Close(void); + NS_DECL_NSIBASESTREAM // nsIOutputStream methods: - NS_IMETHOD Write(const char* aBuf, PRUint32 aCount, - PRUint32 *aWriteCount); + NS_DECL_NSIOUTPUTSTREAM + + // This method isn't in nsIOutputStream... NS_IMETHOD WriteFrom(nsIInputStream* fromStream, PRUint32 aCount, PRUint32 *aWriteCount); - NS_IMETHOD Flush(void); // nsByteBufferOutputStream methods: nsByteBufferOutputStream(nsByteBufferInputStream* in); @@ -57,11 +57,10 @@ public: NS_DECL_ISUPPORTS // nsIBaseStream methods: - NS_IMETHOD Close(void); + NS_DECL_NSIBASESTREAM // nsIInputStream methods: - NS_IMETHOD GetLength(PRUint32 *aLength); - NS_IMETHOD Read(char* aBuf, PRUint32 aCount, PRUint32 *aReadCount); + NS_DECL_NSIINPUTSTREAM // nsIByteBufferInputStream methods: NS_IMETHOD Fill(nsIInputStream* stream, PRUint32 aCount, PRUint32 *aWriteCount); diff --git a/mozilla/xpcom/io/nsFileSpecImpl.h b/mozilla/xpcom/io/nsFileSpecImpl.h index 4c6eee6de65..f7e0e8a9d12 100644 --- a/mozilla/xpcom/io/nsFileSpecImpl.h +++ b/mozilla/xpcom/io/nsFileSpecImpl.h @@ -32,147 +32,7 @@ class NS_COM nsFileSpecImpl NS_DECL_ISUPPORTS - NS_IMETHOD fromFileSpec(const nsIFileSpec *original); - - NS_IMETHOD GetURLString(char * *aURLString); - NS_IMETHOD SetURLString(char * aURLString); - - /* attribute string UnixStyleFilePath; */ - NS_IMETHOD GetUnixStyleFilePath(char * *aUnixStyleFilePath); - NS_IMETHOD SetUnixStyleFilePath(char * aUnixStyleFilePath); - - /* attribute string PersistentDescriptorString; */ - NS_IMETHOD GetPersistentDescriptorString(char * *aPersistentDescriptorString); - NS_IMETHOD SetPersistentDescriptorString(char * aPersistentDescriptorString); - - /* attribute string NativePath; */ - NS_IMETHOD GetNativePath(char * *aNativePath); - NS_IMETHOD SetNativePath(char * aNativePath); - - /* readonly attribute string NSPRPath; */ - NS_IMETHOD GetNSPRPath(char * *aNSPRPath); - - /* readonly attribute nsresult Error; */ - NS_IMETHOD error(); - - /* boolean isValid (); */ - NS_IMETHOD isValid(PRBool *_retval); - - /* boolean failed (); */ - NS_IMETHOD failed(PRBool *_retval); - - /* attribute string LeafName; */ - NS_IMETHOD GetLeafName(char * *aLeafName); - NS_IMETHOD SetLeafName(char * aLeafName); - - /* readonly attribute nsIFileSpec Parent; */ - NS_IMETHOD GetParent(nsIFileSpec * *aParent); - - /* nsIFileSpec makeUnique (); */ - NS_IMETHOD makeUnique(); - - /* nsIFileSpec makeUniqueWithSuggestedName (in string suggestedName); */ - NS_IMETHOD makeUniqueWithSuggestedName(const char* inSuggestedLeafName); - - /* readonly attribute unsigned long ModDate; */ - NS_IMETHOD GetModDate(PRUint32 *aModDate); - - /* boolean modDateChanged (in unsigned long oldStamp); */ - NS_IMETHOD modDateChanged(PRUint32 oldStamp, PRBool *_retval); - - /* boolean isDirectory (); */ - NS_IMETHOD isDirectory(PRBool *_retval); - - /* boolean isFile (); */ - NS_IMETHOD isFile(PRBool *_retval); - - /* boolean exists (); */ - NS_IMETHOD exists(PRBool *_retval); - - /* boolean isHidden (); */ - NS_IMETHOD isHidden(PRBool *_retval); - - /* boolean isSymlink (); */ - NS_IMETHOD isSymlink(PRBool *_retval); - - /* void resolveSymlink (); */ - NS_IMETHOD resolveSymlink(); - - /* readonly attribute unsigned long FileSize; */ - NS_IMETHOD GetFileSize(PRUint32 *aFileSize); - - /* readonly attribute unsigned long DiskSpaceAvailable; */ - NS_IMETHOD GetDiskSpaceAvailable(PRUint32 *aDiskSpaceAvailable); - - /* nsIFileSpec AppendRelativeUnixPath (in string relativePath); */ - NS_IMETHOD AppendRelativeUnixPath(const char *relativePath); - - /* void createDir (); */ - NS_IMETHOD createDir(); - - /* void touch (); */ - NS_IMETHOD touch(); - - /* void rename ([const] in string newLeafName); */ - NS_IMETHOD rename(const char *newLeafName); - - /* void copyToDir ([const] in nsIFileSpec newParentDir); */ - NS_IMETHOD copyToDir(const nsIFileSpec *newParentDir); - - /* void moveToDir ([const] in nsIFileSpec newParentDir); */ - NS_IMETHOD moveToDir(const nsIFileSpec *newParentDir); - - /* void execute ([const] in string args); */ - NS_IMETHOD execute(const char *args); - - /* void openStreamForReading (); */ - NS_IMETHOD openStreamForReading(); - - /* void openStreamForWriting (); */ - NS_IMETHOD openStreamForWriting(); - - /* void openStreamForReadingAndWriting (); */ - NS_IMETHOD openStreamForReadingAndWriting(); - - /* void close (); */ - NS_IMETHOD closeStream(); - - /* boolean isOpen (); */ - NS_IMETHOD isStreamOpen(PRBool *_retval); - - NS_IMETHOD GetInputStream(nsIInputStream**); - NS_IMETHOD GetOutputStream(nsIOutputStream**); - - NS_IMETHOD GetFileContents(char**); - NS_IMETHOD SetFileContents(char*); - - NS_IMETHOD GetFileSpec(nsFileSpec *aFileSpec); - NS_IMETHOD setFromFileSpec(const nsFileSpec& aFileSpec); - - /* boolean eof (); */ - NS_IMETHOD eof(PRBool *_retval); - - NS_IMETHOD read(char** buffer, PRInt32 requestedCount, PRInt32 *_retval); - - NS_IMETHOD readLine(char** line, PRInt32 bufferSize, PRBool *wasTruncated); - // Check eof() before each call. - // CAUTION: false result only indicates line was truncated - // to fit buffer, or an error occurred (OTHER THAN eof). - - - NS_IMETHOD write(const char* data, PRInt32 requestedCount, PRInt32 *_retval); - - /* void flush (); */ - NS_IMETHOD flush(); - - /* void seek (in long offset); */ - NS_IMETHOD seek(PRInt32 offset); - - /* long tell (); */ - NS_IMETHOD tell(PRInt32 *_retval); - - /* void endline (); */ - NS_IMETHOD endline(); + NS_DECL_NSIFILESPEC //---------------------- // COM Cruft diff --git a/mozilla/xpcom/io/nsIBaseStream.idl b/mozilla/xpcom/io/nsIBaseStream.idl index 52800b291e3..e047f13faa2 100644 --- a/mozilla/xpcom/io/nsIBaseStream.idl +++ b/mozilla/xpcom/io/nsIBaseStream.idl @@ -21,6 +21,7 @@ [scriptable, uuid(6ccb17a0-e95e-11d1-beae-00805f8a66dc)] interface nsIBaseStream : nsISupports { + /** Close the stream. */ void Close(); }; diff --git a/mozilla/xpcom/io/nsPipe.cpp b/mozilla/xpcom/io/nsPipe.cpp index f2d7522f1bc..8038afa05ec 100644 --- a/mozilla/xpcom/io/nsPipe.cpp +++ b/mozilla/xpcom/io/nsPipe.cpp @@ -31,21 +31,18 @@ public: NS_DECL_ISUPPORTS // nsIBaseStream methods: - NS_IMETHOD Close(void); + NS_DECL_NSIBASESTREAM // nsIInputStream methods: - NS_IMETHOD GetLength(PRUint32 *aLength); - NS_IMETHOD Read(char* aBuf, PRUint32 aCount, PRUint32 *aReadCount); + NS_DECL_NSIINPUTSTREAM // nsIBufferInputStream methods: - NS_IMETHOD GetBuffer(nsIBuffer* *result); - NS_IMETHOD Search(const char *forString, PRBool ignoreCase, PRBool *found, PRUint32 *offsetSearchedTo); + NS_DECL_NSIBUFFERINPUTSTREAM + #if 0 NS_IMETHOD Fill(const char *buf, PRUint32 count, PRUint32 *_retval); NS_IMETHOD FillFrom(nsIInputStream *inStr, PRUint32 count, PRUint32 *_retval); #endif - NS_IMETHOD GetNonBlocking(PRBool *aNonBlocking); - NS_IMETHOD SetNonBlocking(PRBool aNonBlocking); // nsBufferInputStream methods: nsBufferInputStream(nsIBuffer* buf, PRBool blocking); @@ -66,18 +63,13 @@ public: NS_DECL_ISUPPORTS // nsIBaseStream methods: - NS_IMETHOD Close(void); + NS_DECL_NSIBASESTREAM // nsIOutputStream methods: - NS_IMETHOD Write(const char* aBuf, PRUint32 aCount, PRUint32 *aWriteCount); - NS_IMETHOD Flush(void); + NS_DECL_NSIOUTPUTSTREAM // nsIBufferOutputStream methods: - NS_IMETHOD GetBuffer(nsIBuffer * *aBuffer); - NS_IMETHOD WriteFrom(nsIInputStream* fromStream, PRUint32 aCount, - PRUint32 *aWriteCount); - NS_IMETHOD GetNonBlocking(PRBool *aNonBlocking); - NS_IMETHOD SetNonBlocking(PRBool aNonBlocking); + NS_DECL_NSIBUFFEROUTPUTSTREAM // nsBufferOutputStream methods: nsBufferOutputStream(nsIBuffer* buf, PRBool blocking);