os/persistentdata/persistentstorage/dbms/usql/UQ_BOUND.CPP
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 #include "UQ_STD.H"
    17 
    18 // class CSqlBoundNode
    19 
    20 CSqlBoundNode::CSqlBoundNode(TType aType,const TDesC& aColumn)
    21 	: CSqlSearchCondition(aType)
    22 	{
    23 	iColumn.iName.Set(aColumn);
    24 	}
    25 
    26 void CSqlBoundNode::BindL(const RDbTableRow& aSource)
    27 	{
    28 	const HDbColumnSet& columns=aSource.Table().Def().Columns();
    29 	TDbColNo col=columns.ColNoL(iColumn.iName());
    30 	if (col==KDbNullColNo)
    31 		__LEAVE(KErrNotFound);
    32 	iSource=&aSource;
    33 	iColumn.iBound.iNumber=col;
    34 	iColumn.iBound.iType=columns[col].Type();
    35 	}
    36 
    37 const TDesC& CSqlBoundNode::ColumnName() const
    38 //
    39 // Return the column name
    40 // If not bound it is embedded, otherwise lookup via the column def
    41 //
    42 	{
    43 	if (IsBound())
    44 		return *iSource->Table().Def().Columns()[iColumn.iBound.iNumber].iName;
    45 	return (const TPtrC&)iColumn.iName;
    46 	}
    47 
    48 MStreamBuf& CSqlBoundNode::StreamLC(const TDbBlob& aBlob) const
    49 	{
    50 	__ASSERT(!aBlob.IsInline());
    51 	return *iSource->Table().BlobsL()->ReadLC(aBlob.Id(),ColType());
    52 	}
    53