/work/obj-fuzz/dist/include/mozIStorageValueArray.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * DO NOT EDIT. THIS FILE IS GENERATED FROM /src/mozilla-central/storage/mozIStorageValueArray.idl |
3 | | */ |
4 | | |
5 | | #ifndef __gen_mozIStorageValueArray_h__ |
6 | | #define __gen_mozIStorageValueArray_h__ |
7 | | |
8 | | |
9 | | #ifndef __gen_nsISupports_h__ |
10 | | #include "nsISupports.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 | | #include "mozilla/DebugOnly.h" |
20 | | |
21 | | /* starting interface: mozIStorageValueArray */ |
22 | | #define MOZISTORAGEVALUEARRAY_IID_STR "6e6306f4-ffa7-40f5-96ca-36159ce8f431" |
23 | | |
24 | | #define MOZISTORAGEVALUEARRAY_IID \ |
25 | | {0x6e6306f4, 0xffa7, 0x40f5, \ |
26 | | { 0x96, 0xca, 0x36, 0x15, 0x9c, 0xe8, 0xf4, 0x31 }} |
27 | | |
28 | | class mozIStorageValueArray : public nsISupports { |
29 | | public: |
30 | | |
31 | | NS_DECLARE_STATIC_IID_ACCESSOR(MOZISTORAGEVALUEARRAY_IID) |
32 | | |
33 | | enum { |
34 | | VALUE_TYPE_NULL = 0, |
35 | | VALUE_TYPE_INTEGER = 1, |
36 | | VALUE_TYPE_FLOAT = 2, |
37 | | VALUE_TYPE_TEXT = 3, |
38 | | VALUE_TYPE_BLOB = 4 |
39 | | }; |
40 | | |
41 | | /* readonly attribute unsigned long numEntries; */ |
42 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetNumEntries(uint32_t *aNumEntries) = 0; |
43 | | |
44 | | /* long getTypeOfIndex (in unsigned long aIndex); */ |
45 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetTypeOfIndex(uint32_t aIndex, int32_t *_retval) = 0; |
46 | | |
47 | | /* long getInt32 (in unsigned long aIndex); */ |
48 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetInt32(uint32_t aIndex, int32_t *_retval) = 0; |
49 | | |
50 | | /* long long getInt64 (in unsigned long aIndex); */ |
51 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetInt64(uint32_t aIndex, int64_t *_retval) = 0; |
52 | | |
53 | | /* double getDouble (in unsigned long aIndex); */ |
54 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetDouble(uint32_t aIndex, double *_retval) = 0; |
55 | | |
56 | | /* AUTF8String getUTF8String (in unsigned long aIndex); */ |
57 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetUTF8String(uint32_t aIndex, nsACString& _retval) = 0; |
58 | | |
59 | | /* AString getString (in unsigned long aIndex); */ |
60 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetString(uint32_t aIndex, nsAString& _retval) = 0; |
61 | | |
62 | | /* void getBlob (in unsigned long aIndex, out unsigned long aDataSize, [array, size_is (aDataSize)] out octet aData); */ |
63 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetBlob(uint32_t aIndex, uint32_t *aDataSize, uint8_t **aData) = 0; |
64 | | |
65 | | /* AString getBlobAsString (in unsigned long aIndex); */ |
66 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetBlobAsString(uint32_t aIndex, nsAString& _retval) = 0; |
67 | | |
68 | | /* AUTF8String getBlobAsUTF8String (in unsigned long aIndex); */ |
69 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetBlobAsUTF8String(uint32_t aIndex, nsACString& _retval) = 0; |
70 | | |
71 | | /* boolean getIsNull (in unsigned long aIndex); */ |
72 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD GetIsNull(uint32_t aIndex, bool *_retval) = 0; |
73 | | |
74 | | /* [noscript] void getSharedUTF8String (in unsigned long aIndex, out unsigned long aLength, [shared, retval] out string aResult); */ |
75 | | NS_IMETHOD GetSharedUTF8String(uint32_t aIndex, uint32_t *aLength, const char * *aResult) = 0; |
76 | | |
77 | | /* [noscript] void getSharedString (in unsigned long aIndex, out unsigned long aLength, [shared, retval] out wstring aResult); */ |
78 | | NS_IMETHOD GetSharedString(uint32_t aIndex, uint32_t *aLength, const char16_t * *aResult) = 0; |
79 | | |
80 | | /* [noscript] void getSharedBlob (in unsigned long aIndex, out unsigned long aLength, [shared, retval] out octetPtr aResult); */ |
81 | | NS_IMETHOD GetSharedBlob(uint32_t aIndex, uint32_t *aLength, const uint8_t * * aResult) = 0; |
82 | | |
83 | | /** |
84 | | * Getters for native code that return their values as |
85 | | * the return type, for convenience and sanity. |
86 | | * |
87 | | * Not virtual; no vtable bloat. |
88 | | */ |
89 | 0 | inline int32_t AsInt32(uint32_t idx) { |
90 | 0 | int32_t v = 0; |
91 | 0 | mozilla::DebugOnly<nsresult> rv = GetInt32(idx, &v); |
92 | 0 | MOZ_ASSERT(NS_SUCCEEDED(rv) || IsNull(idx), |
93 | 0 | "Getting value failed, wrong column index?"); |
94 | 0 | return v; |
95 | 0 | } |
96 | 0 | inline int64_t AsInt64(uint32_t idx) { |
97 | 0 | int64_t v = 0; |
98 | 0 | mozilla::DebugOnly<nsresult> rv = GetInt64(idx, &v); |
99 | 0 | MOZ_ASSERT(NS_SUCCEEDED(rv) || IsNull(idx), |
100 | 0 | "Getting value failed, wrong column index?"); |
101 | 0 | return v; |
102 | 0 | } |
103 | 0 | inline double AsDouble(uint32_t idx) { |
104 | 0 | double v = 0.0; |
105 | 0 | mozilla::DebugOnly<nsresult> rv = GetDouble(idx, &v); |
106 | 0 | MOZ_ASSERT(NS_SUCCEEDED(rv) || IsNull(idx), |
107 | 0 | "Getting value failed, wrong column index?"); |
108 | 0 | return v; |
109 | 0 | } |
110 | 0 | inline const char* AsSharedUTF8String(uint32_t idx, uint32_t *len) { |
111 | 0 | const char *str = nullptr; |
112 | 0 | *len = 0; |
113 | 0 | mozilla::DebugOnly<nsresult> rv = GetSharedUTF8String(idx, len, &str); |
114 | 0 | MOZ_ASSERT(NS_SUCCEEDED(rv) || IsNull(idx), |
115 | 0 | "Getting value failed, wrong column index?"); |
116 | 0 | return str; |
117 | 0 | } |
118 | 0 | inline const char16_t* AsSharedWString(uint32_t idx, uint32_t *len) { |
119 | 0 | const char16_t *str = nullptr; |
120 | 0 | *len = 0; |
121 | 0 | mozilla::DebugOnly<nsresult> rv = GetSharedString(idx, len, &str); |
122 | 0 | MOZ_ASSERT(NS_SUCCEEDED(rv) || IsNull(idx), |
123 | 0 | "Getting value failed, wrong column index?"); |
124 | 0 | return str; |
125 | 0 | } |
126 | 0 | inline const uint8_t* AsSharedBlob(uint32_t idx, uint32_t *len) { |
127 | 0 | const uint8_t *blob = nullptr; |
128 | 0 | *len = 0; |
129 | 0 | mozilla::DebugOnly<nsresult> rv = GetSharedBlob(idx, len, &blob); |
130 | 0 | MOZ_ASSERT(NS_SUCCEEDED(rv) || IsNull(idx), |
131 | 0 | "Getting value failed, wrong column index?"); |
132 | 0 | return blob; |
133 | 0 | } |
134 | 0 | inline bool IsNull(uint32_t idx) { |
135 | 0 | bool b = false; |
136 | 0 | mozilla::DebugOnly<nsresult> rv = GetIsNull(idx, &b); |
137 | 0 | MOZ_ASSERT(NS_SUCCEEDED(rv), |
138 | 0 | "Getting value failed, wrong column index?"); |
139 | 0 | return b; |
140 | 0 | } |
141 | | }; |
142 | | |
143 | | NS_DEFINE_STATIC_IID_ACCESSOR(mozIStorageValueArray, MOZISTORAGEVALUEARRAY_IID) |
144 | | |
145 | | /* Use this macro when declaring classes that implement this interface. */ |
146 | | #define NS_DECL_MOZISTORAGEVALUEARRAY \ |
147 | | NS_IMETHOD GetNumEntries(uint32_t *aNumEntries) override; \ |
148 | | NS_IMETHOD GetTypeOfIndex(uint32_t aIndex, int32_t *_retval) override; \ |
149 | | NS_IMETHOD GetInt32(uint32_t aIndex, int32_t *_retval) override; \ |
150 | | NS_IMETHOD GetInt64(uint32_t aIndex, int64_t *_retval) override; \ |
151 | | NS_IMETHOD GetDouble(uint32_t aIndex, double *_retval) override; \ |
152 | | NS_IMETHOD GetUTF8String(uint32_t aIndex, nsACString& _retval) override; \ |
153 | | NS_IMETHOD GetString(uint32_t aIndex, nsAString& _retval) override; \ |
154 | | NS_IMETHOD GetBlob(uint32_t aIndex, uint32_t *aDataSize, uint8_t **aData) override; \ |
155 | | NS_IMETHOD GetBlobAsString(uint32_t aIndex, nsAString& _retval) override; \ |
156 | | NS_IMETHOD GetBlobAsUTF8String(uint32_t aIndex, nsACString& _retval) override; \ |
157 | | NS_IMETHOD GetIsNull(uint32_t aIndex, bool *_retval) override; \ |
158 | | NS_IMETHOD GetSharedUTF8String(uint32_t aIndex, uint32_t *aLength, const char * *aResult) override; \ |
159 | | NS_IMETHOD GetSharedString(uint32_t aIndex, uint32_t *aLength, const char16_t * *aResult) override; \ |
160 | | NS_IMETHOD GetSharedBlob(uint32_t aIndex, uint32_t *aLength, const uint8_t * * aResult) override; \ |
161 | | |
162 | | /* Use this macro when declaring the members of this interface when the |
163 | | class doesn't implement the interface. This is useful for forwarding. */ |
164 | | #define NS_DECL_NON_VIRTUAL_MOZISTORAGEVALUEARRAY \ |
165 | | nsresult GetNumEntries(uint32_t *aNumEntries); \ |
166 | | nsresult GetTypeOfIndex(uint32_t aIndex, int32_t *_retval); \ |
167 | | nsresult GetInt32(uint32_t aIndex, int32_t *_retval); \ |
168 | | nsresult GetInt64(uint32_t aIndex, int64_t *_retval); \ |
169 | | nsresult GetDouble(uint32_t aIndex, double *_retval); \ |
170 | | nsresult GetUTF8String(uint32_t aIndex, nsACString& _retval); \ |
171 | | nsresult GetString(uint32_t aIndex, nsAString& _retval); \ |
172 | | nsresult GetBlob(uint32_t aIndex, uint32_t *aDataSize, uint8_t **aData); \ |
173 | | nsresult GetBlobAsString(uint32_t aIndex, nsAString& _retval); \ |
174 | | nsresult GetBlobAsUTF8String(uint32_t aIndex, nsACString& _retval); \ |
175 | | nsresult GetIsNull(uint32_t aIndex, bool *_retval); \ |
176 | | nsresult GetSharedUTF8String(uint32_t aIndex, uint32_t *aLength, const char * *aResult); \ |
177 | | nsresult GetSharedString(uint32_t aIndex, uint32_t *aLength, const char16_t * *aResult); \ |
178 | | nsresult GetSharedBlob(uint32_t aIndex, uint32_t *aLength, const uint8_t * * aResult); \ |
179 | | |
180 | | /* Use this macro to declare functions that forward the behavior of this interface to another object. */ |
181 | | #define NS_FORWARD_MOZISTORAGEVALUEARRAY(_to) \ |
182 | | NS_IMETHOD GetNumEntries(uint32_t *aNumEntries) override { return _to GetNumEntries(aNumEntries); } \ |
183 | | NS_IMETHOD GetTypeOfIndex(uint32_t aIndex, int32_t *_retval) override { return _to GetTypeOfIndex(aIndex, _retval); } \ |
184 | | NS_IMETHOD GetInt32(uint32_t aIndex, int32_t *_retval) override { return _to GetInt32(aIndex, _retval); } \ |
185 | | NS_IMETHOD GetInt64(uint32_t aIndex, int64_t *_retval) override { return _to GetInt64(aIndex, _retval); } \ |
186 | | NS_IMETHOD GetDouble(uint32_t aIndex, double *_retval) override { return _to GetDouble(aIndex, _retval); } \ |
187 | | NS_IMETHOD GetUTF8String(uint32_t aIndex, nsACString& _retval) override { return _to GetUTF8String(aIndex, _retval); } \ |
188 | | NS_IMETHOD GetString(uint32_t aIndex, nsAString& _retval) override { return _to GetString(aIndex, _retval); } \ |
189 | | NS_IMETHOD GetBlob(uint32_t aIndex, uint32_t *aDataSize, uint8_t **aData) override { return _to GetBlob(aIndex, aDataSize, aData); } \ |
190 | | NS_IMETHOD GetBlobAsString(uint32_t aIndex, nsAString& _retval) override { return _to GetBlobAsString(aIndex, _retval); } \ |
191 | | NS_IMETHOD GetBlobAsUTF8String(uint32_t aIndex, nsACString& _retval) override { return _to GetBlobAsUTF8String(aIndex, _retval); } \ |
192 | | NS_IMETHOD GetIsNull(uint32_t aIndex, bool *_retval) override { return _to GetIsNull(aIndex, _retval); } \ |
193 | | NS_IMETHOD GetSharedUTF8String(uint32_t aIndex, uint32_t *aLength, const char * *aResult) override { return _to GetSharedUTF8String(aIndex, aLength, aResult); } \ |
194 | | NS_IMETHOD GetSharedString(uint32_t aIndex, uint32_t *aLength, const char16_t * *aResult) override { return _to GetSharedString(aIndex, aLength, aResult); } \ |
195 | | NS_IMETHOD GetSharedBlob(uint32_t aIndex, uint32_t *aLength, const uint8_t * * aResult) override { return _to GetSharedBlob(aIndex, aLength, aResult); } \ |
196 | | |
197 | | /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ |
198 | | #define NS_FORWARD_SAFE_MOZISTORAGEVALUEARRAY(_to) \ |
199 | | NS_IMETHOD GetNumEntries(uint32_t *aNumEntries) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetNumEntries(aNumEntries); } \ |
200 | | NS_IMETHOD GetTypeOfIndex(uint32_t aIndex, int32_t *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetTypeOfIndex(aIndex, _retval); } \ |
201 | | NS_IMETHOD GetInt32(uint32_t aIndex, int32_t *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetInt32(aIndex, _retval); } \ |
202 | | NS_IMETHOD GetInt64(uint32_t aIndex, int64_t *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetInt64(aIndex, _retval); } \ |
203 | | NS_IMETHOD GetDouble(uint32_t aIndex, double *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDouble(aIndex, _retval); } \ |
204 | | NS_IMETHOD GetUTF8String(uint32_t aIndex, nsACString& _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetUTF8String(aIndex, _retval); } \ |
205 | | NS_IMETHOD GetString(uint32_t aIndex, nsAString& _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetString(aIndex, _retval); } \ |
206 | | NS_IMETHOD GetBlob(uint32_t aIndex, uint32_t *aDataSize, uint8_t **aData) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetBlob(aIndex, aDataSize, aData); } \ |
207 | | NS_IMETHOD GetBlobAsString(uint32_t aIndex, nsAString& _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetBlobAsString(aIndex, _retval); } \ |
208 | | NS_IMETHOD GetBlobAsUTF8String(uint32_t aIndex, nsACString& _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetBlobAsUTF8String(aIndex, _retval); } \ |
209 | | NS_IMETHOD GetIsNull(uint32_t aIndex, bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsNull(aIndex, _retval); } \ |
210 | | NS_IMETHOD GetSharedUTF8String(uint32_t aIndex, uint32_t *aLength, const char * *aResult) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSharedUTF8String(aIndex, aLength, aResult); } \ |
211 | | NS_IMETHOD GetSharedString(uint32_t aIndex, uint32_t *aLength, const char16_t * *aResult) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSharedString(aIndex, aLength, aResult); } \ |
212 | | NS_IMETHOD GetSharedBlob(uint32_t aIndex, uint32_t *aLength, const uint8_t * * aResult) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSharedBlob(aIndex, aLength, aResult); } \ |
213 | | |
214 | | |
215 | | #endif /* __gen_mozIStorageValueArray_h__ */ |