securitysettings/qtconfigutils/eapqtplugininfo/src/eapqtexpandedeaptype.cpp
changeset 26 9abfd4f00d37
child 34 ad1f037f1ac2
equal deleted inserted replaced
25:e03a3db4489e 26:9abfd4f00d37
       
     1 /*
       
     2  * Copyright (c) 2010 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 the License "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: 
       
    15  *   Expanded EAP type QT data structure
       
    16  *
       
    17  */
       
    18 
       
    19 /*
       
    20  * %version: 12 %
       
    21  */
       
    22 
       
    23 #include "eapqtexpandedeaptype.h"
       
    24 #include "eapqtexpandedeaptype_p.h"
       
    25 
       
    26 //----------------------------------------------------------------------------
       
    27 //              EapQtExpandedEapType                
       
    28 //----------------------------------------------------------------------------
       
    29 
       
    30 EapQtExpandedEapType::EapQtExpandedEapType() :
       
    31     d_ptr(new EapQtExpandedEapTypePrivate)
       
    32 {
       
    33 }
       
    34 
       
    35 EapQtExpandedEapType::EapQtExpandedEapType(const Type type) :
       
    36     d_ptr(new EapQtExpandedEapTypePrivate(type))
       
    37 {
       
    38 }
       
    39 
       
    40 EapQtExpandedEapType::EapQtExpandedEapType(const QByteArray data) :
       
    41     d_ptr(new EapQtExpandedEapTypePrivate(data))
       
    42 {
       
    43 }
       
    44 
       
    45 EapQtExpandedEapType::EapQtExpandedEapType(const EapQtExpandedEapType & type) :
       
    46     d_ptr(new EapQtExpandedEapTypePrivate)
       
    47 {
       
    48     d_ptr->mData = type.d_ptr->mData;
       
    49     d_ptr->mType = type.d_ptr->mType;
       
    50 }
       
    51 
       
    52 EapQtExpandedEapType::~EapQtExpandedEapType()
       
    53 {
       
    54     // scoped pointer delete
       
    55 }
       
    56 
       
    57 QByteArray EapQtExpandedEapType::eapExpandedData() const
       
    58 {
       
    59     return d_ptr->mData;
       
    60 }
       
    61 
       
    62 EapQtExpandedEapType::Type EapQtExpandedEapType::type() const
       
    63 {
       
    64     return d_ptr->mType;
       
    65 }
       
    66 
       
    67 bool EapQtExpandedEapType::operator ==(const EapQtExpandedEapType &right_type_value) const
       
    68 {
       
    69     return (d_ptr->mData == right_type_value.d_ptr->mData) && (d_ptr->mType == right_type_value.d_ptr->mType);
       
    70 }
       
    71 
       
    72 bool EapQtExpandedEapType::operator !=(const EapQtExpandedEapType &right_type_value) const
       
    73 {
       
    74     return (d_ptr->mData != right_type_value.d_ptr->mData) || (d_ptr->mType != right_type_value.d_ptr->mType);
       
    75 }
       
    76 
       
    77 EapQtExpandedEapType& EapQtExpandedEapType::operator=(const EapQtExpandedEapType &type)
       
    78 {
       
    79     // check if assigning to myself
       
    80     if (this != &type) {
       
    81         d_ptr.reset(new EapQtExpandedEapTypePrivate);
       
    82         d_ptr->mData = type.d_ptr->mData;
       
    83         d_ptr->mType = type.d_ptr->mType;
       
    84     }
       
    85     return *this;
       
    86 }
       
    87