os/persistentdata/persistentstorage/dbms/inc/D32SQL.INL
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
// Class RSqlLiteral
sl@0
    17
inline TBool RSqlLiteral::IsNull() const
sl@0
    18
	{return iType==ENull;}
sl@0
    19
inline TInt32 RSqlLiteral::Int32() const
sl@0
    20
	{__ASSERT(iType==EInt32);return iVal.iInt32;}
sl@0
    21
inline TUint32 RSqlLiteral::Uint32() const
sl@0
    22
	{__ASSERT(iType==EUint32);return iVal.iUint32;}
sl@0
    23
inline const TInt64& RSqlLiteral::Int64() const
sl@0
    24
	{__ASSERT(iType==EInt64);return iVal.iInt64;}
sl@0
    25
inline const TReal32& RSqlLiteral::Real32() const
sl@0
    26
	{__ASSERT(iType==EReal32);return iVal.iReal32;}
sl@0
    27
inline const TReal64& RSqlLiteral::Real64() const
sl@0
    28
	{__ASSERT(iType==EReal64);return iVal.iReal64;}
sl@0
    29
inline const TTime& RSqlLiteral::Time() const
sl@0
    30
	{__ASSERT(iType==ETime);return iVal.iTime;}
sl@0
    31
inline const TPtrC RSqlLiteral::DesC() const
sl@0
    32
	{__ASSERT(iType==EPtr);return TPtrC(iVal.iPtr.iPtr,iVal.iPtr.iEnd-iVal.iPtr.iPtr);}
sl@0
    33
inline const TText* RSqlLiteral::Ptr() const
sl@0
    34
	{__ASSERT(iType==EPtr);return iVal.iPtr.iPtr;}
sl@0
    35
inline const TText* RSqlLiteral::End() const
sl@0
    36
	{__ASSERT(iType==EPtr);return iVal.iPtr.iEnd;}
sl@0
    37
inline const HBufC8& RSqlLiteral::Text8() const
sl@0
    38
	{__ASSERT(iType==EBuf8);return *(const HBufC8*)iVal.iAlloc;}
sl@0
    39
inline const HBufC16& RSqlLiteral::Text16() const
sl@0
    40
	{__ASSERT(iType==EBuf16);return *(const HBufC16*)iVal.iAlloc;}
sl@0
    41
inline const HMatcherPattern8& RSqlLiteral::Pattern8() const
sl@0
    42
	{__ASSERT(iType==EPattern8);return *(const HMatcherPattern8*)iVal.iAlloc;}
sl@0
    43
inline const HMatcherPattern16& RSqlLiteral::Pattern16() const
sl@0
    44
	{__ASSERT(iType==EPattern16);return *(const HMatcherPattern16*)iVal.iAlloc;}
sl@0
    45
sl@0
    46
// Class RSqlColumnList
sl@0
    47
inline RSqlColumnList::RSqlColumnList()
sl@0
    48
	:RArray<TPtrC>(EGranularity)
sl@0
    49
	{}
sl@0
    50
sl@0
    51
// Class CSqlSearchCondition
sl@0
    52
inline CSqlSearchCondition::TType CSqlSearchCondition::NodeType() const
sl@0
    53
	{return iType;}
sl@0
    54
inline CSqlMultiNode* CSqlSearchCondition::MultiNode()
sl@0
    55
	{__ASSERT(iType==EAnd||iType==EOr);return STATIC_CAST(CSqlMultiNode*,this);}
sl@0
    56
inline CSqlNullPredicate* CSqlSearchCondition::NullPredicate()
sl@0
    57
	{__ASSERT(iType==EIsNull||iType==EIsNotNull);return STATIC_CAST(CSqlNullPredicate*,this);}
sl@0
    58
inline CSqlCompPredicate* CSqlSearchCondition::CompPredicate()
sl@0
    59
	{__ASSERT(iType==ELess||iType==ELessEqual||iType==EEqual||iType==EGreaterEqual||iType==EGreater||iType==ENotEqual);return STATIC_CAST(CSqlCompPredicate*,this);}
sl@0
    60
inline CSqlLikePredicate* CSqlSearchCondition::LikePredicate()
sl@0
    61
	{__ASSERT(iType==ELike||iType==ENotLike);return STATIC_CAST(CSqlLikePredicate*,this);}
sl@0
    62
