sl@0: // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // Global sql statement related functions sl@0: // sl@0: // sl@0: sl@0: #ifndef __SQLSRVSTATEMENTUTIL_H__ sl@0: #define __SQLSRVSTATEMENTUTIL_H__ sl@0: sl@0: #include sl@0: sl@0: //This header file contains useful utility function declarations. sl@0: //These functions are used for accessging directly the SQLITE interface functions. sl@0: sl@0: //Forward declarations sl@0: struct sqlite3; sl@0: struct sqlite3_stmt; sl@0: struct sqlite3_context; sl@0: struct Mem; sl@0: typedef struct Mem sqlite3_value; sl@0: sl@0: TInt CreateDbHandle16(const TDesC& aFileNameZ, sqlite3*& aDbHandle); sl@0: TInt CreateDbHandle8(const TDesC8& aFileNameZ, sqlite3*& aDbHandle); sl@0: inline void CloseDbHandle(sqlite3* aDbHandle); sl@0: inline void CloseDbCleanup(void* aDbHandle); sl@0: TPtrC GetFirstSqlStmt(TPtr& aString); sl@0: TInt DbExecStmt16(sqlite3 *aDbHandle, TDes16& aSqlStmt); sl@0: TInt DbExecStmt8(sqlite3 *aDbHandle, const TDesC8& aSqlStmt); sl@0: sl@0: sqlite3_stmt* StmtPrepare16L(sqlite3* aDbHandle, const TDesC16& aSqlStmt); sl@0: TInt StmtPrepare8(sqlite3* aDbHandle, const TDesC8& aSqlStmt, sqlite3_stmt*& aStmtHandle); sl@0: sqlite3_stmt* StmtPrepare8L(sqlite3* aDbHandle, const TDesC8& aSqlStmt); sl@0: TInt FinalizeStmtHandle(sqlite3_stmt* aStmtHandle); sl@0: TInt StmtExec(sqlite3_stmt* aStmtHandle); sl@0: TInt StmtNext(sqlite3_stmt* aStmtHandle); sl@0: TInt StmtReset(sqlite3_stmt* aStmtHandle); sl@0: sl@0: TInt DbPageCount(sqlite3* aDbHandle, const TDesC& aDbName, TInt& aPageCount); sl@0: TInt DbPageSize(sqlite3* aDbHandle, const TDesC& aDbName, TInt& aPageSize); sl@0: TInt DbCacheSize(sqlite3* aDbHandle, const TDesC& aDbName, TInt& aCacheSize); sl@0: TInt DbEncoding(sqlite3* aDbHandle, const TDesC& aDbName, TDes8& aEncoding); sl@0: TInt DbFreePageCount(sqlite3* aDbHandle, const TDesC& aDbName, TInt& aPageCount); sl@0: TInt DbVacuumMode(sqlite3* aDbHandle, const TDesC& aDbName, TInt& aVacuumMode); sl@0: TInt DbCompact(sqlite3* aDbHandle, const TDesC& aDbName, TInt aPageCount, TInt& aProcessedPageCount, TInt aMaxTime = 0); sl@0: sl@0: #include "SqlSrvStatementUtil.inl" sl@0: sl@0: #endif//__SQLSRVSTATEMENTUTIL_H__