From 37fc2206e7135d38097800a06cd4eba7028e76ab Mon Sep 17 00:00:00 2001 From: "dougt%meer.net" Date: Fri, 17 Jun 2005 03:47:11 +0000 Subject: [PATCH] Removing nsIRandomAccessStore from tree (still lives in obsolete). b=283487 r=darin, sr=mscott, a=asa git-svn-id: svn://10.0.0.236/trunk@174755 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/mailnews/base/util/nsMsgDBFolder.cpp | 4 +- .../mailnews/imap/src/nsImapOfflineSync.cpp | 2 +- mozilla/xpcom/io/nsIStringStream.idl | 8 ++-- mozilla/xpcom/io/nsStringStream.cpp | 41 +++++-------------- mozilla/xpcom/io/nsStringStream.h | 21 ---------- 5 files changed, 17 insertions(+), 59 deletions(-) diff --git a/mozilla/mailnews/base/util/nsMsgDBFolder.cpp b/mozilla/mailnews/base/util/nsMsgDBFolder.cpp index a171e7b6a6f..94320a334c3 100644 --- a/mozilla/mailnews/base/util/nsMsgDBFolder.cpp +++ b/mozilla/mailnews/base/util/nsMsgDBFolder.cpp @@ -718,7 +718,7 @@ NS_IMETHODIMP nsMsgDBFolder::GetOfflineStoreOutputStream(nsIOutputStream **outpu NS_ENSURE_SUCCESS(rv, rv); supports->QueryInterface(NS_GET_IID(nsIOutputStream), (void **) outputStream); - nsCOMPtr seekable = do_QueryInterface(supports); + nsCOMPtr seekable = do_QueryInterface(supports); if (seekable) seekable->Seek(nsISeekableStream::NS_SEEK_END, 0); } @@ -1470,7 +1470,7 @@ nsresult nsMsgDBFolder::StartNewOfflineMessage() nsresult nsMsgDBFolder::EndNewOfflineMessage() { - nsCOMPtr seekable; + nsCOMPtr seekable; nsInt64 curStorePos; PRUint32 messageOffset; nsMsgKey messageKey; diff --git a/mozilla/mailnews/imap/src/nsImapOfflineSync.cpp b/mozilla/mailnews/imap/src/nsImapOfflineSync.cpp index 2bb07ccb1e1..b8fc92d3fde 100644 --- a/mozilla/mailnews/imap/src/nsImapOfflineSync.cpp +++ b/mozilla/mailnews/imap/src/nsImapOfflineSync.cpp @@ -335,7 +335,7 @@ nsImapOfflineSync::ProcessAppendMsgOperation(nsIMsgOfflineImapOperation *current rv = destFolder->GetOfflineStoreInputStream(getter_AddRefs(offlineStoreInputStream)); if (NS_SUCCEEDED(rv) && offlineStoreInputStream) { - nsCOMPtr seekStream = do_QueryInterface(offlineStoreInputStream); + nsCOMPtr seekStream = do_QueryInterface(offlineStoreInputStream); NS_ASSERTION(seekStream, "non seekable stream - can't read from offline msg"); if (seekStream) { diff --git a/mozilla/xpcom/io/nsIStringStream.idl b/mozilla/xpcom/io/nsIStringStream.idl index f381823fa1b..3ff5727c3af 100644 --- a/mozilla/xpcom/io/nsIStringStream.idl +++ b/mozilla/xpcom/io/nsIStringStream.idl @@ -102,28 +102,28 @@ interface nsIStringInputStream : nsIInputStream //----------------------------------------------------------------------------- // Factory method to get an nsInputStream from an nsAString. Result will -// implement nsIStringInputStream and nsIRandomAccessStore +// implement nsIStringInputStream and nsISeekableStream extern "C" NS_COM nsresult NS_NewStringInputStream(nsIInputStream** aStreamResult, const nsAString& aStringToRead); //----------------------------------------------------------------------------- // Factory method to get an nsInputStream from an nsACString. Result will -// implement nsIStringInputStream and nsIRandomAccessStore +// implement nsIStringInputStream and nsISeekableStream extern "C" NS_COM nsresult NS_NewCStringInputStream(nsIInputStream** aStreamResult, const nsACString& aStringToRead); //----------------------------------------------------------------------------- // Factory method to get an nsInputStream from a string. Result will -// implement nsIStringInputStream and nsIRandomAccessStore +// implement nsIStringInputStream and nsISeekableStream extern "C" NS_COM nsresult NS_NewCharInputStream(nsIInputStream** aStreamResult, const char* aStringToRead); //----------------------------------------------------------------------------- // Factory method to get an nsInputStream from a byte buffer. Result will -// implement nsIStringInputStream and nsIRandomAccessStore +// implement nsIStringInputStream and nsISeekableStream extern "C" NS_COM nsresult NS_NewByteInputStream(nsIInputStream** aStreamResult, const char* aStringToRead, diff --git a/mozilla/xpcom/io/nsStringStream.cpp b/mozilla/xpcom/io/nsStringStream.cpp index e49bd039120..1abfed8125b 100644 --- a/mozilla/xpcom/io/nsStringStream.cpp +++ b/mozilla/xpcom/io/nsStringStream.cpp @@ -75,7 +75,7 @@ static nsresult ns_file_convert_result(PRInt32 nativeErr) //----------------------------------------------------------------------------- class nsStringInputStream : public nsIStringInputStream - , public nsIRandomAccessStore + , public nsISeekableStream { public: @@ -97,16 +97,10 @@ private: public: NS_DECL_ISUPPORTS - NS_DECL_NSISTRINGINPUTSTREAM NS_DECL_NSIINPUTSTREAM - - // nsIRandomAccessStore interface - NS_IMETHOD GetAtEOF(PRBool* outAtEOF); - NS_IMETHOD SetAtEOF(PRBool inAtEOF); - NS_DECL_NSISEEKABLESTREAM - + protected: PRInt32 LengthRemaining() const { @@ -135,10 +129,9 @@ protected: PRUint32 mLength; }; -NS_IMPL_THREADSAFE_ISUPPORTS4(nsStringInputStream, +NS_IMPL_THREADSAFE_ISUPPORTS3(nsStringInputStream, nsIStringInputStream, nsIInputStream, - nsIRandomAccessStore, nsISeekableStream) ///////// @@ -226,7 +219,7 @@ NS_IMETHODIMP nsStringInputStream::Read(char* aBuf, PRUint32 aCount, *aReadCount = bytesRead; if (bytesRead < aCount) - SetAtEOF(PR_TRUE); + SetEOF(); return NS_OK; } @@ -264,7 +257,8 @@ nsStringInputStream::IsNonBlocking(PRBool *aNonBlocking) ///////// // nsISeekableStream implementation ///////// -NS_IMETHODIMP nsStringInputStream::Seek(PRInt32 whence, PRInt64 offset) +NS_IMETHODIMP +nsStringInputStream::Seek(PRInt32 whence, PRInt64 offset) { mLastResult = NS_OK; // reset on a seek. const nsInt64 maxUint32 = PR_UINT32_MAX; @@ -309,23 +303,8 @@ NS_IMETHODIMP nsStringInputStream::SetEOF() return NS_ERROR_NOT_IMPLEMENTED; } -///////// -// nsIRandomAccessStore implementation -///////// -NS_IMETHODIMP nsStringInputStream::GetAtEOF(PRBool* outAtEOF) -{ - *outAtEOF = mEOF; - return NS_OK; -} - -NS_IMETHODIMP nsStringInputStream::SetAtEOF(PRBool inAtEOF) -{ - mEOF = inAtEOF; - return NS_OK; -} - // Factory method to get an nsInputStream from an nsAString. Result will -// implement nsIStringInputStream and nsIRandomAccessStore +// implement nsIStringInputStream and nsISeekableStream extern "C" NS_COM nsresult NS_NewStringInputStream(nsIInputStream** aStreamResult, const nsAString& aStringToRead) @@ -356,7 +335,7 @@ NS_NewStringInputStream(nsIInputStream** aStreamResult, } // Factory method to get an nsInputStream from an nsACString. Result will -// implement nsIStringInputStream and nsIRandomAccessStore +// implement nsIStringInputStream and nsISeekableStream extern "C" NS_COM nsresult NS_NewCStringInputStream(nsIInputStream** aStreamResult, const nsACString& aStringToRead) @@ -387,7 +366,7 @@ NS_NewCStringInputStream(nsIInputStream** aStreamResult, } // Factory method to get an nsInputStream from a C string. Result will -// implement nsIStringInputStream and nsIRandomAccessStore +// implement nsIStringInputStream and nsISeekableStream extern "C" NS_COM nsresult NS_NewCharInputStream(nsIInputStream** aStreamResult, const char* aStringToRead) @@ -412,7 +391,7 @@ NS_NewCharInputStream(nsIInputStream** aStreamResult, } // Factory method to get an nsInputStream from a byte array. Result will -// implement nsIStringInputStream and nsIRandomAccessStore +// implement nsIStringInputStream and nsISeekableStream extern "C" NS_COM nsresult NS_NewByteInputStream(nsIInputStream** aStreamResult, const char* aStringToRead, diff --git a/mozilla/xpcom/io/nsStringStream.h b/mozilla/xpcom/io/nsStringStream.h index 6f2f7f2062b..fcfe38ab8b0 100644 --- a/mozilla/xpcom/io/nsStringStream.h +++ b/mozilla/xpcom/io/nsStringStream.h @@ -40,33 +40,12 @@ #define nsStringStream_h__ #include "nsISeekableStream.h" - -/* a6cf90e8-15b3-11d2-932e-00805f8add32 */ -#define NS_IRANDOMACCESS_IID \ -{ 0xa6cf90eb, 0x15b3, 0x11d2, \ - {0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} } - -//======================================================================================== -class nsIRandomAccessStore -// Supports Seek, Tell etc. -//======================================================================================== -: public nsISeekableStream -{ -public: - NS_DEFINE_STATIC_IID_ACCESSOR(NS_IRANDOMACCESS_IID) - -/* "PROTECTED" */ - NS_IMETHOD GetAtEOF(PRBool* outAtEOF) = 0; - NS_IMETHOD SetAtEOF(PRBool inAtEOF) = 0; -}; // class nsIRandomAccessStore - #include "nsIStringStream.h" /** * nsStringInputStream : nsIStringInputStream * , nsIInputStream * , nsISeekableStream - * , nsIRandomAccessStore */ #define NS_STRINGINPUTSTREAM_CLASSNAME "nsStringInputStream" #define NS_STRINGINPUTSTREAM_CONTRACTID "@mozilla.org/io/string-input-stream;1"