skins/AknSkins/srvsrc/AknsPkgID.cpp
changeset 0 05e9090e2422
equal deleted inserted replaced
-1:000000000000 0:05e9090e2422
       
     1 /*
       
     2 * Copyright (c) 2003-2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Defines the package ID class used to identify skin packages
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 
       
    21 #include <AknsPkgID.h>
       
    22 
       
    23 // CONSTANTS
       
    24 
       
    25 _LIT( KAknsPkgIDDelimiter, " " );
       
    26 
       
    27 // ============================ MEMBER FUNCTIONS ===============================
       
    28 // -----------------------------------------------------------------------------
       
    29 // TAknsPkgID::CopyToDes
       
    30 // -----------------------------------------------------------------------------
       
    31 //
       
    32 EXPORT_C void TAknsPkgID::CopyToDes( TDes& aDes ) const
       
    33     {
       
    34     aDes.Zero();
       
    35     aDes.AppendNum( iNumber );
       
    36     aDes.Append( KAknsPkgIDDelimiter );
       
    37     aDes.AppendNum( iTimestamp );
       
    38     }
       
    39 
       
    40 // -----------------------------------------------------------------------------
       
    41 // TAknsPkgID::SetFromDesL
       
    42 // -----------------------------------------------------------------------------
       
    43 //
       
    44 EXPORT_C void TAknsPkgID::SetFromDesL( const TDesC& aDes )
       
    45     {
       
    46     TLex lex( aDes );
       
    47 
       
    48     TPtrC numberToken( lex.NextToken() );
       
    49     if( !numberToken.Length() )
       
    50         {
       
    51         User::Leave( KErrArgument );
       
    52         }
       
    53     User::LeaveIfError( TLex(numberToken).Val(iNumber) );
       
    54 
       
    55     TPtrC stampToken( lex.NextToken() );
       
    56     if( stampToken.Length() )
       
    57         {
       
    58         User::LeaveIfError( TLex(stampToken).Val(iTimestamp) );
       
    59         }
       
    60     else
       
    61         {
       
    62         // UID format package ID
       
    63         iTimestamp = 0;
       
    64         }
       
    65     }
       
    66 
       
    67 //  End of File