зеркало из https://github.com/mozilla/pjs.git
Removing nsIRandomAccessStore from tree (still lives in obsolete). b=283487 r=darin, sr=mscott, a=asa
This commit is contained in:
Родитель
4cc690cdc1
Коммит
ed0ddb3c84
|
@ -718,7 +718,7 @@ NS_IMETHODIMP nsMsgDBFolder::GetOfflineStoreOutputStream(nsIOutputStream **outpu
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
supports->QueryInterface(NS_GET_IID(nsIOutputStream), (void **) outputStream);
|
||||
|
||||
nsCOMPtr <nsIRandomAccessStore> seekable = do_QueryInterface(supports);
|
||||
nsCOMPtr <nsISeekableStream> seekable = do_QueryInterface(supports);
|
||||
if (seekable)
|
||||
seekable->Seek(nsISeekableStream::NS_SEEK_END, 0);
|
||||
}
|
||||
|
@ -1470,7 +1470,7 @@ nsresult nsMsgDBFolder::StartNewOfflineMessage()
|
|||
|
||||
nsresult nsMsgDBFolder::EndNewOfflineMessage()
|
||||
{
|
||||
nsCOMPtr <nsIRandomAccessStore> seekable;
|
||||
nsCOMPtr <nsISeekableStream> seekable;
|
||||
nsInt64 curStorePos;
|
||||
PRUint32 messageOffset;
|
||||
nsMsgKey messageKey;
|
||||
|
|
|
@ -335,7 +335,7 @@ nsImapOfflineSync::ProcessAppendMsgOperation(nsIMsgOfflineImapOperation *current
|
|||
rv = destFolder->GetOfflineStoreInputStream(getter_AddRefs(offlineStoreInputStream));
|
||||
if (NS_SUCCEEDED(rv) && offlineStoreInputStream)
|
||||
{
|
||||
nsCOMPtr<nsIRandomAccessStore> seekStream = do_QueryInterface(offlineStoreInputStream);
|
||||
nsCOMPtr<nsISeekableStream> seekStream = do_QueryInterface(offlineStoreInputStream);
|
||||
NS_ASSERTION(seekStream, "non seekable stream - can't read from offline msg");
|
||||
if (seekStream)
|
||||
{
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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"
|
||||
|
|
Загрузка…
Ссылка в новой задаче