webservices/wsstar/wsstarmessagehandlers/src/wsstaraddressingepr.cpp
changeset 0 62f9d29f7211
equal deleted inserted replaced
-1:000000000000 0:62f9d29f7211
       
     1 /*
       
     2 * Copyright (c) 2006-2006 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 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 #include "wsstaraddressingepr.h"
       
    26 
       
    27 using namespace WSStarAddressing;
       
    28 
       
    29 CWSStarAddressingEPR* CWSStarAddressingEPR::NewL(CSenElement& aParent, const TDesC8& aLocalName, 
       
    30                                                  const TDesC8& aContent, const TDesC8& aVersion)
       
    31     {
       
    32     CWSStarAddressingEPR* self = NewLC(aParent, aLocalName, aContent, aVersion);
       
    33     CleanupStack::Pop(self);
       
    34     return self;
       
    35     }
       
    36 
       
    37 CWSStarAddressingEPR* CWSStarAddressingEPR::NewLC(CSenElement& aParent, const TDesC8& aLocalName, 
       
    38                                                   const TDesC8& aContent, const TDesC8& aVersion)
       
    39     {
       
    40     CWSStarAddressingEPR* self = new (ELeave) CWSStarAddressingEPR();
       
    41     CleanupStack::PushL (self);
       
    42     self->ConstructL(aParent, aLocalName, aContent, aVersion);
       
    43     return self;
       
    44     }
       
    45 
       
    46 
       
    47 // Constructor
       
    48 CWSStarAddressingEPR::CWSStarAddressingEPR()
       
    49     {
       
    50     }
       
    51 
       
    52 // Destructor
       
    53 CWSStarAddressingEPR::~CWSStarAddressingEPR()
       
    54     {
       
    55     }
       
    56 
       
    57 // Second phase construction.
       
    58 void CWSStarAddressingEPR::ConstructL(CSenElement& aParent, const TDesC8& aLocalName, 
       
    59                                         const TDesC8& aContent, const TDesC8& aVersion)
       
    60     {
       
    61     CSenXmlElement::BaseConstructL(aLocalName);
       
    62     SetNamespaceL(KAddressingPrefix(), aVersion);
       
    63     SetParent(&aParent);
       
    64     CSenElement* elemAddress = CreateElementL(KAddressingPrefix(), KAddressName);
       
    65     CleanupStack::PushL(elemAddress);
       
    66     elemAddress->SetContentL(aContent);
       
    67     AddElementL(*elemAddress);
       
    68     CleanupStack::Pop(elemAddress);
       
    69     }
       
    70 
       
    71 void CWSStarAddressingEPR::AddDeviceAddressL(const TDesC8& aMwsNamespace, const TDesC8& aContent)
       
    72     {
       
    73     CSenElement* elemRefProp = CreateElementL(KAddressingPrefix(),KReferencePropertiesName);
       
    74     CleanupStack::PushL(elemRefProp);
       
    75     AddElementL(*elemRefProp);
       
    76     CleanupStack::Pop(elemRefProp);
       
    77     CSenElement& elemDeviceAddress = 
       
    78         elemRefProp->AddElementL(aMwsNamespace,WSStarAddressingEPR::KDeviceAddressName, 
       
    79                                     WSStarAddressingEPR::KDeviceAddressQName);
       
    80     elemDeviceAddress.SetContentL(aContent);
       
    81     }
       
    82 // END OF FILE
       
    83