os/persistentdata/persistentstorage/sql/SRC/Server/SqlSrvSession.inl
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/persistentdata/persistentstorage/sql/SRC/Server/SqlSrvSession.inl	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,96 @@
     1.4 +// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +/**
    1.20 +*/
    1.21 +inline void CSqlSrvSession::ConstructL()
    1.22 +	{
    1.23 +	}
    1.24 +
    1.25 +/**
    1.26 +*/
    1.27 +inline CSqlSrvSession::CSqlSrvSession()
    1.28 +	{
    1.29 +	}
    1.30 +
    1.31 +/**
    1.32 +@return A reference to CSqlServer instance.
    1.33 +*/
    1.34 +inline CSqlServer& CSqlSrvSession::Server()
    1.35 +	{
    1.36 +	return *static_cast<CSqlServer*>(const_cast<CServer2*>(CSession2::Server()));
    1.37 +	}
    1.38 +	
    1.39 +/**
    1.40 +Destroys CSqlSrvDatabase instance.
    1.41 +*/
    1.42 +inline void CSqlSrvSession::DbDestroyObject()
    1.43 +	{
    1.44 +	delete iDatabase;
    1.45 +	iDatabase = NULL;
    1.46 +	}
    1.47 +
    1.48 +/**
    1.49 +Processes request for executing 8-bit SQL statement(s).
    1.50 +
    1.51 +The method requires a valid iDatabase object.
    1.52 +
    1.53 +Usage of the IPC call arguments:
    1.54 +Arg 0: [in]	8-bit character length of SQL statement.
    1.55 +Arg 1: [in]	SQL statement.
    1.56 +
    1.57 +@panic SqlDb 2 Client panic. iDatabase is NULL (the database object is not created yet).
    1.58 +*/
    1.59 +inline TInt CSqlSrvSession::DbExecSql8L(const RMessage2& aMessage)
    1.60 +	{
    1.61 +	__SQLPANIC_CLIENT(iDatabase != NULL, aMessage, ESqlPanicInvalidObj);
    1.62 +	iDatabase->ExecL(ReadString8ZL(aMessage, 1, aMessage.Int0()));
    1.63 +	return iDatabase->LastChangesCount();
    1.64 +	}
    1.65 +
    1.66 +/**
    1.67 +Processes request for executing 16-bit SQL statement(s).
    1.68 +
    1.69 +The method requires a valid iDatabase object.
    1.70 +
    1.71 +Usage of the IPC call arguments:
    1.72 +Arg 0: [in]	16-bit character length of SQL statement.
    1.73 +Arg 1: [in]	SQL statement.
    1.74 +
    1.75 +@panic SqlDb 2 Client panic. iDatabase is NULL (the database object is not created yet).
    1.76 +*/
    1.77 +inline TInt CSqlSrvSession::DbExecSql16L(const RMessage2& aMessage)
    1.78 +	{
    1.79 +	__SQLPANIC_CLIENT(iDatabase != NULL, aMessage, ESqlPanicInvalidObj);
    1.80 +	iDatabase->ExecL(ReadString16ZL(aMessage, 1, aMessage.Int0()));
    1.81 +	return iDatabase->LastChangesCount();
    1.82 +	}
    1.83 +
    1.84 +/**
    1.85 +Processes the request for setting the database isolation level.
    1.86 +
    1.87 +The method requires a valid iDatabase object.
    1.88 +
    1.89 +Usage of the IPC call arguments:
    1.90 +Arg 0: [in]	Database isolation level.
    1.91 +
    1.92 +@panic SqlDb 2 Client panic. iDatabase is NULL (the database object is not created yet).
    1.93 +*/
    1.94 +inline void CSqlSrvSession::DbSetIsolationLevelL(const RMessage2& aMessage)
    1.95 +	{
    1.96 +	__SQLPANIC_CLIENT(iDatabase != NULL, aMessage, ESqlPanicInvalidObj);
    1.97 +	RSqlDatabase::TIsolationLevel level = static_cast <RSqlDatabase::TIsolationLevel> (aMessage.Int0());
    1.98 +	iDatabase->SetIsolationLevelL(level);
    1.99 +	}