Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
michael@0 | 2 | * This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #ifndef nsBinaryStream_h___ |
michael@0 | 7 | #define nsBinaryStream_h___ |
michael@0 | 8 | |
michael@0 | 9 | #include "nsCOMPtr.h" |
michael@0 | 10 | #include "nsAString.h" |
michael@0 | 11 | #include "nsIObjectInputStream.h" |
michael@0 | 12 | #include "nsIObjectOutputStream.h" |
michael@0 | 13 | #include "nsIStreamBufferAccess.h" |
michael@0 | 14 | |
michael@0 | 15 | #define NS_BINARYOUTPUTSTREAM_CID \ |
michael@0 | 16 | { /* 86c37b9a-74e7-4672-844e-6e7dd83ba484 */ \ |
michael@0 | 17 | 0x86c37b9a, \ |
michael@0 | 18 | 0x74e7, \ |
michael@0 | 19 | 0x4672, \ |
michael@0 | 20 | {0x84, 0x4e, 0x6e, 0x7d, 0xd8, 0x3b, 0xa4, 0x84} \ |
michael@0 | 21 | } |
michael@0 | 22 | |
michael@0 | 23 | #define NS_BINARYOUTPUTSTREAM_CONTRACTID "@mozilla.org/binaryoutputstream;1" |
michael@0 | 24 | |
michael@0 | 25 | // Derive from nsIObjectOutputStream so this class can be used as a superclass |
michael@0 | 26 | // by nsObjectOutputStream. |
michael@0 | 27 | class nsBinaryOutputStream : public nsIObjectOutputStream |
michael@0 | 28 | { |
michael@0 | 29 | public: |
michael@0 | 30 | nsBinaryOutputStream() {} |
michael@0 | 31 | // virtual dtor since subclasses call our Release() |
michael@0 | 32 | virtual ~nsBinaryOutputStream() {} |
michael@0 | 33 | |
michael@0 | 34 | protected: |
michael@0 | 35 | // nsISupports methods |
michael@0 | 36 | NS_DECL_ISUPPORTS |
michael@0 | 37 | |
michael@0 | 38 | // nsIOutputStream methods |
michael@0 | 39 | NS_DECL_NSIOUTPUTSTREAM |
michael@0 | 40 | |
michael@0 | 41 | // nsIBinaryOutputStream methods |
michael@0 | 42 | NS_DECL_NSIBINARYOUTPUTSTREAM |
michael@0 | 43 | |
michael@0 | 44 | // nsIObjectOutputStream methods |
michael@0 | 45 | NS_DECL_NSIOBJECTOUTPUTSTREAM |
michael@0 | 46 | |
michael@0 | 47 | // Call Write(), ensuring that all proffered data is written |
michael@0 | 48 | nsresult WriteFully(const char *aBuf, uint32_t aCount); |
michael@0 | 49 | |
michael@0 | 50 | nsCOMPtr<nsIOutputStream> mOutputStream; |
michael@0 | 51 | nsCOMPtr<nsIStreamBufferAccess> mBufferAccess; |
michael@0 | 52 | }; |
michael@0 | 53 | |
michael@0 | 54 | #define NS_BINARYINPUTSTREAM_CID \ |
michael@0 | 55 | { /* c521a612-2aad-46db-b6ab-3b821fb150b1 */ \ |
michael@0 | 56 | 0xc521a612, \ |
michael@0 | 57 | 0x2aad, \ |
michael@0 | 58 | 0x46db, \ |
michael@0 | 59 | {0xb6, 0xab, 0x3b, 0x82, 0x1f, 0xb1, 0x50, 0xb1} \ |
michael@0 | 60 | } |
michael@0 | 61 | |
michael@0 | 62 | #define NS_BINARYINPUTSTREAM_CONTRACTID "@mozilla.org/binaryinputstream;1" |
michael@0 | 63 | |
michael@0 | 64 | // Derive from nsIObjectInputStream so this class can be used as a superclass |
michael@0 | 65 | // by nsObjectInputStream. |
michael@0 | 66 | class nsBinaryInputStream : public nsIObjectInputStream |
michael@0 | 67 | { |
michael@0 | 68 | public: |
michael@0 | 69 | nsBinaryInputStream() {} |
michael@0 | 70 | // virtual dtor since subclasses call our Release() |
michael@0 | 71 | virtual ~nsBinaryInputStream() {} |
michael@0 | 72 | |
michael@0 | 73 | protected: |
michael@0 | 74 | // nsISupports methods |
michael@0 | 75 | NS_DECL_ISUPPORTS |
michael@0 | 76 | |
michael@0 | 77 | // nsIInputStream methods |
michael@0 | 78 | NS_DECL_NSIINPUTSTREAM |
michael@0 | 79 | |
michael@0 | 80 | // nsIBinaryInputStream methods |
michael@0 | 81 | NS_DECL_NSIBINARYINPUTSTREAM |
michael@0 | 82 | |
michael@0 | 83 | // nsIObjectInputStream methods |
michael@0 | 84 | NS_DECL_NSIOBJECTINPUTSTREAM |
michael@0 | 85 | |
michael@0 | 86 | nsCOMPtr<nsIInputStream> mInputStream; |
michael@0 | 87 | nsCOMPtr<nsIStreamBufferAccess> mBufferAccess; |
michael@0 | 88 | }; |
michael@0 | 89 | |
michael@0 | 90 | #endif // nsBinaryStream_h___ |