messagingappbase/msgavkon/muiu_internal/flagger/src/MuiuFlags.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 09 Jun 2010 09:37:26 +0300
branchRCL_3
changeset 20 94cccd85bd25
parent 0 72b543305e3a
permissions -rw-r--r--
Revision: 201021 Kit: 2010123

/*
* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:   This file contains definitions to flag functions
*
*/



// INCLUDE FILES
#include <e32base.h>        
#include "MuiuFlags.h"

// EXTERNAL DATA STRUCTURES
// EXTERNAL FUNCTION PROTOTYPES  
// CONSTANTS
const TInt KMuiuFlagLast = 64;

// MACROS
// LOCAL CONSTANTS AND MACROS
// MODULE DATA STRUCTURES
// LOCAL FUNCTION PROTOTYPES
// FORWARD DECLARATIONS

// ----------------------------------------------------------------------------
// TMuiuFlags::TMuiuFlags()
// ----------------------------------------------------------------------------
//
EXPORT_C TMuiuFlags::TMuiuFlags( const TUint64 aFlags ) 
    : 
    iFlags( aFlags )
    {
    }

// ----------------------------------------------------------------------------
// TMuiuFlags::operator=()
// ----------------------------------------------------------------------------
//
EXPORT_C TMuiuFlags& TMuiuFlags::operator=( const TMuiuFlags& aFlags )
    {
    // Copy the flags
    for ( TInt flag = KMuiuFlagLast; --flag >= 0; )
        {
        ChangeFlag( flag, aFlags.Flag( flag ) );
        }
        
    return *this;
    }
    
// ----------------------------------------------------------------------------
// TMuiuFlags::operator=()
// ----------------------------------------------------------------------------
//
EXPORT_C TMuiuFlags& TMuiuFlags::operator=( const TUint64 aFlags )
    {
    // Copy the flags
    for ( TInt flag = KMuiuFlagLast; --flag >= 0; )
        {
        ChangeFlag( flag, ( aFlags >> flag ) & 0x01 );
        }
        
    return *this;
    }    


// End of File