Back to index

lightning-sunbird  0.9+nobinonly
mozStorageStatementWrapper.cpp
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is Oracle Corporation code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  *  Oracle Corporation
00019  * Portions created by the Initial Developer are Copyright (C) 2004
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *   Vladimir Vukicevic <vladimir.vukicevic@oracle.com>
00024  *
00025  * Alternatively, the contents of this file may be used under the terms of
00026  * either the GNU General Public License Version 2 or later (the "GPL"), or
00027  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00028  * in which case the provisions of the GPL or the LGPL are applicable instead
00029  * of those above. If you wish to allow use of your version of this file only
00030  * under the terms of either the GPL or the LGPL, and not to allow others to
00031  * use your version of this file under the terms of the MPL, indicate your
00032  * decision by deleting the provisions above and replace them with the notice
00033  * and other provisions required by the GPL or the LGPL. If you do not delete
00034  * the provisions above, a recipient may use your version of this file under
00035  * the terms of any one of the MPL, the GPL or the LGPL.
00036  *
00037  * ***** END LICENSE BLOCK ***** */
00038 
00039 #include "nsMemory.h"
00040 #include "nsString.h"
00041 
00042 #include "mozStorageStatementWrapper.h"
00043 
00044 #include "jsapi.h"
00045 #include "jsdate.h"
00046 
00047 #include "sqlite3.h"
00048 
00052 class mozStorageStatementRow : public mozIStorageStatementRow,
00053                                public nsIXPCScriptable
00054 {
00055 public:
00056     mozStorageStatementRow(mozIStorageStatement *aStatement,
00057                            int aNumColumns,
00058                            const nsStringArray *aColumnNames);
00059 
00060     // nsISupports interface
00061     NS_DECL_ISUPPORTS
00062 
00063     // mozIStorageStatementRow interface (empty)
00064     NS_DECL_MOZISTORAGESTATEMENTROW
00065 
00066     // nsIXPCScriptable interface
00067     NS_DECL_NSIXPCSCRIPTABLE
00068 protected:
00069     sqlite3_stmt* NativeStatement() {
00070         return mStatement->GetNativeStatementPointer();
00071     }
00072 
00073     nsCOMPtr<mozIStorageStatement> mStatement;
00074     int mNumColumns;
00075     const nsStringArray *mColumnNames;
00076 };
00077 
00081 class mozStorageStatementParams : public mozIStorageStatementParams,
00082                                   public nsIXPCScriptable
00083 {
00084 public:
00085     mozStorageStatementParams(mozIStorageStatement *aStatement);
00086 
00087     // interfaces
00088     NS_DECL_ISUPPORTS
00089     NS_DECL_MOZISTORAGESTATEMENTPARAMS
00090     NS_DECL_NSIXPCSCRIPTABLE
00091 
00092 protected:
00093     nsCOMPtr<mozIStorageStatement> mStatement;
00094     PRUint32 mParamCount;
00095 };
00096 
00097 static PRBool
00098 JSValStorageStatementBinder (JSContext *cx,
00099                              mozIStorageStatement *aStatement,
00100                              int *aParamIndexes,
00101                              int aNumIndexes,
00102                              jsval val)
00103 {
00104     int i;
00105     if (JSVAL_IS_INT(val)) {
00106         int v = JSVAL_TO_INT(val);
00107         for (i = 0; i < aNumIndexes; i++)
00108             aStatement->BindInt32Parameter(aParamIndexes[i], v);
00109     } else if (JSVAL_IS_DOUBLE(val)) {
00110         double d = *JSVAL_TO_DOUBLE(val);
00111         for (i = 0; i < aNumIndexes; i++)
00112             aStatement->BindDoubleParameter(aParamIndexes[i], d);
00113     } else if (JSVAL_IS_STRING(val)) {
00114         JSString *str = JSVAL_TO_STRING(val);
00115         for (i = 0; i < aNumIndexes; i++)
00116             aStatement->BindStringParameter(aParamIndexes[i], nsDependentString(NS_REINTERPRET_CAST(PRUnichar*, JS_GetStringChars(str)), JS_GetStringLength(str)));
00117     } else if (JSVAL_IS_BOOLEAN(val)) {
00118         if (val == JSVAL_TRUE) {
00119             for (i = 0; i < aNumIndexes; i++)
00120                 aStatement->BindInt32Parameter(aParamIndexes[i], 1);
00121         } else {
00122             for (i = 0; i < aNumIndexes; i++)
00123                 aStatement->BindInt32Parameter(aParamIndexes[i], 0);
00124         }
00125     } else if (JSVAL_IS_NULL(val)) {
00126         for (i = 0; i < aNumIndexes; i++)
00127             aStatement->BindNullParameter(aParamIndexes[i]);
00128     } else if (JSVAL_IS_OBJECT(val)) {
00129         JSObject *obj = JSVAL_TO_OBJECT(val);
00130         // some special things
00131         if (js_DateIsValid (cx, obj)) {
00132             double msecd = js_DateGetMsecSinceEpoch(cx, obj);
00133             msecd *= 1000.0;
00134             PRInt64 msec;
00135             LL_D2L(msec, msecd);
00136 
00137             for (i = 0; i < aNumIndexes; i++)
00138                 aStatement->BindInt64Parameter(aParamIndexes[i], msec);
00139         } else {
00140             return PR_FALSE;
00141         }
00142     } else {
00143         return PR_FALSE;
00144     }
00145 
00146     return PR_TRUE;
00147 }
00148 
00149 
00150 /*************************************************************************
00151  ****
00152  **** mozStorageStatementWrapper
00153  ****
00154  *************************************************************************/
00155 
00156 NS_IMPL_ISUPPORTS2(mozStorageStatementWrapper, mozIStorageStatementWrapper, nsIXPCScriptable)
00157 
00158 mozStorageStatementWrapper::mozStorageStatementWrapper()
00159     : mStatement(nsnull)
00160 {
00161 }
00162 
00163 mozStorageStatementWrapper::~mozStorageStatementWrapper()
00164 {
00165     mStatement = nsnull;
00166 }
00167 
00168 NS_IMETHODIMP
00169 mozStorageStatementWrapper::Initialize(mozIStorageStatement *aStatement)
00170 {
00171     NS_ASSERTION(mStatement == nsnull, "mozStorageStatementWrapper is already initialized");
00172     NS_ENSURE_ARG_POINTER(aStatement);
00173 
00174     mStatement = aStatement;
00175 
00176     // fetch various things we care about
00177     mStatement->GetParameterCount(&mParamCount);
00178     mStatement->GetColumnCount(&mResultColumnCount);
00179 
00180     for (unsigned int i = 0; i < mResultColumnCount; i++) {
00181         const void *name = sqlite3_column_name16 (NativeStatement(), i);
00182         mColumnNames.AppendString(nsDependentString(NS_STATIC_CAST(const PRUnichar*, name)));
00183     }
00184 
00185     return NS_OK;
00186 }
00187 
00188 NS_IMETHODIMP
00189 mozStorageStatementWrapper::GetStatement(mozIStorageStatement **aStatement)
00190 {
00191     NS_IF_ADDREF(*aStatement = mStatement);
00192     return NS_OK;
00193 }
00194 
00195 NS_IMETHODIMP
00196 mozStorageStatementWrapper::Reset()
00197 {
00198     if (!mStatement)
00199         return NS_ERROR_FAILURE;
00200 
00201     return mStatement->Reset();
00202 }
00203 
00204 NS_IMETHODIMP
00205 mozStorageStatementWrapper::Step(PRBool *_retval)
00206 {
00207     if (!mStatement)
00208         return NS_ERROR_FAILURE;
00209 
00210     PRBool hasMore = PR_FALSE;
00211     nsresult rv = mStatement->ExecuteStep(&hasMore);
00212     if (NS_SUCCEEDED(rv) && !hasMore) {
00213         *_retval = PR_FALSE;
00214         mStatement->Reset();
00215         return NS_OK;
00216     }
00217 
00218     *_retval = hasMore;
00219     return rv;
00220 }
00221 
00222 NS_IMETHODIMP
00223 mozStorageStatementWrapper::Execute()
00224 {
00225     if (!mStatement)
00226         return NS_ERROR_FAILURE;
00227 
00228     return mStatement->Execute();
00229 }
00230 
00231 NS_IMETHODIMP
00232 mozStorageStatementWrapper::GetRow(mozIStorageStatementRow **aRow)
00233 {
00234     NS_ENSURE_ARG_POINTER(aRow);
00235 
00236     if (!mStatement)
00237         return NS_ERROR_FAILURE;
00238 
00239     PRInt32 state;
00240     mStatement->GetState(&state);
00241     if (state != mozIStorageStatement::MOZ_STORAGE_STATEMENT_EXECUTING)
00242         return NS_ERROR_FAILURE;
00243 
00244     if (!mStatementRow) {
00245         mozStorageStatementRow *row = new mozStorageStatementRow(mStatement, mResultColumnCount, &mColumnNames);
00246         if (!row)
00247             return NS_ERROR_OUT_OF_MEMORY;
00248         mStatementRow = row;
00249     }
00250 
00251     NS_ADDREF(*aRow = mStatementRow);
00252     return NS_OK;
00253 }
00254 
00255 NS_IMETHODIMP
00256 mozStorageStatementWrapper::GetParams(mozIStorageStatementParams **aParams)
00257 {
00258     NS_ENSURE_ARG_POINTER(aParams);
00259 
00260     if (!mStatementParams) {
00261         mozStorageStatementParams *params = new mozStorageStatementParams(mStatement);
00262         if (!params)
00263             return NS_ERROR_OUT_OF_MEMORY;
00264         mStatementParams = params;
00265     }
00266 
00267     NS_ADDREF(*aParams = mStatementParams);
00268     return NS_OK;
00269 }
00270 
00271 /*** nsIXPCScriptable interface ***/
00272 
00273 /* readonly attribute string className; */
00274 NS_IMETHODIMP
00275 mozStorageStatementWrapper::GetClassName(char * *aClassName)
00276 {
00277     NS_ENSURE_ARG_POINTER(aClassName);
00278     *aClassName = (char *) nsMemory::Clone("mozStorageStatementWrapper", 27);
00279     if (!*aClassName)
00280         return NS_ERROR_OUT_OF_MEMORY;
00281     return NS_OK;
00282 }
00283 
00284 /* readonly attribute PRUint32 scriptableFlags; */
00285 NS_IMETHODIMP
00286 mozStorageStatementWrapper::GetScriptableFlags(PRUint32 *aScriptableFlags)
00287 {
00288     *aScriptableFlags =
00289         nsIXPCScriptable::WANT_CALL |
00290         nsIXPCScriptable::USE_JSSTUB_FOR_SETPROPERTY |
00291         nsIXPCScriptable::WANT_NEWRESOLVE |
00292         nsIXPCScriptable::ALLOW_PROP_MODS_DURING_RESOLVE;
00293     return NS_OK;
00294 }
00295 
00296 /* PRBool call (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in PRUint32 argc, in JSValPtr argv, in JSValPtr vp); */
00297 NS_IMETHODIMP
00298 mozStorageStatementWrapper::Call(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00299                           JSObject * obj, PRUint32 argc, jsval * argv, jsval * vp, PRBool *_retval)
00300 {
00301     if (!mStatement) {
00302         *_retval = PR_TRUE;
00303         return NS_ERROR_FAILURE;
00304     }
00305 
00306     if (argc != mParamCount) {
00307         *_retval = PR_FALSE;
00308         return NS_ERROR_FAILURE;
00309     }
00310 
00311     // reset
00312     mStatement->Reset();
00313 
00314     // bind parameters
00315     for (int i = 0; i < (int) argc; i++) {
00316         if (!JSValStorageStatementBinder(cx, mStatement, &i, 1, argv[i])) {
00317             *_retval = PR_FALSE;
00318             return NS_ERROR_INVALID_ARG;
00319         }
00320     }
00321 
00322     // if there are no results, we just execute
00323     if (mResultColumnCount == 0)
00324         mStatement->Execute();
00325 
00326     *vp = JSVAL_TRUE;
00327     *_retval = PR_TRUE;
00328     return NS_OK;
00329 }
00330 
00331 /* PRBool getProperty (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in JSVal id, in JSValPtr vp); */
00332 NS_IMETHODIMP
00333 mozStorageStatementWrapper::GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00334                                  JSObject * obj, jsval id, jsval * vp, PRBool *_retval)
00335 {
00336     *_retval = PR_FALSE;
00337     return NS_OK;
00338 }
00339 
00340 
00341 /* PRBool setProperty (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in JSVal id, in JSValPtr vp); */
00342 NS_IMETHODIMP
00343 mozStorageStatementWrapper::SetProperty(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00344                          JSObject * obj, jsval id, jsval * vp, PRBool *_retval)
00345 {
00346     *_retval = PR_FALSE;
00347     return NS_OK;
00348 }
00349 
00350 /* void preCreate (in nsISupports nativeObj, in JSContextPtr cx, in JSObjectPtr globalObj, out JSObjectPtr parentObj); */
00351 NS_IMETHODIMP
00352 mozStorageStatementWrapper::PreCreate(nsISupports *nativeObj, JSContext * cx,
00353                        JSObject * globalObj, JSObject * *parentObj)
00354 {
00355     return NS_ERROR_NOT_IMPLEMENTED;
00356 }
00357 
00358 /* void create (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj); */
00359 NS_IMETHODIMP
00360 mozStorageStatementWrapper::Create(nsIXPConnectWrappedNative *wrapper, JSContext * cx, JSObject * obj)
00361 {
00362     return NS_ERROR_NOT_IMPLEMENTED;
00363 }
00364 
00365 /* void postCreate (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj); */
00366 NS_IMETHODIMP
00367 mozStorageStatementWrapper::PostCreate(nsIXPConnectWrappedNative *wrapper, JSContext * cx, JSObject * obj)
00368 {
00369     return NS_ERROR_NOT_IMPLEMENTED;
00370 }
00371 
00372 /* PRBool addProperty (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in JSVal id, in JSValPtr vp); */
00373 NS_IMETHODIMP
00374 mozStorageStatementWrapper::AddProperty(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00375                                  JSObject * obj, jsval id, jsval * vp, PRBool *_retval)
00376 {
00377     return NS_ERROR_NOT_IMPLEMENTED;
00378 }
00379 
00380 /* PRBool delProperty (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in JSVal id, in JSValPtr vp); */
00381 NS_IMETHODIMP
00382 mozStorageStatementWrapper::DelProperty(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00383                                  JSObject * obj, jsval id, jsval * vp, PRBool *_retval)
00384 {
00385     return NS_ERROR_NOT_IMPLEMENTED;
00386 }
00387 
00388 /* PRBool enumerate (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj); */
00389 NS_IMETHODIMP
00390 mozStorageStatementWrapper::Enumerate(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00391                                JSObject * obj, PRBool *_retval)
00392 {
00393     return NS_ERROR_NOT_IMPLEMENTED;
00394 }
00395 
00396 /* PRBool newEnumerate (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in PRUint32 enum_op, in JSValPtr statep, out JSID idp); */
00397 NS_IMETHODIMP
00398 mozStorageStatementWrapper::NewEnumerate(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00399                                   JSObject * obj, PRUint32 enum_op, jsval * statep, jsid *idp, PRBool *_retval)
00400 {
00401     return NS_ERROR_NOT_IMPLEMENTED;
00402 }
00403 
00404 /* PRBool newResolve (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in JSVal id, in PRUint32 flags, out JSObjectPtr objp); */
00405 NS_IMETHODIMP
00406 mozStorageStatementWrapper::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00407                                 JSObject * obj, jsval id, PRUint32 flags, JSObject * *objp, PRBool *_retval)
00408 {
00409     *_retval = PR_TRUE;
00410     return NS_OK;
00411 }
00412 
00413 /* PRBool convert (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in PRUint32 type, in JSValPtr vp); */
00414 NS_IMETHODIMP
00415 mozStorageStatementWrapper::Convert(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00416                                 JSObject * obj, PRUint32 type, jsval * vp, PRBool *_retval)
00417 {
00418     return NS_ERROR_NOT_IMPLEMENTED;
00419 }
00420 
00421 /* void finalize (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj); */
00422 NS_IMETHODIMP
00423 mozStorageStatementWrapper::Finalize(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00424                               JSObject * obj)
00425 {
00426     return NS_ERROR_NOT_IMPLEMENTED;
00427 }
00428 
00429 /* PRBool checkAccess (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in JSVal id, in PRUint32 mode, in JSValPtr vp); */
00430 NS_IMETHODIMP
00431 mozStorageStatementWrapper::CheckAccess(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00432                                  JSObject * obj, jsval id, PRUint32 mode, jsval * vp, PRBool *_retval)
00433 {
00434     return NS_ERROR_NOT_IMPLEMENTED;
00435 }
00436 
00437 /* PRBool construct (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in PRUint32 argc, in JSValPtr argv, in JSValPtr vp); */
00438 NS_IMETHODIMP
00439 mozStorageStatementWrapper::Construct(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00440                                JSObject * obj, PRUint32 argc, jsval * argv, jsval * vp, PRBool *_retval)
00441 {
00442     return NS_ERROR_NOT_IMPLEMENTED;
00443 }
00444 
00445 /* PRBool hasInstance (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in JSVal val, out PRBool bp); */
00446 NS_IMETHODIMP
00447 mozStorageStatementWrapper::HasInstance(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00448                                  JSObject * obj, jsval val, PRBool *bp, PRBool *_retval)
00449 {
00450     return NS_ERROR_NOT_IMPLEMENTED;
00451 }
00452 
00453 /* PRUint32 mark (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in voidPtr arg); */
00454 NS_IMETHODIMP
00455 mozStorageStatementWrapper::Mark(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00456                           JSObject * obj, void * arg, PRUint32 *_retval)
00457 {
00458     return NS_ERROR_NOT_IMPLEMENTED;
00459 }
00460 
00461 /* PRBool equality(in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in JSVal val); */
00462 NS_IMETHODIMP
00463 mozStorageStatementWrapper::Equality(nsIXPConnectWrappedNative *wrapper,
00464                                     JSContext *cx, JSObject *obj, jsval val,
00465                                     PRBool *_retval)
00466 {
00467     return NS_ERROR_NOT_IMPLEMENTED;
00468 }
00469 
00470 /* JSObjectPtr outerObject(in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj); */
00471 NS_IMETHODIMP
00472 mozStorageStatementWrapper::OuterObject(nsIXPConnectWrappedNative *wrapper,
00473                                         JSContext *cx, JSObject *obj,
00474                                         JSObject **_retval)
00475 {
00476     return NS_ERROR_NOT_IMPLEMENTED;
00477 }
00478 
00479 /* JSObjectPtr innerObject(in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj); */
00480 NS_IMETHODIMP
00481 mozStorageStatementWrapper::InnerObject(nsIXPConnectWrappedNative *wrapper,
00482                                         JSContext *cx, JSObject *obj,
00483                                         JSObject **_retval)
00484 {
00485     return NS_ERROR_NOT_IMPLEMENTED;
00486 }
00487 
00488 /*************************************************************************
00489  ****
00490  **** mozStorageStatementRow
00491  ****
00492  *************************************************************************/
00493 
00494 NS_IMPL_ISUPPORTS2(mozStorageStatementRow, mozIStorageStatementRow, nsIXPCScriptable)
00495 
00496 mozStorageStatementRow::mozStorageStatementRow(mozIStorageStatement *aStatement,
00497                                                int aNumColumns,
00498                                                const nsStringArray *aColumnNames)
00499     : mStatement(aStatement),
00500       mNumColumns(aNumColumns),
00501       mColumnNames(aColumnNames)
00502 {
00503 }
00504 
00505 /*
00506  * nsIXPCScriptable impl
00507  */
00508 
00509 /* readonly attribute string className; */
00510 NS_IMETHODIMP
00511 mozStorageStatementRow::GetClassName(char * *aClassName)
00512 {
00513     NS_ENSURE_ARG_POINTER(aClassName);
00514     *aClassName = (char *) nsMemory::Clone("mozStorageStatementRow", 23);
00515     if (!*aClassName)
00516         return NS_ERROR_OUT_OF_MEMORY;
00517     return NS_OK;
00518 }
00519 
00520 /* readonly attribute PRUint32 scriptableFlags; */
00521 NS_IMETHODIMP
00522 mozStorageStatementRow::GetScriptableFlags(PRUint32 *aScriptableFlags)
00523 {
00524     *aScriptableFlags =
00525         nsIXPCScriptable::WANT_GETPROPERTY |
00526         nsIXPCScriptable::WANT_NEWRESOLVE |
00527         nsIXPCScriptable::ALLOW_PROP_MODS_DURING_RESOLVE;
00528     return NS_OK;
00529 }
00530 
00531 /* PRBool getProperty (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in JSVal id, in JSValPtr vp); */
00532 NS_IMETHODIMP
00533 mozStorageStatementRow::GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00534                          JSObject * obj, jsval id, jsval * vp, PRBool *_retval)
00535 {
00536     *_retval = PR_FALSE;
00537 
00538     if (JSVAL_IS_STRING(id)) {
00539         nsDependentString jsid((PRUnichar *)::JS_GetStringChars(JSVAL_TO_STRING(id)),
00540                                ::JS_GetStringLength(JSVAL_TO_STRING(id)));
00541 
00542         for (int i = 0; i < mNumColumns; i++) {
00543             if (jsid.Equals(*(*mColumnNames)[i])) {
00544                 int ctype = sqlite3_column_type(NativeStatement(), i);
00545 
00546                 if (ctype == SQLITE_INTEGER || ctype == SQLITE_FLOAT) {
00547                     double dval = sqlite3_column_double(NativeStatement(), i);
00548                     if (!JS_NewNumberValue(cx, dval, vp)) {
00549                         *_retval = PR_FALSE;
00550                         return NS_ERROR_OUT_OF_MEMORY;
00551                     }
00552                 } else if (ctype == SQLITE_TEXT) {
00553                     JSString *str = JS_NewUCStringCopyN(cx,
00554                                                         (jschar*) sqlite3_column_text16(NativeStatement(), i),
00555                                                         sqlite3_column_bytes16(NativeStatement(), i)/2);
00556                     if (!str) {
00557                         *_retval = PR_FALSE;
00558                         return NS_ERROR_OUT_OF_MEMORY;
00559                     }
00560                     *vp = STRING_TO_JSVAL(str);
00561                 } else if (ctype == SQLITE_BLOB) {
00562                     JSString *str = JS_NewStringCopyN(cx,
00563                                                       (char*) sqlite3_column_blob(NativeStatement(), i),
00564                                                       sqlite3_column_bytes(NativeStatement(), i));
00565                     if (!str) {
00566                         *_retval = PR_FALSE;
00567                         return NS_ERROR_OUT_OF_MEMORY;
00568                     }
00569                 } else if (ctype == SQLITE_NULL) {
00570                     *vp = JSVAL_NULL;
00571                 } else {
00572                     NS_ERROR("sqlite3_column_type returned unknown column type, what's going on?");
00573                 }
00574 
00575                 *_retval = PR_TRUE;
00576                 break;
00577             }
00578         }
00579     }
00580 
00581     return NS_OK;
00582 }
00583 
00584 
00585 /* PRBool setProperty (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in JSVal id, in JSValPtr vp); */
00586 NS_IMETHODIMP
00587 mozStorageStatementRow::SetProperty(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00588                          JSObject * obj, jsval id, jsval * vp, PRBool *_retval)
00589 {
00590     return NS_ERROR_NOT_IMPLEMENTED;
00591 }
00592 
00593 /* void preCreate (in nsISupports nativeObj, in JSContextPtr cx, in JSObjectPtr globalObj, out JSObjectPtr parentObj); */
00594 NS_IMETHODIMP
00595 mozStorageStatementRow::PreCreate(nsISupports *nativeObj, JSContext * cx,
00596                        JSObject * globalObj, JSObject * *parentObj)
00597 {
00598     return NS_ERROR_NOT_IMPLEMENTED;
00599 }
00600 
00601 /* void create (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj); */
00602 NS_IMETHODIMP
00603 mozStorageStatementRow::Create(nsIXPConnectWrappedNative *wrapper, JSContext * cx, JSObject * obj)
00604 {
00605     return NS_ERROR_NOT_IMPLEMENTED;
00606 }
00607 
00608 /* void postCreate (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj); */
00609 NS_IMETHODIMP
00610 mozStorageStatementRow::PostCreate(nsIXPConnectWrappedNative *wrapper, JSContext * cx, JSObject * obj)
00611 {
00612     return NS_ERROR_NOT_IMPLEMENTED;
00613 }
00614 
00615 /* PRBool addProperty (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in JSVal id, in JSValPtr vp); */
00616 NS_IMETHODIMP
00617 mozStorageStatementRow::AddProperty(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00618                                     JSObject * obj, jsval id, jsval * vp, PRBool *_retval)
00619 {
00620     return NS_ERROR_NOT_IMPLEMENTED;
00621 }
00622 
00623 /* PRBool delProperty (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in JSVal id, in JSValPtr vp); */
00624 NS_IMETHODIMP
00625 mozStorageStatementRow::DelProperty(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00626                                     JSObject * obj, jsval id, jsval * vp, PRBool *_retval)
00627 {
00628     return NS_ERROR_NOT_IMPLEMENTED;
00629 }
00630 
00631 /* PRBool enumerate (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj); */
00632 NS_IMETHODIMP
00633 mozStorageStatementRow::Enumerate(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00634                                   JSObject * obj, PRBool *_retval)
00635 {
00636     return NS_ERROR_NOT_IMPLEMENTED;
00637 }
00638 
00639 /* PRBool newEnumerate (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in PRUint32 enum_op, in JSValPtr statep, out JSID idp); */
00640 NS_IMETHODIMP
00641 mozStorageStatementRow::NewEnumerate(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00642                                      JSObject * obj, PRUint32 enum_op, jsval * statep, jsid *idp, PRBool *_retval)
00643 {
00644     return NS_ERROR_NOT_IMPLEMENTED;
00645 }
00646 
00647 /* PRBool newResolve (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in JSVal id, in PRUint32 flags, out JSObjectPtr objp); */
00648 NS_IMETHODIMP
00649 mozStorageStatementRow::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00650                                    JSObject * obj, jsval id, PRUint32 flags, JSObject * *objp, PRBool *_retval)
00651 {
00652     if (JSVAL_IS_STRING(id)) {
00653         JSString *str = JSVAL_TO_STRING(id);
00654         nsDependentString name((PRUnichar *)::JS_GetStringChars(str),
00655                                ::JS_GetStringLength(str));
00656 
00657         for (int i = 0; i < mNumColumns; i++) {
00658             if (name.Equals(*(*mColumnNames)[i])) {
00659                 *_retval = ::JS_DefineUCProperty(cx, obj, ::JS_GetStringChars(str),
00660                                                  ::JS_GetStringLength(str),
00661                                                  JSVAL_VOID,
00662                                                  nsnull, nsnull, 0);
00663                 *objp = obj;
00664                 return *_retval ? NS_OK : NS_ERROR_FAILURE;
00665             }
00666         }
00667     }
00668                 
00669     *_retval = PR_TRUE;
00670     return NS_OK;
00671 }
00672 
00673 /* PRBool convert (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in PRUint32 type, in JSValPtr vp); */
00674 NS_IMETHODIMP
00675 mozStorageStatementRow::Convert(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00676                                 JSObject * obj, PRUint32 type, jsval * vp, PRBool *_retval)
00677 {
00678     return NS_ERROR_NOT_IMPLEMENTED;
00679 }
00680 
00681 /* void finalize (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj); */
00682 NS_IMETHODIMP
00683 mozStorageStatementRow::Finalize(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00684                                  JSObject * obj)
00685 {
00686     return NS_ERROR_NOT_IMPLEMENTED;
00687 }
00688 
00689 /* PRBool checkAccess (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in JSVal id, in PRUint32 mode, in JSValPtr vp); */
00690 NS_IMETHODIMP
00691 mozStorageStatementRow::CheckAccess(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00692                                     JSObject * obj, jsval id, PRUint32 mode, jsval * vp, PRBool *_retval)
00693 {
00694     return NS_ERROR_NOT_IMPLEMENTED;
00695 }
00696 
00697 /* PRBool call (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in PRUint32 argc, in JSValPtr argv, in JSValPtr vp); */
00698 NS_IMETHODIMP
00699 mozStorageStatementRow::Call(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00700                              JSObject * obj, PRUint32 argc, jsval * argv, jsval * vp, PRBool *_retval)
00701 {
00702     return NS_ERROR_NOT_IMPLEMENTED;
00703 }
00704 
00705 /* PRBool construct (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in PRUint32 argc, in JSValPtr argv, in JSValPtr vp); */
00706 NS_IMETHODIMP
00707 mozStorageStatementRow::Construct(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00708                                   JSObject * obj, PRUint32 argc, jsval * argv, jsval * vp, PRBool *_retval)
00709 {
00710     return NS_ERROR_NOT_IMPLEMENTED;
00711 }
00712 
00713 /* PRBool hasInstance (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in JSVal val, out PRBool bp); */
00714 NS_IMETHODIMP
00715 mozStorageStatementRow::HasInstance(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00716                                     JSObject * obj, jsval val, PRBool *bp, PRBool *_retval)
00717 {
00718     return NS_ERROR_NOT_IMPLEMENTED;
00719 }
00720 
00721 /* PRUint32 mark (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in voidPtr arg); */
00722 NS_IMETHODIMP
00723 mozStorageStatementRow::Mark(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00724                              JSObject * obj, void * arg, PRUint32 *_retval)
00725 {
00726     return NS_ERROR_NOT_IMPLEMENTED;
00727 }
00728 
00729 /* PRBool equality(in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in JSVal val); */
00730 NS_IMETHODIMP
00731 mozStorageStatementRow::Equality(nsIXPConnectWrappedNative *wrapper,
00732                                  JSContext *cx, JSObject *obj, jsval val,
00733                                  PRBool *_retval)
00734 {
00735     return NS_ERROR_NOT_IMPLEMENTED;
00736 }
00737 
00738 /* JSObjectPtr outerObject(in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj); */
00739 NS_IMETHODIMP
00740 mozStorageStatementRow::OuterObject(nsIXPConnectWrappedNative *wrapper,
00741                                     JSContext *cx, JSObject *obj,
00742                                     JSObject **_retval)
00743 {
00744     return NS_ERROR_NOT_IMPLEMENTED;
00745 }
00746 
00747 /* JSObjectPtr innerObject(in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj); */
00748 NS_IMETHODIMP
00749 mozStorageStatementRow::InnerObject(nsIXPConnectWrappedNative *wrapper,
00750                                     JSContext *cx, JSObject *obj,
00751                                     JSObject **_retval)
00752 {
00753     return NS_ERROR_NOT_IMPLEMENTED;
00754 }
00755 
00756 /*************************************************************************
00757  ****
00758  **** mozStorageStatementParams
00759  ****
00760  *************************************************************************/
00761 
00762 NS_IMPL_ISUPPORTS2(mozStorageStatementParams, mozIStorageStatementParams, nsIXPCScriptable)
00763 
00764 mozStorageStatementParams::mozStorageStatementParams(mozIStorageStatement *aStatement)
00765     : mStatement(aStatement)
00766 {
00767     NS_ASSERTION(mStatement != nsnull, "mStatement is null");
00768     mStatement->GetParameterCount(&mParamCount);
00769 }
00770 
00771 /*
00772  * nsIXPCScriptable impl
00773  */
00774 
00775 /* readonly attribute string className; */
00776 NS_IMETHODIMP
00777 mozStorageStatementParams::GetClassName(char * *aClassName)
00778 {
00779     NS_ENSURE_ARG_POINTER(aClassName);
00780     *aClassName = (char *) nsMemory::Clone("mozStorageStatementParams", 26);
00781     if (!*aClassName)
00782         return NS_ERROR_OUT_OF_MEMORY;
00783     return NS_OK;
00784 }
00785 
00786 /* readonly attribute PRUint32 scriptableFlags; */
00787 NS_IMETHODIMP
00788 mozStorageStatementParams::GetScriptableFlags(PRUint32 *aScriptableFlags)
00789 {
00790     *aScriptableFlags =
00791         nsIXPCScriptable::WANT_SETPROPERTY |
00792         nsIXPCScriptable::WANT_NEWRESOLVE |
00793         nsIXPCScriptable::ALLOW_PROP_MODS_DURING_RESOLVE;
00794     return NS_OK;
00795 }
00796 
00797 /* PRBool getProperty (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in JSVal id, in JSValPtr vp); */
00798 NS_IMETHODIMP
00799 mozStorageStatementParams::GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00800                          JSObject * obj, jsval id, jsval * vp, PRBool *_retval)
00801 {
00802     return NS_ERROR_NOT_IMPLEMENTED;
00803 }
00804 
00805 
00806 /* PRBool setProperty (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in JSVal id, in JSValPtr vp); */
00807 NS_IMETHODIMP
00808 mozStorageStatementParams::SetProperty(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00809                          JSObject * obj, jsval id, jsval * vp, PRBool *_retval)
00810 {
00811     if (JSVAL_IS_INT(id)) {
00812         int idx = JSVAL_TO_INT(id);
00813 
00814         *_retval = JSValStorageStatementBinder (cx, mStatement, &idx, 1, *vp);
00815     } else if (JSVAL_IS_STRING(id)) {
00816         int indexCount = 0, *indexes;
00817 
00818         JSString *str = JSVAL_TO_STRING(id);
00819         nsCAutoString name(":");
00820         name.Append(NS_ConvertUTF16toUTF8(nsDependentString((PRUnichar *)::JS_GetStringChars(str),
00821                                                             ::JS_GetStringLength(str))));
00822 
00823         // check to see if there's a parameter with this name
00824         indexCount = sqlite3_bind_parameter_indexes(mStatement->GetNativeStatementPointer(), name.get(), &indexes);
00825         if (indexCount == 0) {
00826             // er, not found? How'd we get past NewResolve?
00827             fprintf (stderr, "********** mozStorageStatementWrapper: Couldn't find parameter %s\n", name.get());
00828             *_retval = PR_FALSE;
00829             return NS_ERROR_FAILURE;
00830         } else {
00831             // drop this by 1, to account for sqlite's indexes being 1-based
00832             for (int i = 0; i < indexCount; i++)
00833                 indexes[i]--;
00834 
00835             *_retval = JSValStorageStatementBinder (cx, mStatement, indexes, indexCount, *vp);
00836             sqlite3_free_parameter_indexes(indexes);
00837         }
00838     } else {
00839         *_retval = PR_FALSE;
00840     }
00841 
00842     if (*_retval)
00843         return NS_OK;
00844     else
00845         return NS_ERROR_INVALID_ARG;
00846 }
00847 
00848 /* void preCreate (in nsISupports nativeObj, in JSContextPtr cx, in JSObjectPtr globalObj, out JSObjectPtr parentObj); */
00849 NS_IMETHODIMP
00850 mozStorageStatementParams::PreCreate(nsISupports *nativeObj, JSContext * cx,
00851                        JSObject * globalObj, JSObject * *parentObj)
00852 {
00853     return NS_ERROR_NOT_IMPLEMENTED;
00854 }
00855 
00856 /* void create (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj); */
00857 NS_IMETHODIMP
00858 mozStorageStatementParams::Create(nsIXPConnectWrappedNative *wrapper, JSContext * cx, JSObject * obj)
00859 {
00860     return NS_ERROR_NOT_IMPLEMENTED;
00861 }
00862 
00863 /* void postCreate (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj); */
00864 NS_IMETHODIMP
00865 mozStorageStatementParams::PostCreate(nsIXPConnectWrappedNative *wrapper, JSContext * cx, JSObject * obj)
00866 {
00867     return NS_ERROR_NOT_IMPLEMENTED;
00868 }
00869 
00870 /* PRBool addProperty (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in JSVal id, in JSValPtr vp); */
00871 NS_IMETHODIMP
00872 mozStorageStatementParams::AddProperty(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00873                                     JSObject * obj, jsval id, jsval * vp, PRBool *_retval)
00874 {
00875     return NS_ERROR_NOT_IMPLEMENTED;
00876 }
00877 
00878 /* PRBool delProperty (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in JSVal id, in JSValPtr vp); */
00879 NS_IMETHODIMP
00880 mozStorageStatementParams::DelProperty(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00881                                     JSObject * obj, jsval id, jsval * vp, PRBool *_retval)
00882 {
00883     return NS_ERROR_NOT_IMPLEMENTED;
00884 }
00885 
00886 /* PRBool enumerate (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj); */
00887 NS_IMETHODIMP
00888 mozStorageStatementParams::Enumerate(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00889                                   JSObject * obj, PRBool *_retval)
00890 {
00891     return NS_ERROR_NOT_IMPLEMENTED;
00892 }
00893 
00894 /* PRBool newEnumerate (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in PRUint32 enum_op, in JSValPtr statep, out JSID idp); */
00895 NS_IMETHODIMP
00896 mozStorageStatementParams::NewEnumerate(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00897                                      JSObject * obj, PRUint32 enum_op, jsval * statep, jsid *idp, PRBool *_retval)
00898 {
00899     return NS_ERROR_NOT_IMPLEMENTED;
00900 }
00901 
00902 /* PRBool newResolve (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in JSVal id, in PRUint32 flags, out JSObjectPtr objp); */
00903 NS_IMETHODIMP
00904 mozStorageStatementParams::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00905                                    JSObject * obj, jsval id, PRUint32 flags, JSObject * *objp, PRBool *_retval)
00906 {
00907     int idx = -1;
00908 
00909     if (JSVAL_IS_INT(id)) {
00910         idx = JSVAL_TO_INT(id);
00911     } else if (JSVAL_IS_STRING(id)) {
00912         JSString *str = JSVAL_TO_STRING(id);
00913         nsCAutoString name(":");
00914         name.Append(NS_ConvertUTF16toUTF8(nsDependentString((PRUnichar *)::JS_GetStringChars(str),
00915                                                             ::JS_GetStringLength(str))));
00916 
00917         // check to see if there's a parameter with this name
00918         idx = sqlite3_bind_parameter_index(mStatement->GetNativeStatementPointer(), name.get());
00919         if (idx == 0) {
00920             // nope.
00921             fprintf (stderr, "********** mozStorageStatementWrapper: Couldn't find parameter %s\n", name.get());
00922             *_retval = PR_FALSE;
00923             return NS_OK;
00924         } else {
00925             // set idx, so that the numbered property also gets defined
00926             idx = idx - 1;
00927         }
00928 
00929         PRBool success = ::JS_DefineUCProperty(cx, obj, ::JS_GetStringChars(str),
00930                                                ::JS_GetStringLength(str),
00931                                                JSVAL_VOID,
00932                                                nsnull, nsnull, 0);
00933         if (!success) {
00934             *_retval = PR_FALSE;
00935             return NS_ERROR_FAILURE;
00936         }
00937     }
00938 
00939     if (idx == -1) {
00940         *_retval = PR_FALSE;
00941         return NS_ERROR_FAILURE;
00942     }
00943 
00944     // is it out of range?
00945     if (idx < 0 || idx >= (int)mParamCount) {
00946         *_retval = PR_FALSE;
00947         return NS_OK;
00948     }
00949 
00950     *_retval = ::JS_DefineElement(cx, obj, idx, JSVAL_VOID, nsnull, nsnull, 0);
00951     if (*_retval)
00952         *objp = obj;
00953     return NS_OK;
00954 }
00955 
00956 /* PRBool convert (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in PRUint32 type, in JSValPtr vp); */
00957 NS_IMETHODIMP
00958 mozStorageStatementParams::Convert(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00959                                 JSObject * obj, PRUint32 type, jsval * vp, PRBool *_retval)
00960 {
00961     return NS_ERROR_NOT_IMPLEMENTED;
00962 }
00963 
00964 /* void finalize (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj); */
00965 NS_IMETHODIMP
00966 mozStorageStatementParams::Finalize(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00967                                  JSObject * obj)
00968 {
00969     return NS_ERROR_NOT_IMPLEMENTED;
00970 }
00971 
00972 /* PRBool checkAccess (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in JSVal id, in PRUint32 mode, in JSValPtr vp); */
00973 NS_IMETHODIMP
00974 mozStorageStatementParams::CheckAccess(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00975                                     JSObject * obj, jsval id, PRUint32 mode, jsval * vp, PRBool *_retval)
00976 {
00977     return NS_ERROR_NOT_IMPLEMENTED;
00978 }
00979 
00980 /* PRBool call (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in PRUint32 argc, in JSValPtr argv, in JSValPtr vp); */
00981 NS_IMETHODIMP
00982 mozStorageStatementParams::Call(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00983                              JSObject * obj, PRUint32 argc, jsval * argv, jsval * vp, PRBool *_retval)
00984 {
00985     return NS_ERROR_NOT_IMPLEMENTED;
00986 }
00987 
00988 /* PRBool construct (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in PRUint32 argc, in JSValPtr argv, in JSValPtr vp); */
00989 NS_IMETHODIMP
00990 mozStorageStatementParams::Construct(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00991                                   JSObject * obj, PRUint32 argc, jsval * argv, jsval * vp, PRBool *_retval)
00992 {
00993     return NS_ERROR_NOT_IMPLEMENTED;
00994 }
00995 
00996 /* PRBool hasInstance (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in JSVal val, out PRBool bp); */
00997 NS_IMETHODIMP
00998 mozStorageStatementParams::HasInstance(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
00999                                     JSObject * obj, jsval val, PRBool *bp, PRBool *_retval)
01000 {
01001     return NS_ERROR_NOT_IMPLEMENTED;
01002 }
01003 
01004 /* PRUint32 mark (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in voidPtr arg); */
01005 NS_IMETHODIMP
01006 mozStorageStatementParams::Mark(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
01007                              JSObject * obj, void * arg, PRUint32 *_retval)
01008 {
01009     return NS_ERROR_NOT_IMPLEMENTED;
01010 }
01011 
01012 /* PRBool equality(in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in JSVal val); */
01013 NS_IMETHODIMP
01014 mozStorageStatementParams::Equality(nsIXPConnectWrappedNative *wrapper,
01015                                     JSContext *cx, JSObject *obj, jsval val,
01016                                     PRBool *_retval)
01017 {
01018     return NS_ERROR_NOT_IMPLEMENTED;
01019 }
01020 
01021 /* JSObjectPtr outerObject(in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj); */
01022 NS_IMETHODIMP
01023 mozStorageStatementParams::OuterObject(nsIXPConnectWrappedNative *wrapper,
01024                                        JSContext *cx, JSObject *obj,
01025                                        JSObject **_retval)
01026 {
01027     return NS_ERROR_NOT_IMPLEMENTED;
01028 }
01029 
01030 /* JSObjectPtr innerObject(in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj); */
01031 NS_IMETHODIMP
01032 mozStorageStatementParams::InnerObject(nsIXPConnectWrappedNative *wrapper,
01033                                        JSContext *cx, JSObject *obj,
01034                                        JSObject **_retval)
01035 {
01036     return NS_ERROR_NOT_IMPLEMENTED;
01037 }
01038