upnpmediaserver/contentdirectoryservice/src/upnpattributebean.cpp
author Pat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:16:49 +0100
branchRCL_3
changeset 13 e0762c15653a
parent 12 cdcbf344a1d3
permissions -rw-r--r--
Revert incorrect RCL_3 drop: Revision: 201012 Kit: 201035
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
/** @file
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). 
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
* which accompanies  this distribution, and is available 
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
*
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
*
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
* Contributors:
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
*
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    14
* Description:  Attribute table data handler
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
*
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
*/
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
// INCLUDE FILES
13
e0762c15653a Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 12
diff changeset
    21
#include <xmlengdom.h>
0
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    22
#include "upnpattributebean.h"
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
#include "upnpcontentdirectoryglobals.h"
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    24
#include <upnpattribute.h>
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    25
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    26
// ============================ MEMBER FUNCTIONS ===============================
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    27
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    28
// -----------------------------------------------------------------------------
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    29
// CUpnpAttributeBean::CUpnpAttributeBean
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    30
// C++ default constructor can NOT contain any code, that
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    31
// might leave.
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    32
// -----------------------------------------------------------------------------
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    33
//
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    34
CUpnpAttributeBean::CUpnpAttributeBean()
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    35
{
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    36
}
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    37
// -----------------------------------------------------------------------------
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    38
// CUpnpAttributeBean::ConstructL
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    39
// Symbian 2nd phase constructor can leave.
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    40
// -----------------------------------------------------------------------------
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    41
//
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    42
void CUpnpAttributeBean::ConstructL()
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    43
{
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    44
	iAtrValue = KNullString8().AllocL();
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    45
}
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    46
// -----------------------------------------------------------------------------
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    47
// CUpnpAttributeBean::NewLC
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    48
// Two-phased constructor.
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    49
// -----------------------------------------------------------------------------
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    50
//
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    51
CUpnpAttributeBean* CUpnpAttributeBean::NewLC()
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    52
{
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    53
    CUpnpAttributeBean* self = new( ELeave ) CUpnpAttributeBean;
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    54
    CleanupStack::PushL( self );
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    55
    self->ConstructL();
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    56
    return self;
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    57
}
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    58
// -----------------------------------------------------------------------------
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    59
// CUpnpAttributeBean::NewLC
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    60
// Two-phased constructor.
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    61
// -----------------------------------------------------------------------------
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    62
//
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    63
CUpnpAttributeBean* CUpnpAttributeBean::NewLC(const RDbRowSet& aRowSet)
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    64
{
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    65
    CUpnpAttributeBean* self = NewLC();
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    66
    self->SetL(aRowSet);
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    67
    return self;
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    68
}    
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    69
// -----------------------------------------------------------------------------
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    70
// CUpnpAttributeBean::~CUpnpAttributeBean
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    71
// Destructor
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    72
// -----------------------------------------------------------------------------
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    73
// 
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    74
CUpnpAttributeBean::~CUpnpAttributeBean()
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    75
{
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    76
    delete iAtrName;
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    77
    delete iAtrValue;
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    78
}
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    79
// -----------------------------------------------------------------------------
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    80
// CUpnpAttributeBean::SetL
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    81
// (other items were commented in a header).
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    82
// -----------------------------------------------------------------------------
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    83
//
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    84
void CUpnpAttributeBean::SetL(const RDbRowSet& aRowSet)
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    85
{
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    86
    // get cols' ids
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    87
    CDbColSet* colSet = aRowSet.ColSetL();
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    88
    CleanupStack::PushL(colSet);
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    89
    const TInt  idColNo         = colSet->ColNo(KAtrIdColName);
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    90
    const TInt  nameColNo       = colSet->ColNo(KAtrNameColName);
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    91
    const TInt  elmIdColNo      = colSet->ColNo(KAtrElmIdColName);
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    92
    const TInt  isRequiredColNo = colSet->ColNo(KAtrIsRequiredColName);
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    93
    const TInt  valueColNo      = colSet->ColNo(KAtrValueColName);
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    94
    CleanupStack::PopAndDestroy(colSet);
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    95
    
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    96
    // for each column call setter
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    97
    if( idColNo != KDbNullColNo )
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    98
    {
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    99
        SetAtrId( aRowSet.ColInt(idColNo) );
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   100
    }
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   101
    if( nameColNo != KDbNullColNo )
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   102
    {
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   103
        SetAtrNameL( aRowSet.ColDes8(nameColNo) );
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   104
    }
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   105
    if( elmIdColNo != KDbNullColNo )
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   106
    {
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   107
        SetAtrElmId( aRowSet.ColInt(elmIdColNo) );
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   108
    }
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   109
    if( isRequiredColNo != KDbNullColNo )
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   110
    {
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   111
        SetAtrIsRequired( aRowSet.ColUint8(isRequiredColNo) );
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   112
    }
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   113
    if( valueColNo != KDbNullColNo )
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   114
    {
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   115
        SetAtrValueL( aRowSet, valueColNo );
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   116
    }
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   117
}
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   118
// -----------------------------------------------------------------------------
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   119
// CUpnpAttributeBean::SetAtrValueL
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   120
// (other items were commented in a header).
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   121
// -----------------------------------------------------------------------------
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   122
//
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   123
void CUpnpAttributeBean::SetAtrValueL(const RDbRowSet& aRowSet, const TInt aColNo)
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   124
{
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   125
    delete iAtrValue;
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   126
    iAtrValue = 0;
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   127
    iAtrValue = ReadLongTextColL(aRowSet, aColNo);
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   128
}
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   129
// -----------------------------------------------------------------------------
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   130
// CUpnpAttributeBean::SetAtrValueL
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   131
// (other items were commented in a header).
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   132
// -----------------------------------------------------------------------------
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   133
//
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   134
void CUpnpAttributeBean::SetAtrValueL(const TDesC8& aVal)
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   135
{
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   136
	delete iAtrValue;
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   137
	iAtrValue = 0;
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   138
	iAtrValue = aVal.AllocL();
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   139
}
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   140
// -----------------------------------------------------------------------------
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   141
// CUpnpAttributeBean::SetAtrNameL
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   142
// (other items were commented in a header).
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   143
// -----------------------------------------------------------------------------
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   144
//
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   145
void CUpnpAttributeBean::SetAtrNameL(const TDesC8& aAtrName)
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   146
{
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   147
    delete iAtrName;
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   148
    iAtrName = NULL;
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   149
    iAtrName = aAtrName.AllocL();
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   150
}
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   151
// -----------------------------------------------------------------------------
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   152
// CUpnpAttributeBean::AttachToXmlElL
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   153
// (other items were commented in a header).
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   154
// -----------------------------------------------------------------------------
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   155
//
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   156
TXmlEngAttr CUpnpAttributeBean::AttachAttrL(TXmlEngElement aElement)
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   157
{
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   158
    // add attribute
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   159
    TXmlEngAttr ret = aElement.AddNewAttributeL( AtrName(), AtrValue() );
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   160
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   161
     return ret;
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   162
}
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   163
// -----------------------------------------------------------------------------
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   164
// CUpnpAttributeBean::CopyToUpnpElementL
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   165
// (other items were commented in a header).
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   166
// -----------------------------------------------------------------------------
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   167
//
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   168
void CUpnpAttributeBean::AttachAttrL(CUpnpElement* aElm)
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   169
{
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   170
    // create element
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   171
    CUpnpAttribute* atr = CUpnpAttribute::NewLC(*iAtrName);
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   172
	
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   173
	// copy values
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   174
	atr->SetValueL(*iAtrValue);
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   175
	
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   176
	// attach
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   177
	aElm->AddAttributeL(atr);
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   178
	
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   179
	// clean up
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   180
	CleanupStack::Pop(atr);
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   181
}
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   182
7f85d04be362 Revision: 200947
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   183
//  End of File