persistentstorage/dbms/usql/UQ_STD.INL
changeset 0 08ec8eefde2f
equal deleted inserted replaced
-1:000000000000 0:08ec8eefde2f
       
     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 // Class RSqlLiteral
       
    17 inline RSqlLiteral::RSqlLiteral()
       
    18 	:iType(ENull) 
       
    19 	{iBuffer=NULL;}
       
    20 
       
    21 inline TBool RSqlLiteral::IsAlloc() const
       
    22 	{return iType>=EBuf8;}
       
    23 inline TBool RSqlLiteral::IsBasic() const
       
    24 	{return iType>=EInt64&&iType<=EPtr;}
       
    25 
       
    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 
       
    35 // Class TSqlToken
       
    36 inline TBool TSqlToken::operator==(TSqlTokenType aType) const
       
    37 	{return iType==aType;}
       
    38 inline TBool TSqlToken::operator!=(TSqlTokenType aType) const
       
    39 	{return iType!=aType;}
       
    40 inline TSqlTokenType TSqlToken::operator=(TSqlTokenType aType)
       
    41 	{iType=aType;return aType;}
       
    42 inline void TSqlToken::SetError(TInt aError)
       
    43 	{iType=aError;}
       
    44 inline TInt TSqlToken::Error() const
       
    45 	{return Min(iType,0);}
       
    46 inline TSqlTokenType TSqlToken::Type() const
       
    47 	{return TSqlTokenType(iType);}
       
    48 inline RSqlLiteral& TSqlToken::Literal()
       
    49 	{__ASSERT(iType>=ESqlIdentifier&&iType<=ESqlLiteralText);return iLiteral;}
       
    50 inline const RSqlLiteral& TSqlToken::Literal() const
       
    51 	{__ASSERT(iType>=ESqlIdentifier&&iType<=ESqlLiteralText);return iLiteral;}
       
    52 
       
    53 // class TSqlLexer
       
    54 inline TSqlTokenType TSqlLexer::NextToken(TSqlToken& aToken)
       
    55 	{return aToken=GetNextToken(aToken);}
       
    56 inline TSqlTokenType TSqlLexer::SqlError(TInt aError)
       
    57 	{return TSqlTokenType(aError);}
       
    58 inline TBool TSqlLexer::IsKeyword(TSqlKeyword aKeyword,const TSqlToken& aToken)
       
    59 	{return aToken==ESqlIdentifier && CompareKeyword(aKeyword,aToken.Literal())==0;}
       
    60 
       
    61 // class TSqlParser
       
    62 inline TInt TSqlParser::Error() const
       
    63 	{return iToken.Error();}
       
    64 
       
    65 // Class CSqlBoundNode
       
    66 inline TDbColumnC CSqlBoundNode::Column() const
       
    67 	{return TDbColumnC(*iSource,iColumn.iBound.iNumber);}
       
    68 
       
    69 // type-matching compiler support
       
    70 inline TUint8* PtrType(const TDesC8&)
       
    71 	{return 0;}
       
    72 inline TUint16* PtrType(const TDesC16&)
       
    73 	{return 0;}