sl@0: // Copyright (c) 1998-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: // sl@0: sl@0: #ifndef __ASSERT sl@0: #define __ASSERT(a) sl@0: #endif sl@0: sl@0: // Class RSqlLiteral sl@0: inline TBool RSqlLiteral::IsNull() const sl@0: {return iType==ENull;} sl@0: inline TInt32 RSqlLiteral::Int32() const sl@0: {__ASSERT(iType==EInt32);return iVal.iInt32;} sl@0: inline TUint32 RSqlLiteral::Uint32() const sl@0: {__ASSERT(iType==EUint32);return iVal.iUint32;} sl@0: inline const TInt64& RSqlLiteral::Int64() const sl@0: {__ASSERT(iType==EInt64);return iVal.iInt64;} sl@0: inline const TReal32& RSqlLiteral::Real32() const sl@0: {__ASSERT(iType==EReal32);return iVal.iReal32;} sl@0: inline const TReal64& RSqlLiteral::Real64() const sl@0: {__ASSERT(iType==EReal64);return iVal.iReal64;} sl@0: inline const TTime& RSqlLiteral::Time() const sl@0: {__ASSERT(iType==ETime);return iVal.iTime;} sl@0: inline const TPtrC RSqlLiteral::DesC() const sl@0: {__ASSERT(iType==EPtr);return TPtrC(iVal.iPtr.iPtr,iVal.iPtr.iEnd-iVal.iPtr.iPtr);} sl@0: inline const TText* RSqlLiteral::Ptr() const sl@0: {__ASSERT(iType==EPtr);return iVal.iPtr.iPtr;} sl@0: inline const TText* RSqlLiteral::End() const sl@0: {__ASSERT(iType==EPtr);return iVal.iPtr.iEnd;} sl@0: inline const HBufC8& RSqlLiteral::Text8() const sl@0: {__ASSERT(iType==EBuf8);return *(const HBufC8*)iVal.iAlloc;} sl@0: inline const HBufC16& RSqlLiteral::Text16() const sl@0: {__ASSERT(iType==EBuf16);return *(const HBufC16*)iVal.iAlloc;} sl@0: inline const HMatcherPattern8& RSqlLiteral::Pattern8() const sl@0: {__ASSERT(iType==EPattern8);return *(const HMatcherPattern8*)iVal.iAlloc;} sl@0: inline const HMatcherPattern16& RSqlLiteral::Pattern16() const sl@0: {__ASSERT(iType==EPattern16);return *(const HMatcherPattern16*)iVal.iAlloc;} sl@0: inline const HBufC8& RSqlLiteral::Blob() const sl@0: {__ASSERT(iType==EBlob);return *(const HBufC8*)iVal.iAlloc;} sl@0: sl@0: // Class RSqlColumnList sl@0: inline RSqlColumnList::RSqlColumnList() sl@0: :RArray(EGranularity) sl@0: {} sl@0: sl@0: // Class CSqlSearchCondition sl@0: inline CSqlSearchCondition::TType CSqlSearchCondition::NodeType() const sl@0: {return iType;} sl@0: inline CSqlMultiNode* CSqlSearchCondition::MultiNode() sl@0: {__ASSERT(iType==EAnd||iType==EOr);return STATIC_CAST(CSqlMultiNode*,this);} sl@0: inline CSqlNullPredicate* CSqlSearchCondition::NullPredicate() sl@0: {__ASSERT(iType==EIsNull||iType==EIsNotNull);return STATIC_CAST(CSqlNullPredicate*,this);} sl@0: inline CSqlCompPredicate* CSqlSearchCondition::CompPredicate() sl@0: {__ASSERT(iType==ELess||iType==ELessEqual||iType==EEqual||iType==EGreaterEqual||iType==EGreater||iType==ENotEqual);return STATIC_CAST(CSqlCompPredicate*,this);} sl@0: inline CSqlLikePredicate* CSqlSearchCondition::LikePredicate() sl@0: {__ASSERT(iType==ELike||iType==ENotLike);return STATIC_CAST(CSqlLikePredicate*,this);} sl@0: sl@0: // Class CSqlMultiNode sl@0: inline TInt CSqlMultiNode::Count() const sl@0: {return iEnd-iLeaves;} sl@0: inline CSqlSearchCondition* CSqlMultiNode::SubNode(TInt aIndex) const sl@0: {__ASSERT(TUint(aIndex)