1 : /*
2 : * DO NOT EDIT. THIS FILE IS GENERATED FROM /builds/slave/m-beta-lnx-codecoverage/build/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 : #ifndef __gen_nsrootidl_h__
14 : #include "nsrootidl.h"
15 : #endif
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 "7b456cb0-8772-11d3-90cf-0040056a906e"
24 :
25 : #define NS_IBINARYINPUTSTREAM_IID \
26 : {0x7b456cb0, 0x8772, 0x11d3, \
27 : { 0x90, 0xcf, 0x00, 0x40, 0x05, 0x6a, 0x90, 0x6e }}
28 :
29 17106 : class NS_NO_VTABLE NS_SCRIPTABLE nsIBinaryInputStream : public nsIInputStream {
30 : public:
31 :
32 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_IBINARYINPUTSTREAM_IID)
33 :
34 : /* void setInputStream (in nsIInputStream aInputStream); */
35 : NS_SCRIPTABLE NS_IMETHOD SetInputStream(nsIInputStream *aInputStream) = 0;
36 :
37 : /* boolean readBoolean (); */
38 : NS_SCRIPTABLE NS_IMETHOD ReadBoolean(bool *_retval NS_OUTPARAM) = 0;
39 :
40 : /* PRUint8 read8 (); */
41 : NS_SCRIPTABLE NS_IMETHOD Read8(PRUint8 *_retval NS_OUTPARAM) = 0;
42 :
43 : /* PRUint16 read16 (); */
44 : NS_SCRIPTABLE NS_IMETHOD Read16(PRUint16 *_retval NS_OUTPARAM) = 0;
45 :
46 : /* PRUint32 read32 (); */
47 : NS_SCRIPTABLE NS_IMETHOD Read32(PRUint32 *_retval NS_OUTPARAM) = 0;
48 :
49 : /* PRUint64 read64 (); */
50 : NS_SCRIPTABLE NS_IMETHOD Read64(PRUint64 *_retval NS_OUTPARAM) = 0;
51 :
52 : /* float readFloat (); */
53 : NS_SCRIPTABLE NS_IMETHOD ReadFloat(float *_retval NS_OUTPARAM) = 0;
54 :
55 : /* double readDouble (); */
56 : NS_SCRIPTABLE NS_IMETHOD ReadDouble(double *_retval NS_OUTPARAM) = 0;
57 :
58 : /* ACString readCString (); */
59 : NS_SCRIPTABLE NS_IMETHOD ReadCString(nsACString & _retval NS_OUTPARAM) = 0;
60 :
61 : /* AString readString (); */
62 : NS_SCRIPTABLE NS_IMETHOD ReadString(nsAString & _retval NS_OUTPARAM) = 0;
63 :
64 : /* void readBytes (in PRUint32 aLength, [size_is (aLength), retval] out string aString); */
65 : NS_SCRIPTABLE NS_IMETHOD ReadBytes(PRUint32 aLength, char * *aString NS_OUTPARAM) = 0;
66 :
67 : /* void readByteArray (in PRUint32 aLength, [array, size_is (aLength), retval] out PRUint8 aBytes); */
68 : NS_SCRIPTABLE NS_IMETHOD ReadByteArray(PRUint32 aLength, PRUint8 **aBytes NS_OUTPARAM) = 0;
69 :
70 : };
71 :
72 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIBinaryInputStream, NS_IBINARYINPUTSTREAM_IID)
73 :
74 : /* Use this macro when declaring classes that implement this interface. */
75 : #define NS_DECL_NSIBINARYINPUTSTREAM \
76 : NS_SCRIPTABLE NS_IMETHOD SetInputStream(nsIInputStream *aInputStream); \
77 : NS_SCRIPTABLE NS_IMETHOD ReadBoolean(bool *_retval NS_OUTPARAM); \
78 : NS_SCRIPTABLE NS_IMETHOD Read8(PRUint8 *_retval NS_OUTPARAM); \
79 : NS_SCRIPTABLE NS_IMETHOD Read16(PRUint16 *_retval NS_OUTPARAM); \
80 : NS_SCRIPTABLE NS_IMETHOD Read32(PRUint32 *_retval NS_OUTPARAM); \
81 : NS_SCRIPTABLE NS_IMETHOD Read64(PRUint64 *_retval NS_OUTPARAM); \
82 : NS_SCRIPTABLE NS_IMETHOD ReadFloat(float *_retval NS_OUTPARAM); \
83 : NS_SCRIPTABLE NS_IMETHOD ReadDouble(double *_retval NS_OUTPARAM); \
84 : NS_SCRIPTABLE NS_IMETHOD ReadCString(nsACString & _retval NS_OUTPARAM); \
85 : NS_SCRIPTABLE NS_IMETHOD ReadString(nsAString & _retval NS_OUTPARAM); \
86 : NS_SCRIPTABLE NS_IMETHOD ReadBytes(PRUint32 aLength, char * *aString NS_OUTPARAM); \
87 : NS_SCRIPTABLE NS_IMETHOD ReadByteArray(PRUint32 aLength, PRUint8 **aBytes NS_OUTPARAM);
88 :
89 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
90 : #define NS_FORWARD_NSIBINARYINPUTSTREAM(_to) \
91 : NS_SCRIPTABLE NS_IMETHOD SetInputStream(nsIInputStream *aInputStream) { return _to SetInputStream(aInputStream); } \
92 : NS_SCRIPTABLE NS_IMETHOD ReadBoolean(bool *_retval NS_OUTPARAM) { return _to ReadBoolean(_retval); } \
93 : NS_SCRIPTABLE NS_IMETHOD Read8(PRUint8 *_retval NS_OUTPARAM) { return _to Read8(_retval); } \
94 : NS_SCRIPTABLE NS_IMETHOD Read16(PRUint16 *_retval NS_OUTPARAM) { return _to Read16(_retval); } \
95 : NS_SCRIPTABLE NS_IMETHOD Read32(PRUint32 *_retval NS_OUTPARAM) { return _to Read32(_retval); } \
96 : NS_SCRIPTABLE NS_IMETHOD Read64(PRUint64 *_retval NS_OUTPARAM) { return _to Read64(_retval); } \
97 : NS_SCRIPTABLE NS_IMETHOD ReadFloat(float *_retval NS_OUTPARAM) { return _to ReadFloat(_retval); } \
98 : NS_SCRIPTABLE NS_IMETHOD ReadDouble(double *_retval NS_OUTPARAM) { return _to ReadDouble(_retval); } \
99 : NS_SCRIPTABLE NS_IMETHOD ReadCString(nsACString & _retval NS_OUTPARAM) { return _to ReadCString(_retval); } \
100 : NS_SCRIPTABLE NS_IMETHOD ReadString(nsAString & _retval NS_OUTPARAM) { return _to ReadString(_retval); } \
101 : NS_SCRIPTABLE NS_IMETHOD ReadBytes(PRUint32 aLength, char * *aString NS_OUTPARAM) { return _to ReadBytes(aLength, aString); } \
102 : NS_SCRIPTABLE NS_IMETHOD ReadByteArray(PRUint32 aLength, PRUint8 **aBytes NS_OUTPARAM) { return _to ReadByteArray(aLength, aBytes); }
103 :
104 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
105 : #define NS_FORWARD_SAFE_NSIBINARYINPUTSTREAM(_to) \
106 : NS_SCRIPTABLE NS_IMETHOD SetInputStream(nsIInputStream *aInputStream) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetInputStream(aInputStream); } \
107 : NS_SCRIPTABLE NS_IMETHOD ReadBoolean(bool *_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->ReadBoolean(_retval); } \
108 : NS_SCRIPTABLE NS_IMETHOD Read8(PRUint8 *_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->Read8(_retval); } \
109 : NS_SCRIPTABLE NS_IMETHOD Read16(PRUint16 *_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->Read16(_retval); } \
110 : NS_SCRIPTABLE NS_IMETHOD Read32(PRUint32 *_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->Read32(_retval); } \
111 : NS_SCRIPTABLE NS_IMETHOD Read64(PRUint64 *_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->Read64(_retval); } \
112 : NS_SCRIPTABLE NS_IMETHOD ReadFloat(float *_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->ReadFloat(_retval); } \
113 : NS_SCRIPTABLE NS_IMETHOD ReadDouble(double *_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->ReadDouble(_retval); } \
114 : NS_SCRIPTABLE NS_IMETHOD ReadCString(nsACString & _retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->ReadCString(_retval); } \
115 : NS_SCRIPTABLE NS_IMETHOD ReadString(nsAString & _retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->ReadString(_retval); } \
116 : NS_SCRIPTABLE NS_IMETHOD ReadBytes(PRUint32 aLength, char * *aString NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->ReadBytes(aLength, aString); } \
117 : NS_SCRIPTABLE NS_IMETHOD ReadByteArray(PRUint32 aLength, PRUint8 **aBytes NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->ReadByteArray(aLength, aBytes); }
118 :
119 : #if 0
120 : /* Use the code below as a template for the implementation class for this interface. */
121 :
122 : /* Header file */
123 : class nsBinaryInputStream : public nsIBinaryInputStream
124 : {
125 : public:
126 : NS_DECL_ISUPPORTS
127 : NS_DECL_NSIBINARYINPUTSTREAM
128 :
129 : nsBinaryInputStream();
130 :
131 : private:
132 : ~nsBinaryInputStream();
133 :
134 : protected:
135 : /* additional members */
136 : };
137 :
138 : /* Implementation file */
139 : NS_IMPL_ISUPPORTS1(nsBinaryInputStream, nsIBinaryInputStream)
140 :
141 : nsBinaryInputStream::nsBinaryInputStream()
142 : {
143 : /* member initializers and constructor code */
144 : }
145 :
146 : nsBinaryInputStream::~nsBinaryInputStream()
147 : {
148 : /* destructor code */
149 : }
150 :
151 : /* void setInputStream (in nsIInputStream aInputStream); */
152 : NS_IMETHODIMP nsBinaryInputStream::SetInputStream(nsIInputStream *aInputStream)
153 : {
154 : return NS_ERROR_NOT_IMPLEMENTED;
155 : }
156 :
157 : /* boolean readBoolean (); */
158 : NS_IMETHODIMP nsBinaryInputStream::ReadBoolean(bool *_retval NS_OUTPARAM)
159 : {
160 : return NS_ERROR_NOT_IMPLEMENTED;
161 : }
162 :
163 : /* PRUint8 read8 (); */
164 : NS_IMETHODIMP nsBinaryInputStream::Read8(PRUint8 *_retval NS_OUTPARAM)
165 : {
166 : return NS_ERROR_NOT_IMPLEMENTED;
167 : }
168 :
169 : /* PRUint16 read16 (); */
170 : NS_IMETHODIMP nsBinaryInputStream::Read16(PRUint16 *_retval NS_OUTPARAM)
171 : {
172 : return NS_ERROR_NOT_IMPLEMENTED;
173 : }
174 :
175 : /* PRUint32 read32 (); */
176 : NS_IMETHODIMP nsBinaryInputStream::Read32(PRUint32 *_retval NS_OUTPARAM)
177 : {
178 : return NS_ERROR_NOT_IMPLEMENTED;
179 : }
180 :
181 : /* PRUint64 read64 (); */
182 : NS_IMETHODIMP nsBinaryInputStream::Read64(PRUint64 *_retval NS_OUTPARAM)
183 : {
184 : return NS_ERROR_NOT_IMPLEMENTED;
185 : }
186 :
187 : /* float readFloat (); */
188 : NS_IMETHODIMP nsBinaryInputStream::ReadFloat(float *_retval NS_OUTPARAM)
189 : {
190 : return NS_ERROR_NOT_IMPLEMENTED;
191 : }
192 :
193 : /* double readDouble (); */
194 : NS_IMETHODIMP nsBinaryInputStream::ReadDouble(double *_retval NS_OUTPARAM)
195 : {
196 : return NS_ERROR_NOT_IMPLEMENTED;
197 : }
198 :
199 : /* ACString readCString (); */
200 : NS_IMETHODIMP nsBinaryInputStream::ReadCString(nsACString & _retval NS_OUTPARAM)
201 : {
202 : return NS_ERROR_NOT_IMPLEMENTED;
203 : }
204 :
205 : /* AString readString (); */
206 : NS_IMETHODIMP nsBinaryInputStream::ReadString(nsAString & _retval NS_OUTPARAM)
207 : {
208 : return NS_ERROR_NOT_IMPLEMENTED;
209 : }
210 :
211 : /* void readBytes (in PRUint32 aLength, [size_is (aLength), retval] out string aString); */
212 : NS_IMETHODIMP nsBinaryInputStream::ReadBytes(PRUint32 aLength, char * *aString NS_OUTPARAM)
213 : {
214 : return NS_ERROR_NOT_IMPLEMENTED;
215 : }
216 :
217 : /* void readByteArray (in PRUint32 aLength, [array, size_is (aLength), retval] out PRUint8 aBytes); */
218 : NS_IMETHODIMP nsBinaryInputStream::ReadByteArray(PRUint32 aLength, PRUint8 **aBytes NS_OUTPARAM)
219 : {
220 : return NS_ERROR_NOT_IMPLEMENTED;
221 : }
222 :
223 : /* End of implementation class template. */
224 : #endif
225 :
226 :
227 : #ifdef MOZILLA_INTERNAL_API
228 : #include "nsString.h"
229 : inline nsresult
230 6 : NS_ReadOptionalCString(nsIBinaryInputStream* aStream, nsACString& aResult)
231 : {
232 : bool nonnull;
233 6 : nsresult rv = aStream->ReadBoolean(&nonnull);
234 6 : if (NS_SUCCEEDED(rv)) {
235 6 : if (nonnull)
236 6 : rv = aStream->ReadCString(aResult);
237 : else
238 0 : aResult.Truncate();
239 : }
240 6 : return rv;
241 : }
242 : inline nsresult
243 : NS_ReadOptionalString(nsIBinaryInputStream* aStream, nsAString& aResult)
244 : {
245 : bool nonnull;
246 : nsresult rv = aStream->ReadBoolean(&nonnull);
247 : if (NS_SUCCEEDED(rv)) {
248 : if (nonnull)
249 : rv = aStream->ReadString(aResult);
250 : else
251 : aResult.Truncate();
252 : }
253 : return rv;
254 : }
255 : #endif
256 :
257 : #endif /* __gen_nsIBinaryInputStream_h__ */
|