securitysettings/qtconfigutils/eapqtplugininfo/src/eapqtexpandedeaptype.cpp
branchRCL_3
changeset 45 bad0cc58d154
equal deleted inserted replaced
43:30e048a7b597 45:bad0cc58d154
       
     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 "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: 13 %
       
    21  */
       
    22 
       
    23 // System includes
       
    24 #include <eapqtexpandedeaptype.h>
       
    25 
       
    26 // User includes
       
    27 #include "eapqtexpandedeaptype_p.h"
       
    28 
       
    29 /*!
       
    30  *  \class EapQtExpandedEapType
       
    31  *  \brief Public implementation of expanded EAP type QT data structure
       
    32  */
       
    33 
       
    34 // External function prototypes
       
    35 
       
    36 // Local constants
       
    37 
       
    38 // ======== LOCAL FUNCTIONS ========
       
    39 
       
    40 // ======== MEMBER FUNCTIONS ========
       
    41 
       
    42 EapQtExpandedEapType::EapQtExpandedEapType() :
       
    43     d_ptr(new EapQtExpandedEapTypePrivate)
       
    44 {
       
    45 }
       
    46 
       
    47 EapQtExpandedEapType::EapQtExpandedEapType(const Type type) :
       
    48     d_ptr(new EapQtExpandedEapTypePrivate(type))
       
    49 {
       
    50 }
       
    51 
       
    52 EapQtExpandedEapType::EapQtExpandedEapType(const QByteArray &data) :
       
    53     d_ptr(new EapQtExpandedEapTypePrivate(data))
       
    54 {
       
    55 }
       
    56 
       
    57 EapQtExpandedEapType::EapQtExpandedEapType(const EapQtExpandedEapType &type) :
       
    58     d_ptr(new EapQtExpandedEapTypePrivate)
       
    59 {
       
    60     d_ptr->mData = type.d_ptr->mData;
       
    61     d_ptr->mType = type.d_ptr->mType;
       
    62 }
       
    63 
       
    64 EapQtExpandedEapType::~EapQtExpandedEapType()
       
    65 {
       
    66     // scoped pointer delete
       
    67 }
       
    68 
       
    69 QByteArray EapQtExpandedEapType::eapExpandedData() const
       
    70 {
       
    71     return d_ptr->mData;
       
    72 }
       
    73 
       
    74 EapQtExpandedEapType::Type EapQtExpandedEapType::type() const
       
    75 {
       
    76     return d_ptr->mType;
       
    77 }
       
    78 
       
    79 bool EapQtExpandedEapType::operator ==(const EapQtExpandedEapType &right_type_value) const
       
    80 {
       
    81     return (d_ptr->mData == right_type_value.d_ptr->mData) && (d_ptr->mType == right_type_value.d_ptr->mType);
       
    82 }
       
    83 
       
    84 bool EapQtExpandedEapType::operator !=(const EapQtExpandedEapType &right_type_value) const
       
    85 {
       
    86     return (d_ptr->mData != right_type_value.d_ptr->mData) || (d_ptr->mType != right_type_value.d_ptr->mType);
       
    87 }
       
    88 
       
    89 EapQtExpandedEapType& EapQtExpandedEapType::operator=(const EapQtExpandedEapType &type)
       
    90 {
       
    91     // check if assigning to myself
       
    92     if (this != &type) {
       
    93         d_ptr.reset(new EapQtExpandedEapTypePrivate);
       
    94         d_ptr->mData = type.d_ptr->mData;
       
    95         d_ptr->mType = type.d_ptr->mType;
       
    96     }
       
    97     return *this;
       
    98 }