/work/obj-fuzz/dist/include/nsIBinaryInputStream.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * DO NOT EDIT. THIS FILE IS GENERATED FROM /src/mozilla-central/xpcom/io/nsIBinaryInputStream.idl |
3 | | */ |
4 | | |
5 | | #ifndef __gen_nsIBinaryInputStream_h__ |
6 | | #define __gen_nsIBinaryInputStream_h__ |
7 | | |
8 | | |
9 | | #ifndef __gen_nsIInputStream_h__ |
10 | | #include "nsIInputStream.h" |
11 | | #endif |
12 | | |
13 | | #include "js/Value.h" |
14 | | |
15 | | #include "js/GCAnnotations.h" |
16 | | |
17 | | /* For IDL files that don't want to include root IDL files. */ |
18 | | #ifndef NS_NO_VTABLE |
19 | | #define NS_NO_VTABLE |
20 | | #endif |
21 | | |
22 | | /* starting interface: nsIBinaryInputStream */ |
23 | | #define NS_IBINARYINPUTSTREAM_IID_STR "899b826b-2eb3-469c-8b31-4c29f5d341a6" |
24 | | |
25 | | #define NS_IBINARYINPUTSTREAM_IID \ |
26 | | {0x899b826b, 0x2eb3, 0x469c, \ |
27 | | { 0x8b, 0x31, 0x4c, 0x29, 0xf5, 0xd3, 0x41, 0xa6 }} |
28 | | |
29 | | class NS_NO_VTABLE nsIBinaryInputStream : public nsIInputStream { |
30 | | public: |
31 | | |
32 | | NS_DECLARE_STATIC_IID_ACCESSOR(NS_IBINARYINPUTSTREAM_IID) |
33 | | |
34 | | /* void setInputStream (in nsIInputStream aInputStream); */ |
35 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD SetInputStream(nsIInputStream *aInputStream) = 0; |
36 | | |
37 | | /* boolean readBoolean (); */ |
38 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD ReadBoolean(bool *_retval) = 0; |
39 | | |
40 | | /* uint8_t read8 (); */ |
41 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Read8(uint8_t *_retval) = 0; |
42 | | |
43 | | /* uint16_t read16 (); */ |
44 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Read16(uint16_t *_retval) = 0; |
45 | | |
46 | | /* uint32_t read32 (); */ |
47 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Read32(uint32_t *_retval) = 0; |
48 | | |
49 | | /* uint64_t read64 (); */ |
50 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Read64(uint64_t *_retval) = 0; |
51 | | |
52 | | /* float readFloat (); */ |
53 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD ReadFloat(float *_retval) = 0; |
54 | | |
55 | | /* double readDouble (); */ |
56 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD ReadDouble(double *_retval) = 0; |
57 | | |
58 | | /* ACString readCString (); */ |
59 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD ReadCString(nsACString& _retval) = 0; |
60 | | |
61 | | /* AString readString (); */ |
62 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD ReadString(nsAString& _retval) = 0; |
63 | | |
64 | | /* void readBytes (in uint32_t aLength, [size_is (aLength), retval] out string aString); */ |
65 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD ReadBytes(uint32_t aLength, char * *aString) = 0; |
66 | | |
67 | | /* void readByteArray (in uint32_t aLength, [array, size_is (aLength), retval] out uint8_t aBytes); */ |
68 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD ReadByteArray(uint32_t aLength, uint8_t **aBytes) = 0; |
69 | | |
70 | | /* [implicit_jscontext] unsigned long readArrayBuffer (in uint32_t aLength, in jsval aArrayBuffer); */ |
71 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD ReadArrayBuffer(uint32_t aLength, JS::HandleValue aArrayBuffer, JSContext* cx, uint32_t *_retval) = 0; |
72 | | |
73 | | }; |
74 | | |
75 | | NS_DEFINE_STATIC_IID_ACCESSOR(nsIBinaryInputStream, NS_IBINARYINPUTSTREAM_IID) |
76 | | |
77 | | /* Use this macro when declaring classes that implement this interface. */ |
78 | | #define NS_DECL_NSIBINARYINPUTSTREAM \ |
79 | | NS_IMETHOD SetInputStream(nsIInputStream *aInputStream) override; \ |
80 | | NS_IMETHOD ReadBoolean(bool *_retval) override; \ |
81 | | NS_IMETHOD Read8(uint8_t *_retval) override; \ |
82 | | NS_IMETHOD Read16(uint16_t *_retval) override; \ |
83 | | NS_IMETHOD Read32(uint32_t *_retval) override; \ |
84 | | NS_IMETHOD Read64(uint64_t *_retval) override; \ |
85 | | NS_IMETHOD ReadFloat(float *_retval) override; \ |
86 | | NS_IMETHOD ReadDouble(double *_retval) override; \ |
87 | | NS_IMETHOD ReadCString(nsACString& _retval) override; \ |
88 | | NS_IMETHOD ReadString(nsAString& _retval) override; \ |
89 | | NS_IMETHOD ReadBytes(uint32_t aLength, char * *aString) override; \ |
90 | | NS_IMETHOD ReadByteArray(uint32_t aLength, uint8_t **aBytes) override; \ |
91 | | NS_IMETHOD ReadArrayBuffer(uint32_t aLength, JS::HandleValue aArrayBuffer, JSContext* cx, uint32_t *_retval) override; |
92 | | |
93 | | /* Use this macro when declaring the members of this interface when the |
94 | | class doesn't implement the interface. This is useful for forwarding. */ |
95 | | #define NS_DECL_NON_VIRTUAL_NSIBINARYINPUTSTREAM \ |
96 | | nsresult SetInputStream(nsIInputStream *aInputStream); \ |
97 | | nsresult ReadBoolean(bool *_retval); \ |
98 | | nsresult Read8(uint8_t *_retval); \ |
99 | | nsresult Read16(uint16_t *_retval); \ |
100 | | nsresult Read32(uint32_t *_retval); \ |
101 | | nsresult Read64(uint64_t *_retval); \ |
102 | | nsresult ReadFloat(float *_retval); \ |
103 | | nsresult ReadDouble(double *_retval); \ |
104 | | nsresult ReadCString(nsACString& _retval); \ |
105 | | nsresult ReadString(nsAString& _retval); \ |
106 | | nsresult ReadBytes(uint32_t aLength, char * *aString); \ |
107 | | nsresult ReadByteArray(uint32_t aLength, uint8_t **aBytes); \ |
108 | | nsresult ReadArrayBuffer(uint32_t aLength, JS::HandleValue aArrayBuffer, JSContext* cx, uint32_t *_retval); |
109 | | |
110 | | /* Use this macro to declare functions that forward the behavior of this interface to another object. */ |
111 | | #define NS_FORWARD_NSIBINARYINPUTSTREAM(_to) \ |
112 | | NS_IMETHOD SetInputStream(nsIInputStream *aInputStream) override { return _to SetInputStream(aInputStream); } \ |
113 | | NS_IMETHOD ReadBoolean(bool *_retval) override { return _to ReadBoolean(_retval); } \ |
114 | | NS_IMETHOD Read8(uint8_t *_retval) override { return _to Read8(_retval); } \ |
115 | | NS_IMETHOD Read16(uint16_t *_retval) override { return _to Read16(_retval); } \ |
116 | | NS_IMETHOD Read32(uint32_t *_retval) override { return _to Read32(_retval); } \ |
117 | | NS_IMETHOD Read64(uint64_t *_retval) override { return _to Read64(_retval); } \ |
118 | | NS_IMETHOD ReadFloat(float *_retval) override { return _to ReadFloat(_retval); } \ |
119 | | NS_IMETHOD ReadDouble(double *_retval) override { return _to ReadDouble(_retval); } \ |
120 | | NS_IMETHOD ReadCString(nsACString& _retval) override { return _to ReadCString(_retval); } \ |
121 | | NS_IMETHOD ReadString(nsAString& _retval) override { return _to ReadString(_retval); } \ |
122 | | NS_IMETHOD ReadBytes(uint32_t aLength, char * *aString) override { return _to ReadBytes(aLength, aString); } \ |
123 | | NS_IMETHOD ReadByteArray(uint32_t aLength, uint8_t **aBytes) override { return _to ReadByteArray(aLength, aBytes); } \ |
124 | | NS_IMETHOD ReadArrayBuffer(uint32_t aLength, JS::HandleValue aArrayBuffer, JSContext* cx, uint32_t *_retval) override { return _to ReadArrayBuffer(aLength, aArrayBuffer, cx, _retval); } |
125 | | |
126 | | /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ |
127 | | #define NS_FORWARD_SAFE_NSIBINARYINPUTSTREAM(_to) \ |
128 | | NS_IMETHOD SetInputStream(nsIInputStream *aInputStream) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetInputStream(aInputStream); } \ |
129 | | NS_IMETHOD ReadBoolean(bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ReadBoolean(_retval); } \ |
130 | | NS_IMETHOD Read8(uint8_t *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Read8(_retval); } \ |
131 | | NS_IMETHOD Read16(uint16_t *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Read16(_retval); } \ |
132 | | NS_IMETHOD Read32(uint32_t *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Read32(_retval); } \ |
133 | | NS_IMETHOD Read64(uint64_t *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Read64(_retval); } \ |
134 | | NS_IMETHOD ReadFloat(float *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ReadFloat(_retval); } \ |
135 | | NS_IMETHOD ReadDouble(double *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ReadDouble(_retval); } \ |
136 | | NS_IMETHOD ReadCString(nsACString& _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ReadCString(_retval); } \ |
137 | | NS_IMETHOD ReadString(nsAString& _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ReadString(_retval); } \ |
138 | | NS_IMETHOD ReadBytes(uint32_t aLength, char * *aString) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ReadBytes(aLength, aString); } \ |
139 | | NS_IMETHOD ReadByteArray(uint32_t aLength, uint8_t **aBytes) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ReadByteArray(aLength, aBytes); } \ |
140 | | NS_IMETHOD ReadArrayBuffer(uint32_t aLength, JS::HandleValue aArrayBuffer, JSContext* cx, uint32_t *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ReadArrayBuffer(aLength, aArrayBuffer, cx, _retval); } |
141 | | |
142 | | |
143 | | #ifdef MOZILLA_INTERNAL_API |
144 | | #include "nsString.h" |
145 | | inline nsresult |
146 | | NS_ReadOptionalCString(nsIBinaryInputStream* aStream, nsACString& aResult) |
147 | 0 | { |
148 | 0 | bool nonnull; |
149 | 0 | nsresult rv = aStream->ReadBoolean(&nonnull); |
150 | 0 | if (NS_SUCCEEDED(rv)) { |
151 | 0 | if (nonnull) |
152 | 0 | rv = aStream->ReadCString(aResult); |
153 | 0 | else |
154 | 0 | aResult.Truncate(); |
155 | 0 | } |
156 | 0 | return rv; |
157 | 0 | } |
158 | | inline nsresult |
159 | | NS_ReadOptionalString(nsIBinaryInputStream* aStream, nsAString& aResult) |
160 | 0 | { |
161 | 0 | bool nonnull; |
162 | 0 | nsresult rv = aStream->ReadBoolean(&nonnull); |
163 | 0 | if (NS_SUCCEEDED(rv)) { |
164 | 0 | if (nonnull) |
165 | 0 | rv = aStream->ReadString(aResult); |
166 | 0 | else |
167 | 0 | aResult.Truncate(); |
168 | 0 | } |
169 | 0 | return rv; |
170 | 0 | } |
171 | | #endif |
172 | | |
173 | | #endif /* __gen_nsIBinaryInputStream_h__ */ |