sl@0
    63
// Class CSqlMultiNode
sl@0
    64
inline TInt CSqlMultiNode::Count() const
sl@0
    65
	{return iEnd-iLeaves;}
sl@0
    66
inline CSqlSearchCondition* CSqlMultiNode::SubNode(TInt aIndex) const
sl@0
    67
	{__ASSERT(TUint(aIndex)<TUint(Count()));return iLeaves[aIndex];}
sl@0
    68
inline void CSqlMultiNode::SetSubNode(TInt aIndex,CSqlSearchCondition* aSearchCondition) 
sl@0
    69
	{__ASSERT(TUint(aIndex)<TUint(Count()));iLeaves[aIndex]=aSearchCondition;}
sl@0
    70
sl@0
    71
// Class CSqlBoundNode
sl@0
    72
inline TBool CSqlBoundNode::IsBound() const
sl@0
    73
	{return iSource!=0;}
sl@0
    74
inline TDbColNo CSqlBoundNode::ColNo() const
sl@0
    75
	{__ASSERT(IsBound());return iColumn.iBound.iNumber;}
sl@0
    76
inline TDbColType CSqlBoundNode::ColType() const
sl@0
    77
	{return iColumn.iBound.iType;}
sl@0
    78
sl@0
    79
// Class CSqlLiteralNode 
sl@0
    80
inline const RSqlLiteral& CSqlLiteralNode::Value() const
sl@0
    81
	{return iLiteral;}
sl@0
    82
inline RSqlLiteral& CSqlLiteralNode::Value()
sl@0
    83
	{return iLiteral;}
sl@0
    84
sl@0
    85
// Class CSqlQuery
sl@0
    86
inline const TDesC& CSqlQuery::Table() const
sl@0
    87
	{return iTable;}
sl@0
    88
inline TBool CSqlQuery::HasColumnList() const
sl@0
    89
	{return iColumns.Count()!=0;}
sl@0
    90
inline const RSqlColumnList& CSqlQuery::ColumnList() const
sl@0
    91
	{return iColumns;}
sl@0
    92
inline TBool CSqlQuery::HasSearchCondition() const
sl@0
    93
	{return iSearchCondition!=0;}
sl@0
    94
inline CSqlSearchCondition& CSqlQuery::SearchCondition()
sl@0
    95
	{__ASSERT(HasSearchCondition());return *iSearchCondition;}
sl@0
    96
inline CSqlSearchCondition* CSqlQuery::AdoptSearchCondition()
sl@0
    97
	{__ASSERT(HasSearchCondition());CSqlSearchCondition* rr=iSearchCondition;iSearchCondition=0;return rr;}
sl@0
    98
inline TBool CSqlQuery::HasSortSpecification() const
sl@0
    99
	{return iSortSpecification!=0;}
sl@0
   100
inline CDbKey& CSqlQuery::SortSpecification()
sl@0
   101
	{__ASSERT(HasSortSpecification());return *iSortSpecification;}
sl@0
   102
sl@0
   103
// Class CSqlDMLStatement
sl@0
   104
inline CSqlQuery& CSqlDMLStatement::Query()
sl@0
   105
	{return iQuery;}
sl@0
   106
inline CSqlValues& CSqlDMLStatement::Values()
sl@0
   107
	{__ASSERT(iValues);return *iValues;}
sl@0
   108
inline CSqlValues* CSqlDMLStatement::AdoptValues()
sl@0
   109
	{__ASSERT(iValues);CSqlValues* v=iValues;iValues=NULL;return v;}
sl@0
   110
inline TBool CSqlDMLStatement::HasValues() const
sl@0
   111
	{return iValues!=NULL;}
sl@0
   112
sl@0
   113
// Class CSqlModifyStatement
sl@0
   114
inline TBool CSqlModifyStatement::IsUpdate() const
sl@0
   115
	{return HasValues();}
sl@0
   116
sl@0
   117
//class TSqlParser2
sl@0
   118
sl@0
   119
inline Sql::TStatementType TSqlParser2::StatementType() const
sl@0
   120
	{
sl@0
   121
	return iStatementType;
sl@0
   122
	}
sl@0
   123
sl@0
   124
inline const TDesC& TSqlParser2::TableName() const
sl@0
   125
	{
sl@0
   126
	return iTableName;
sl@0
   127
	}