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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
17 inline RSqlLiteral::RSqlLiteral()
21 inline TBool RSqlLiteral::IsAlloc() const
22 {return iType>=EBuf8;}
23 inline TBool RSqlLiteral::IsBasic() const
24 {return iType>=EInt64&&iType<=EPtr;}
26 inline TInt64& RSqlLiteral::SetInt()
27 {__ASSERT(!IsAlloc());iType=EInt64;return iVal.iInt64();}
28 inline TReal64& RSqlLiteral::SetReal()
29 {__ASSERT(!IsAlloc());iType=EReal64;return iVal.iReal64;}
30 inline TTime& RSqlLiteral::SetTime()
31 {__ASSERT(!IsAlloc());iType=ETime;return iVal.iTime();}
32 inline void RSqlLiteral::SetText(const TText* aPtr,const TText* aEnd)
33 {__ASSERT(!IsAlloc());iType=EPtr;iVal.iPtr.iPtr=aPtr;iVal.iPtr.iEnd=aEnd;}
34 inline void RSqlLiteral::SetBlob(const TText* aPtr,const TText* aEnd)
35 {__ASSERT(!IsAlloc());iType=EBlob;iVal.iPtr.iPtr=aPtr;iVal.iPtr.iEnd=aEnd;}
38 inline TBool TSqlToken::operator==(TSqlTokenType aType) const
39 {return iType==aType;}
40 inline TBool TSqlToken::operator!=(TSqlTokenType aType) const
41 {return iType!=aType;}
42 inline TSqlTokenType TSqlToken::operator=(TSqlTokenType aType)
43 {iType=aType;return aType;}
44 inline void TSqlToken::SetError(TInt aError)
46 inline TInt TSqlToken::Error() const
47 {return Min(iType,0);}
48 inline TSqlTokenType TSqlToken::Type() const
49 {return TSqlTokenType(iType);}
50 inline RSqlLiteral& TSqlToken::Literal()
51 {__ASSERT(iType>=ESqlIdentifier&&iType<=ESqlLiteralText);return iLiteral;}
52 inline const RSqlLiteral& TSqlToken::Literal() const
53 {__ASSERT(iType>=ESqlIdentifier&&iType<=ESqlLiteralText);return iLiteral;}
56 inline TSqlTokenType TSqlLexer::NextToken(TSqlToken& aToken)
57 {return aToken=GetNextToken(aToken);}
58 inline TSqlTokenType TSqlLexer::SqlError(TInt aError)
59 {return TSqlTokenType(aError);}
60 inline TBool TSqlLexer::IsKeyword(TSqlKeyword aKeyword,const TSqlToken& aToken)
61 {return aToken==ESqlIdentifier && CompareKeyword(aKeyword,aToken.Literal())==0;}
64 inline TInt TSqlParser::Error() const
65 {return iToken.Error();}
67 // Class CSqlBoundNode
68 inline TDbColumnC CSqlBoundNode::Column() const
69 {return TDbColumnC(*iSource,iColumn.iBound.iNumber);}
71 // type-matching compiler support
72 inline TUint8* PtrType(const TDesC8&)
74 inline TUint16* PtrType(const TDesC16&)