bluetooth/btsdp/database/SdpIntBuf.cpp
changeset 0 29b1cd4cb562
equal deleted inserted replaced
-1:000000000000 0:29b1cd4cb562
       
     1 // Copyright (c) 2005-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 <btsdp.h>
       
    17 
       
    18 // Template class TSdpIntBuf
       
    19 
       
    20 EXPORT_C TSdpIntBuf<TUint64>::TSdpIntBuf(const TUint64 &aRef)
       
    21 	{
       
    22 	DoSetLength(sizeof(TUint64));
       
    23 	TUint64 num(aRef);
       
    24 	for(TInt i=7;i>=0;i--)
       
    25 		{
       
    26 		iBuf[i]=TUint8(num & 0xff);
       
    27 		num>>=8;
       
    28 		}
       
    29 	}
       
    30 
       
    31 
       
    32 EXPORT_C TSdpIntBuf<TUint32>::TSdpIntBuf(const TUint32 &aRef)
       
    33 : TSdpIntBuf<TUint>(aRef)
       
    34 	{
       
    35 	}
       
    36 
       
    37 EXPORT_C TSdpIntBuf<TUint16>::TSdpIntBuf(const TUint16 &aRef)
       
    38 : TSdpIntBuf<TUint>(0)
       
    39 	{
       
    40 	DoSetLength(sizeof(TUint16));
       
    41 	TUint16 num(aRef);
       
    42 	iBuf[1] = TUint8(num & 0xff);
       
    43 	num >>= 8;
       
    44 	iBuf[0] = TUint8(num & 0xff);
       
    45 	}
       
    46 
       
    47 EXPORT_C TSdpIntBuf<TUint8>::TSdpIntBuf(const TUint8 &aRef)
       
    48 : TSdpIntBuf<TUint>(0)
       
    49 	{
       
    50 	DoSetLength(sizeof(TUint8));
       
    51 	TUint8 num(aRef);
       
    52 	iBuf[0] = TUint8(num & 0xff);
       
    53 	}
       
    54 	
       
    55 	
       
    56 // EOF