Merge autoland to mozilla-central. a=merge
[gecko.git] / xpcom / io / nsScriptableInputStream.h
blob1dc8a80962ca2be1a75e0512545fdf429c9c53b9
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef ___nsscriptableinputstream___h_
8 #define ___nsscriptableinputstream___h_
10 #include "nsIScriptableInputStream.h"
11 #include "nsIInputStream.h"
12 #include "nsCOMPtr.h"
13 #include "mozilla/Attributes.h"
15 #define NS_SCRIPTABLEINPUTSTREAM_CID \
16 { \
17 0x7225c040, 0xa9bf, 0x11d3, { \
18 0xa1, 0x97, 0x0, 0x50, 0x4, 0x1c, 0xaf, 0x44 \
19 } \
22 #define NS_SCRIPTABLEINPUTSTREAM_CONTRACTID \
23 "@mozilla.org/scriptableinputstream;1"
25 class nsScriptableInputStream final : public nsIScriptableInputStream {
26 public:
27 // nsISupports methods
28 NS_DECL_ISUPPORTS
30 // nsIScriptableInputStream methods
31 NS_DECL_NSISCRIPTABLEINPUTSTREAM
33 // nsScriptableInputStream methods
34 nsScriptableInputStream() = default;
36 static nsresult Create(REFNSIID aIID, void** aResult);
38 private:
39 ~nsScriptableInputStream() = default;
41 nsresult ReadHelper(char* aBuffer, uint32_t aCount);
43 nsCOMPtr<nsIInputStream> mInputStream;
46 #endif // ___nsscriptableinputstream___h_