1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim: sw=2 ts=2 sts=2 et
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include
"nsISupports.idl"
11 [ptr] native octetPtr
(uint8_t
);
13 [scriptable
, builtinclass
, uuid(2d09f42f
-966e-4663-b4b3
-b0c8676bf2bf
)]
14 interface mozIStorageBindingParams
: nsISupports
{
16 * Binds aValue to the parameter with the name aName.
19 * The name of the parameter to bind aValue to.
23 void bindByName
(in AUTF8String aName
,
24 in nsIVariant aValue
);
25 [noscript
] void bindUTF8StringByName
(in AUTF8String aName
,
26 in AUTF8String aValue
);
27 [noscript
] void bindStringByName
(in AUTF8String aName
,
29 [noscript
] void bindDoubleByName
(in AUTF8String aName
,
31 [noscript
] void bindInt32ByName
(in AUTF8String aName
,
33 [noscript
] void bindInt64ByName
(in AUTF8String aName
,
35 [noscript
] void bindNullByName
(in AUTF8String aName
);
37 // The noscript version of bindBlobByName can be used with any (const
38 // uint8_t*, length) pair. The scriptable version is meant for use with
39 // nsTArray<uint8_t>, which is what xpconnect has to work with.
40 [noscript
, binaryname
(BindBlobByName
)]
41 void bindBlobByNameNoscript
(in AUTF8String aName
,
42 [const] in octetPtr aValue
,
43 in unsigned long aValueSize
);
44 [binaryname
(BindBlobArrayByName
)]
45 void bindBlobByName
(in AUTF8String aName
, in Array
<octet
> aValue
);
47 // Convenience routines for storing strings as blobs.
48 void bindStringAsBlobByName
(in AUTF8String aName
, in AString aValue
);
49 void bindUTF8StringAsBlobByName
(in AUTF8String aName
, in AUTF8String aValue
);
51 // The function adopts the storage for the provided blob. After calling
52 // this function, mozStorage will ensure that free is called on the
53 // underlying pointer.
55 void bindAdoptedBlobByName
(in AUTF8String aName
,
57 in unsigned long aValueSize
);
60 * Binds aValue to the parameter with the index aIndex.
63 * The zero-based index of the parameter to bind aValue to.
67 void bindByIndex
(in unsigned long aIndex
,
68 in nsIVariant aValue
);
69 [noscript
] void bindUTF8StringByIndex
(in unsigned long aIndex
,
70 in AUTF8String aValue
);
71 [noscript
] void bindStringByIndex
(in unsigned long aIndex
,
73 [noscript
] void bindDoubleByIndex
(in unsigned long aIndex
,
75 [noscript
] void bindInt32ByIndex
(in unsigned long aIndex
,
77 [noscript
] void bindInt64ByIndex
(in unsigned long aIndex
,
79 [noscript
] void bindNullByIndex
(in unsigned long aIndex
);
81 // The noscript version of bindBlobByIndex can be used with any (const
82 // uint8_t*, length) pair. The scriptable version is meant for use with
83 // nsTArray<uint8_t>, which is what xpconnect has to work with.
84 [noscript
, binaryname
(BindBlobByIndex
)]
85 void bindBlobByIndexNoscript
(in unsigned long aIndex
,
86 [const] in octetPtr aValue
,
87 in unsigned long aValueSize
);
88 [binaryname
(BindBlobArrayByIndex
)]
89 void bindBlobByIndex
(in unsigned long aIndex
,
90 in Array
<octet
> aValue
);
92 // Convenience routines for storing strings as blobs.
93 void bindStringAsBlobByIndex
(in unsigned long aIndex
, in AString aValue
);
94 void bindUTF8StringAsBlobByIndex
(in unsigned long aIndex
, in AUTF8String aValue
);
96 // The function adopts the storage for the provided blob. After calling
97 // this function, mozStorage will ensure that free is called on the
98 // underlying pointer.
100 void bindAdoptedBlobByIndex
(in unsigned long aIndex
,
102 in unsigned long aValueSize
);