1 : /*
2 : * DO NOT EDIT. THIS FILE IS GENERATED FROM /builds/slave/m-beta-lnx-codecoverage/build/xpcom/io/nsIBinaryOutputStream.idl
3 : */
4 :
5 : #ifndef __gen_nsIBinaryOutputStream_h__
6 : #define __gen_nsIBinaryOutputStream_h__
7 :
8 :
9 : #ifndef __gen_nsIOutputStream_h__
10 : #include "nsIOutputStream.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: nsIBinaryOutputStream */
23 : #define NS_IBINARYOUTPUTSTREAM_IID_STR "204ee610-8765-11d3-90cf-0040056a906e"
24 :
25 : #define NS_IBINARYOUTPUTSTREAM_IID \
26 : {0x204ee610, 0x8765, 0x11d3, \
27 : { 0x90, 0xcf, 0x00, 0x40, 0x05, 0x6a, 0x90, 0x6e }}
28 :
29 15628 : class NS_NO_VTABLE NS_SCRIPTABLE nsIBinaryOutputStream : public nsIOutputStream {
30 : public:
31 :
32 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_IBINARYOUTPUTSTREAM_IID)
33 :
34 : /* void setOutputStream (in nsIOutputStream aOutputStream); */
35 : NS_SCRIPTABLE NS_IMETHOD SetOutputStream(nsIOutputStream *aOutputStream) = 0;
36 :
37 : /* void writeBoolean (in boolean aBoolean); */
38 : NS_SCRIPTABLE NS_IMETHOD WriteBoolean(bool aBoolean) = 0;
39 :
40 : /* void write8 (in PRUint8 aByte); */
41 : NS_SCRIPTABLE NS_IMETHOD Write8(PRUint8 aByte) = 0;
42 :
43 : /* void write16 (in PRUint16 a16); */
44 : NS_SCRIPTABLE NS_IMETHOD Write16(PRUint16 a16) = 0;
45 :
46 : /* void write32 (in PRUint32 a32); */
47 : NS_SCRIPTABLE NS_IMETHOD Write32(PRUint32 a32) = 0;
48 :
49 : /* void write64 (in PRUint64 a64); */
50 : NS_SCRIPTABLE NS_IMETHOD Write64(PRUint64 a64) = 0;
51 :
52 : /* void writeFloat (in float aFloat); */
53 : NS_SCRIPTABLE NS_IMETHOD WriteFloat(float aFloat) = 0;
54 :
55 : /* void writeDouble (in double aDouble); */
56 : NS_SCRIPTABLE NS_IMETHOD WriteDouble(double aDouble) = 0;
57 :
58 : /* void writeStringZ (in string aString); */
59 : NS_SCRIPTABLE NS_IMETHOD WriteStringZ(const char * aString) = 0;
60 :
61 : /* void writeWStringZ (in wstring aString); */
62 : NS_SCRIPTABLE NS_IMETHOD WriteWStringZ(const PRUnichar * aString) = 0;
63 :
64 : /* void writeUtf8Z (in wstring aString); */
65 : NS_SCRIPTABLE NS_IMETHOD WriteUtf8Z(const PRUnichar * aString) = 0;
66 :
67 : /* void writeBytes ([size_is (aLength)] in string aString, in PRUint32 aLength); */
68 : NS_SCRIPTABLE NS_IMETHOD WriteBytes(const char * aString, PRUint32 aLength) = 0;
69 :
70 : /* void writeByteArray ([array, size_is (aLength)] in PRUint8 aBytes, in PRUint32 aLength); */
71 : NS_SCRIPTABLE NS_IMETHOD WriteByteArray(PRUint8 *aBytes, PRUint32 aLength) = 0;
72 :
73 : };
74 :
75 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIBinaryOutputStream, NS_IBINARYOUTPUTSTREAM_IID)
76 :
77 : /* Use this macro when declaring classes that implement this interface. */
78 : #define NS_DECL_NSIBINARYOUTPUTSTREAM \
79 : NS_SCRIPTABLE NS_IMETHOD SetOutputStream(nsIOutputStream *aOutputStream); \
80 : NS_SCRIPTABLE NS_IMETHOD WriteBoolean(bool aBoolean); \
81 : NS_SCRIPTABLE NS_IMETHOD Write8(PRUint8 aByte); \
82 : NS_SCRIPTABLE NS_IMETHOD Write16(PRUint16 a16); \
83 : NS_SCRIPTABLE NS_IMETHOD Write32(PRUint32 a32); \
84 : NS_SCRIPTABLE NS_IMETHOD Write64(PRUint64 a64); \
85 : NS_SCRIPTABLE NS_IMETHOD WriteFloat(float aFloat); \
86 : NS_SCRIPTABLE NS_IMETHOD WriteDouble(double aDouble); \
87 : NS_SCRIPTABLE NS_IMETHOD WriteStringZ(const char * aString); \
88 : NS_SCRIPTABLE NS_IMETHOD WriteWStringZ(const PRUnichar * aString); \
89 : NS_SCRIPTABLE NS_IMETHOD WriteUtf8Z(const PRUnichar * aString); \
90 : NS_SCRIPTABLE NS_IMETHOD WriteBytes(const char * aString, PRUint32 aLength); \
91 : NS_SCRIPTABLE NS_IMETHOD WriteByteArray(PRUint8 *aBytes, PRUint32 aLength);
92 :
93 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
94 : #define NS_FORWARD_NSIBINARYOUTPUTSTREAM(_to) \
95 : NS_SCRIPTABLE NS_IMETHOD SetOutputStream(nsIOutputStream *aOutputStream) { return _to SetOutputStream(aOutputStream); } \
96 : NS_SCRIPTABLE NS_IMETHOD WriteBoolean(bool aBoolean) { return _to WriteBoolean(aBoolean); } \
97 : NS_SCRIPTABLE NS_IMETHOD Write8(PRUint8 aByte) { return _to Write8(aByte); } \
98 : NS_SCRIPTABLE NS_IMETHOD Write16(PRUint16 a16) { return _to Write16(a16); } \
99 : NS_SCRIPTABLE NS_IMETHOD Write32(PRUint32 a32) { return _to Write32(a32); } \
100 : NS_SCRIPTABLE NS_IMETHOD Write64(PRUint64 a64) { return _to Write64(a64); } \
101 : NS_SCRIPTABLE NS_IMETHOD WriteFloat(float aFloat) { return _to WriteFloat(aFloat); } \
102 : NS_SCRIPTABLE NS_IMETHOD WriteDouble(double aDouble) { return _to WriteDouble(aDouble); } \
103 : NS_SCRIPTABLE NS_IMETHOD WriteStringZ(const char * aString) { return _to WriteStringZ(aString); } \
104 : NS_SCRIPTABLE NS_IMETHOD WriteWStringZ(const PRUnichar * aString) { return _to WriteWStringZ(aString); } \
105 : NS_SCRIPTABLE NS_IMETHOD WriteUtf8Z(const PRUnichar * aString) { return _to WriteUtf8Z(aString); } \
106 : NS_SCRIPTABLE NS_IMETHOD WriteBytes(const char * aString, PRUint32 aLength) { return _to WriteBytes(aString, aLength); } \
107 : NS_SCRIPTABLE NS_IMETHOD WriteByteArray(PRUint8 *aBytes, PRUint32 aLength) { return _to WriteByteArray(aBytes, aLength); }
108 :
109 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
110 : #define NS_FORWARD_SAFE_NSIBINARYOUTPUTSTREAM(_to) \
111 : NS_SCRIPTABLE NS_IMETHOD SetOutputStream(nsIOutputStream *aOutputStream) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetOutputStream(aOutputStream); } \
112 : NS_SCRIPTABLE NS_IMETHOD WriteBoolean(bool aBoolean) { return !_to ? NS_ERROR_NULL_POINTER : _to->WriteBoolean(aBoolean); } \
113 : NS_SCRIPTABLE NS_IMETHOD Write8(PRUint8 aByte) { return !_to ? NS_ERROR_NULL_POINTER : _to->Write8(aByte); } \
114 : NS_SCRIPTABLE NS_IMETHOD Write16(PRUint16 a16) { return !_to ? NS_ERROR_NULL_POINTER : _to->Write16(a16); } \
115 : NS_SCRIPTABLE NS_IMETHOD Write32(PRUint32 a32) { return !_to ? NS_ERROR_NULL_POINTER : _to->Write32(a32); } \
116 : NS_SCRIPTABLE NS_IMETHOD Write64(PRUint64 a64) { return !_to ? NS_ERROR_NULL_POINTER : _to->Write64(a64); } \
117 : NS_SCRIPTABLE NS_IMETHOD WriteFloat(float aFloat) { return !_to ? NS_ERROR_NULL_POINTER : _to->WriteFloat(aFloat); } \
118 : NS_SCRIPTABLE NS_IMETHOD WriteDouble(double aDouble) { return !_to ? NS_ERROR_NULL_POINTER : _to->WriteDouble(aDouble); } \
119 : NS_SCRIPTABLE NS_IMETHOD WriteStringZ(const char * aString) { return !_to ? NS_ERROR_NULL_POINTER : _to->WriteStringZ(aString); } \
120 : NS_SCRIPTABLE NS_IMETHOD WriteWStringZ(const PRUnichar * aString) { return !_to ? NS_ERROR_NULL_POINTER : _to->WriteWStringZ(aString); } \
121 : NS_SCRIPTABLE NS_IMETHOD WriteUtf8Z(const PRUnichar * aString) { return !_to ? NS_ERROR_NULL_POINTER : _to->WriteUtf8Z(aString); } \
122 : NS_SCRIPTABLE NS_IMETHOD WriteBytes(const char * aString, PRUint32 aLength) { return !_to ? NS_ERROR_NULL_POINTER : _to->WriteBytes(aString, aLength); } \
123 : NS_SCRIPTABLE NS_IMETHOD WriteByteArray(PRUint8 *aBytes, PRUint32 aLength) { return !_to ? NS_ERROR_NULL_POINTER : _to->WriteByteArray(aBytes, aLength); }
124 :
125 : #if 0
126 : /* Use the code below as a template for the implementation class for this interface. */
127 :
128 : /* Header file */
129 : class nsBinaryOutputStream : public nsIBinaryOutputStream
130 : {
131 : public:
132 : NS_DECL_ISUPPORTS
133 : NS_DECL_NSIBINARYOUTPUTSTREAM
134 :
135 : nsBinaryOutputStream();
136 :
137 : private:
138 : ~nsBinaryOutputStream();
139 :
140 : protected:
141 : /* additional members */
142 : };
143 :
144 : /* Implementation file */
145 : NS_IMPL_ISUPPORTS1(nsBinaryOutputStream, nsIBinaryOutputStream)
146 :
147 : nsBinaryOutputStream::nsBinaryOutputStream()
148 : {
149 : /* member initializers and constructor code */
150 : }
151 :
152 : nsBinaryOutputStream::~nsBinaryOutputStream()
153 : {
154 : /* destructor code */
155 : }
156 :
157 : /* void setOutputStream (in nsIOutputStream aOutputStream); */
158 : NS_IMETHODIMP nsBinaryOutputStream::SetOutputStream(nsIOutputStream *aOutputStream)
159 : {
160 : return NS_ERROR_NOT_IMPLEMENTED;
161 : }
162 :
163 : /* void writeBoolean (in boolean aBoolean); */
164 : NS_IMETHODIMP nsBinaryOutputStream::WriteBoolean(bool aBoolean)
165 : {
166 : return NS_ERROR_NOT_IMPLEMENTED;
167 : }
168 :
169 : /* void write8 (in PRUint8 aByte); */
170 : NS_IMETHODIMP nsBinaryOutputStream::Write8(PRUint8 aByte)
171 : {
172 : return NS_ERROR_NOT_IMPLEMENTED;
173 : }
174 :
175 : /* void write16 (in PRUint16 a16); */
176 : NS_IMETHODIMP nsBinaryOutputStream::Write16(PRUint16 a16)
177 : {
178 : return NS_ERROR_NOT_IMPLEMENTED;
179 : }
180 :
181 : /* void write32 (in PRUint32 a32); */
182 : NS_IMETHODIMP nsBinaryOutputStream::Write32(PRUint32 a32)
183 : {
184 : return NS_ERROR_NOT_IMPLEMENTED;
185 : }
186 :
187 : /* void write64 (in PRUint64 a64); */
188 : NS_IMETHODIMP nsBinaryOutputStream::Write64(PRUint64 a64)
189 : {
190 : return NS_ERROR_NOT_IMPLEMENTED;
191 : }
192 :
193 : /* void writeFloat (in float aFloat); */
194 : NS_IMETHODIMP nsBinaryOutputStream::WriteFloat(float aFloat)
195 : {
196 : return NS_ERROR_NOT_IMPLEMENTED;
197 : }
198 :
199 : /* void writeDouble (in double aDouble); */
200 : NS_IMETHODIMP nsBinaryOutputStream::WriteDouble(double aDouble)
201 : {
202 : return NS_ERROR_NOT_IMPLEMENTED;
203 : }
204 :
205 : /* void writeStringZ (in string aString); */
206 : NS_IMETHODIMP nsBinaryOutputStream::WriteStringZ(const char * aString)
207 : {
208 : return NS_ERROR_NOT_IMPLEMENTED;
209 : }
210 :
211 : /* void writeWStringZ (in wstring aString); */
212 : NS_IMETHODIMP nsBinaryOutputStream::WriteWStringZ(const PRUnichar * aString)
213 : {
214 : return NS_ERROR_NOT_IMPLEMENTED;
215 : }
216 :
217 : /* void writeUtf8Z (in wstring aString); */
218 : NS_IMETHODIMP nsBinaryOutputStream::WriteUtf8Z(const PRUnichar * aString)
219 : {
220 : return NS_ERROR_NOT_IMPLEMENTED;
221 : }
222 :
223 : /* void writeBytes ([size_is (aLength)] in string aString, in PRUint32 aLength); */
224 : NS_IMETHODIMP nsBinaryOutputStream::WriteBytes(const char * aString, PRUint32 aLength)
225 : {
226 : return NS_ERROR_NOT_IMPLEMENTED;
227 : }
228 :
229 : /* void writeByteArray ([array, size_is (aLength)] in PRUint8 aBytes, in PRUint32 aLength); */
230 : NS_IMETHODIMP nsBinaryOutputStream::WriteByteArray(PRUint8 *aBytes, PRUint32 aLength)
231 : {
232 : return NS_ERROR_NOT_IMPLEMENTED;
233 : }
234 :
235 : /* End of implementation class template. */
236 : #endif
237 :
238 :
239 : inline nsresult
240 6 : NS_WriteOptionalStringZ(nsIBinaryOutputStream* aStream, const char* aString)
241 : {
242 6 : bool nonnull = (aString != nsnull);
243 6 : nsresult rv = aStream->WriteBoolean(nonnull);
244 6 : if (NS_SUCCEEDED(rv) && nonnull)
245 6 : rv = aStream->WriteStringZ(aString);
246 6 : return rv;
247 : }
248 : inline nsresult
249 : NS_WriteOptionalWStringZ(nsIBinaryOutputStream* aStream, const PRUnichar* aString)
250 : {
251 : bool nonnull = (aString != nsnull);
252 : nsresult rv = aStream->WriteBoolean(nonnull);
253 : if (NS_SUCCEEDED(rv) && nonnull)
254 : rv = aStream->WriteWStringZ(aString);
255 : return rv;
256 : }
257 :
258 : #endif /* __gen_nsIBinaryOutputStream_h__ */
|