/work/obj-fuzz/dist/include/nsIBinaryOutputStream.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * DO NOT EDIT. THIS FILE IS GENERATED FROM /src/mozilla-central/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 | | #include "js/GCAnnotations.h" |
14 | | |
15 | | /* For IDL files that don't want to include root IDL files. */ |
16 | | #ifndef NS_NO_VTABLE |
17 | | #define NS_NO_VTABLE |
18 | | #endif |
19 | | |
20 | | /* starting interface: nsIBinaryOutputStream */ |
21 | | #define NS_IBINARYOUTPUTSTREAM_IID_STR "204ee610-8765-11d3-90cf-0040056a906e" |
22 | | |
23 | | #define NS_IBINARYOUTPUTSTREAM_IID \ |
24 | | {0x204ee610, 0x8765, 0x11d3, \ |
25 | | { 0x90, 0xcf, 0x00, 0x40, 0x05, 0x6a, 0x90, 0x6e }} |
26 | | |
27 | | class NS_NO_VTABLE nsIBinaryOutputStream : public nsIOutputStream { |
28 | | public: |
29 | | |
30 | | NS_DECLARE_STATIC_IID_ACCESSOR(NS_IBINARYOUTPUTSTREAM_IID) |
31 | | |
32 | | /* void setOutputStream (in nsIOutputStream aOutputStream); */ |
33 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD SetOutputStream(nsIOutputStream *aOutputStream) = 0; |
34 | | |
35 | | /* void writeBoolean (in boolean aBoolean); */ |
36 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD WriteBoolean(bool aBoolean) = 0; |
37 | | |
38 | | /* void write8 (in uint8_t aByte); */ |
39 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Write8(uint8_t aByte) = 0; |
40 | | |
41 | | /* void write16 (in uint16_t a16); */ |
42 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Write16(uint16_t a16) = 0; |
43 | | |
44 | | /* void write32 (in uint32_t a32); */ |
45 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Write32(uint32_t a32) = 0; |
46 | | |
47 | | /* void write64 (in uint64_t a64); */ |
48 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Write64(uint64_t a64) = 0; |
49 | | |
50 | | /* void writeFloat (in float aFloat); */ |
51 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD WriteFloat(float aFloat) = 0; |
52 | | |
53 | | /* void writeDouble (in double aDouble); */ |
54 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD WriteDouble(double aDouble) = 0; |
55 | | |
56 | | /* void writeStringZ (in string aString); */ |
57 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD WriteStringZ(const char * aString) = 0; |
58 | | |
59 | | /* void writeWStringZ (in wstring aString); */ |
60 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD WriteWStringZ(const char16_t * aString) = 0; |
61 | | |
62 | | /* void writeUtf8Z (in wstring aString); */ |
63 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD WriteUtf8Z(const char16_t * aString) = 0; |
64 | | |
65 | | /* void writeBytes ([size_is (aLength)] in string aString, [optional] in uint32_t aLength); */ |
66 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD WriteBytes(const char * aString, uint32_t aLength) = 0; |
67 | | |
68 | | /* void writeByteArray ([array, size_is (aLength)] in uint8_t aBytes, [optional] in uint32_t aLength); */ |
69 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD WriteByteArray(uint8_t *aBytes, uint32_t aLength) = 0; |
70 | | |
71 | | }; |
72 | | |
73 | | NS_DEFINE_STATIC_IID_ACCESSOR(nsIBinaryOutputStream, NS_IBINARYOUTPUTSTREAM_IID) |
74 | | |
75 | | /* Use this macro when declaring classes that implement this interface. */ |
76 | | #define NS_DECL_NSIBINARYOUTPUTSTREAM \ |
77 | | NS_IMETHOD SetOutputStream(nsIOutputStream *aOutputStream) override; \ |
78 | | NS_IMETHOD WriteBoolean(bool aBoolean) override; \ |
79 | | NS_IMETHOD Write8(uint8_t aByte) override; \ |
80 | | NS_IMETHOD Write16(uint16_t a16) override; \ |
81 | | NS_IMETHOD Write32(uint32_t a32) override; \ |
82 | | NS_IMETHOD Write64(uint64_t a64) override; \ |
83 | | NS_IMETHOD WriteFloat(float aFloat) override; \ |
84 | | NS_IMETHOD WriteDouble(double aDouble) override; \ |
85 | | NS_IMETHOD WriteStringZ(const char * aString) override; \ |
86 | | NS_IMETHOD WriteWStringZ(const char16_t * aString) override; \ |
87 | | NS_IMETHOD WriteUtf8Z(const char16_t * aString) override; \ |
88 | | NS_IMETHOD WriteBytes(const char * aString, uint32_t aLength) override; \ |
89 | | NS_IMETHOD WriteByteArray(uint8_t *aBytes, uint32_t aLength) override; |
90 | | |
91 | | /* Use this macro when declaring the members of this interface when the |
92 | | class doesn't implement the interface. This is useful for forwarding. */ |
93 | | #define NS_DECL_NON_VIRTUAL_NSIBINARYOUTPUTSTREAM \ |
94 | | nsresult SetOutputStream(nsIOutputStream *aOutputStream); \ |
95 | | nsresult WriteBoolean(bool aBoolean); \ |
96 | | nsresult Write8(uint8_t aByte); \ |
97 | | nsresult Write16(uint16_t a16); \ |
98 | | nsresult Write32(uint32_t a32); \ |
99 | | nsresult Write64(uint64_t a64); \ |
100 | | nsresult WriteFloat(float aFloat); \ |
101 | | nsresult WriteDouble(double aDouble); \ |
102 | | nsresult WriteStringZ(const char * aString); \ |
103 | | nsresult WriteWStringZ(const char16_t * aString); \ |
104 | | nsresult WriteUtf8Z(const char16_t * aString); \ |
105 | | nsresult WriteBytes(const char * aString, uint32_t aLength); \ |
106 | | nsresult WriteByteArray(uint8_t *aBytes, uint32_t aLength); |
107 | | |
108 | | /* Use this macro to declare functions that forward the behavior of this interface to another object. */ |
109 | | #define NS_FORWARD_NSIBINARYOUTPUTSTREAM(_to) \ |
110 | | NS_IMETHOD SetOutputStream(nsIOutputStream *aOutputStream) override { return _to SetOutputStream(aOutputStream); } \ |
111 | | NS_IMETHOD WriteBoolean(bool aBoolean) override { return _to WriteBoolean(aBoolean); } \ |
112 | | NS_IMETHOD Write8(uint8_t aByte) override { return _to Write8(aByte); } \ |
113 | | NS_IMETHOD Write16(uint16_t a16) override { return _to Write16(a16); } \ |
114 | | NS_IMETHOD Write32(uint32_t a32) override { return _to Write32(a32); } \ |
115 | | NS_IMETHOD Write64(uint64_t a64) override { return _to Write64(a64); } \ |
116 | | NS_IMETHOD WriteFloat(float aFloat) override { return _to WriteFloat(aFloat); } \ |
117 | | NS_IMETHOD WriteDouble(double aDouble) override { return _to WriteDouble(aDouble); } \ |
118 | | NS_IMETHOD WriteStringZ(const char * aString) override { return _to WriteStringZ(aString); } \ |
119 | | NS_IMETHOD WriteWStringZ(const char16_t * aString) override { return _to WriteWStringZ(aString); } \ |
120 | | NS_IMETHOD WriteUtf8Z(const char16_t * aString) override { return _to WriteUtf8Z(aString); } \ |
121 | | NS_IMETHOD WriteBytes(const char * aString, uint32_t aLength) override { return _to WriteBytes(aString, aLength); } \ |
122 | | NS_IMETHOD WriteByteArray(uint8_t *aBytes, uint32_t aLength) override { return _to WriteByteArray(aBytes, aLength); } |
123 | | |
124 | | /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ |
125 | | #define NS_FORWARD_SAFE_NSIBINARYOUTPUTSTREAM(_to) \ |
126 | | NS_IMETHOD SetOutputStream(nsIOutputStream *aOutputStream) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetOutputStream(aOutputStream); } \ |
127 | | NS_IMETHOD WriteBoolean(bool aBoolean) override { return !_to ? NS_ERROR_NULL_POINTER : _to->WriteBoolean(aBoolean); } \ |
128 | | NS_IMETHOD Write8(uint8_t aByte) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Write8(aByte); } \ |
129 | | NS_IMETHOD Write16(uint16_t a16) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Write16(a16); } \ |
130 | | NS_IMETHOD Write32(uint32_t a32) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Write32(a32); } \ |
131 | | NS_IMETHOD Write64(uint64_t a64) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Write64(a64); } \ |
132 | | NS_IMETHOD WriteFloat(float aFloat) override { return !_to ? NS_ERROR_NULL_POINTER : _to->WriteFloat(aFloat); } \ |
133 | | NS_IMETHOD WriteDouble(double aDouble) override { return !_to ? NS_ERROR_NULL_POINTER : _to->WriteDouble(aDouble); } \ |
134 | | NS_IMETHOD WriteStringZ(const char * aString) override { return !_to ? NS_ERROR_NULL_POINTER : _to->WriteStringZ(aString); } \ |
135 | | NS_IMETHOD WriteWStringZ(const char16_t * aString) override { return !_to ? NS_ERROR_NULL_POINTER : _to->WriteWStringZ(aString); } \ |
136 | | NS_IMETHOD WriteUtf8Z(const char16_t * aString) override { return !_to ? NS_ERROR_NULL_POINTER : _to->WriteUtf8Z(aString); } \ |
137 | | NS_IMETHOD WriteBytes(const char * aString, uint32_t aLength) override { return !_to ? NS_ERROR_NULL_POINTER : _to->WriteBytes(aString, aLength); } \ |
138 | | NS_IMETHOD WriteByteArray(uint8_t *aBytes, uint32_t aLength) override { return !_to ? NS_ERROR_NULL_POINTER : _to->WriteByteArray(aBytes, aLength); } |
139 | | |
140 | | |
141 | | inline nsresult |
142 | | NS_WriteOptionalStringZ(nsIBinaryOutputStream* aStream, const char* aString) |
143 | 0 | { |
144 | 0 | bool nonnull = (aString != nullptr); |
145 | 0 | nsresult rv = aStream->WriteBoolean(nonnull); |
146 | 0 | if (NS_SUCCEEDED(rv) && nonnull) |
147 | 0 | rv = aStream->WriteStringZ(aString); |
148 | 0 | return rv; |
149 | 0 | } |
150 | | inline nsresult |
151 | | NS_WriteOptionalWStringZ(nsIBinaryOutputStream* aStream, const char16_t* aString) |
152 | 0 | { |
153 | 0 | bool nonnull = (aString != nullptr); |
154 | 0 | nsresult rv = aStream->WriteBoolean(nonnull); |
155 | 0 | if (NS_SUCCEEDED(rv) && nonnull) |
156 | 0 | rv = aStream->WriteWStringZ(aString); |
157 | 0 | return rv; |
158 | 0 | } |
159 | | |
160 | | #endif /* __gen_nsIBinaryOutputStream_h__ */ |