messagingappbase/msgavkon/muiu_internal/flagger/src/MuiuFlags.cpp
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 /*
       
     2 * Copyright (c) 2002 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:   This file contains definitions to flag functions
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include <e32base.h>        
       
    22 #include "MuiuFlags.h"
       
    23 
       
    24 // EXTERNAL DATA STRUCTURES
       
    25 // EXTERNAL FUNCTION PROTOTYPES  
       
    26 // CONSTANTS
       
    27 const TInt KMuiuFlagLast = 64;
       
    28 
       
    29 // MACROS
       
    30 // LOCAL CONSTANTS AND MACROS
       
    31 // MODULE DATA STRUCTURES
       
    32 // LOCAL FUNCTION PROTOTYPES
       
    33 // FORWARD DECLARATIONS
       
    34 
       
    35 // ----------------------------------------------------------------------------
       
    36 // TMuiuFlags::TMuiuFlags()
       
    37 // ----------------------------------------------------------------------------
       
    38 //
       
    39 EXPORT_C TMuiuFlags::TMuiuFlags( const TUint64 aFlags ) 
       
    40     : 
       
    41     iFlags( aFlags )
       
    42     {
       
    43     }
       
    44 
       
    45 // ----------------------------------------------------------------------------
       
    46 // TMuiuFlags::operator=()
       
    47 // ----------------------------------------------------------------------------
       
    48 //
       
    49 EXPORT_C TMuiuFlags& TMuiuFlags::operator=( const TMuiuFlags& aFlags )
       
    50     {
       
    51     // Copy the flags
       
    52     for ( TInt flag = KMuiuFlagLast; --flag >= 0; )
       
    53         {
       
    54         ChangeFlag( flag, aFlags.Flag( flag ) );
       
    55         }
       
    56         
       
    57     return *this;
       
    58     }
       
    59     
       
    60 // ----------------------------------------------------------------------------
       
    61 // TMuiuFlags::operator=()
       
    62 // ----------------------------------------------------------------------------
       
    63 //
       
    64 EXPORT_C TMuiuFlags& TMuiuFlags::operator=( const TUint64 aFlags )
       
    65     {
       
    66     // Copy the flags
       
    67     for ( TInt flag = KMuiuFlagLast; --flag >= 0; )
       
    68         {
       
    69         ChangeFlag( flag, ( aFlags >> flag ) & 0x01 );
       
    70         }
       
    71         
       
    72     return *this;
       
    73     }    
       
    74 
       
    75 
       
    76 // End of File