diff -r 3785f754ee62 -r 5360b7ddc251 upnpsharing/upnpcontentserver/src/upnpsharingrequest.cpp --- a/upnpsharing/upnpcontentserver/src/upnpsharingrequest.cpp Fri Sep 17 08:31:21 2010 +0300 +++ b/upnpsharing/upnpcontentserver/src/upnpsharingrequest.cpp Mon Nov 01 12:37:49 2010 +0200 @@ -1,96 +1,101 @@ -/* -* Copyright (c) 2006-2007 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: CUpnpSharingRequest class implementation -* -*/ - - - - - - - -// INCLUDE FILES -#include "upnpsharingrequest.h" -#include "upnpcontentserverdefs.h" - -const TInt KDefaultItemCount = 2^32; //4294967296 - -using namespace UpnpContentServer; - -// ============================ MEMBER FUNCTIONS ============================= - -// -------------------------------------------------------------------------- -// CUpnpSharingRequest::CUpnpSharingRequest -// C++ default constructor can NOT contain any code, that -// might leave. -// -------------------------------------------------------------------------- -// - -CUpnpSharingRequest::CUpnpSharingRequest( TInt aKind ) - { - iKind = aKind; - iItemCount = KDefaultItemCount; - } - -// -------------------------------------------------------------------------- -// CUpnpSharingRequest::ConstructL -// Symbian 2nd phase constructor can leave. -// -------------------------------------------------------------------------- -// -void CUpnpSharingRequest::ConstructL( const RArray& aArr, - CDesCArray* aIdArray, - CDesCArray* aNameArray ) - { - for ( TInt i(0); i& aArr, - CDesCArray* aIdArray, - CDesCArray* aNameArray ) - { - CUpnpSharingRequest* self = new (ELeave) CUpnpSharingRequest( aKind ); - CleanupStack::PushL( self ); - self->ConstructL( aArr, - aIdArray, - aNameArray ); - CleanupStack::Pop( self ); - return self; - } - -// -------------------------------------------------------------------------- -// CUpnpSharingRequest::NewL -// Destructor -// -------------------------------------------------------------------------- -// -CUpnpSharingRequest::~CUpnpSharingRequest() - { - iSelections.Close(); - delete iObjectIds; - } - - -// End of File +/* +* Copyright (c) 2006-2007 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: CUpnpSharingRequest class implementation +* +*/ + +// INCLUDE FILES +#include "upnpsharingrequest.h" +#include "upnpcontentserverdefs.h" + + +using namespace UpnpContentServer; + +// ============================ MEMBER FUNCTIONS ============================= + +// -------------------------------------------------------------------------- +// CUpnpSharingRequest::CUpnpSharingRequest +// C++ default constructor can NOT contain any code, that +// might leave. +// -------------------------------------------------------------------------- +// + +CUpnpSharingRequest::CUpnpSharingRequest( + TUpnpMediaType aMediaType, + TInt aSharingType ) : + iMediaType( aMediaType ), + iSharingType( aSharingType ) + { + // empty + } + +// -------------------------------------------------------------------------- +// CUpnpSharingRequest::NewL +// Two-phased constructor. +// -------------------------------------------------------------------------- +// +CUpnpSharingRequest* CUpnpSharingRequest::NewL( + TUpnpMediaType aMediaType, + TInt aSharingType ) + { + CUpnpSharingRequest* self = + new (ELeave) CUpnpSharingRequest( aMediaType, aSharingType ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// -------------------------------------------------------------------------- +// CUpnpSharingRequest::SetSharingRequestInfoL +// Sets sharing request information arrays +// -------------------------------------------------------------------------- +// +void CUpnpSharingRequest::SetSharingRequestInfo( + RArray* aShareArr, + RArray* aUnshareArr, + CDesCArray* aClfIds ) + { + // take ownership of the arrays + iShareArr = aShareArr; + iUnshareArr = aUnshareArr; + iClfIds = aClfIds; + } + +// -------------------------------------------------------------------------- +// CUpnpSharingRequest::~CUpnpSharingRequest +// Destructor +// -------------------------------------------------------------------------- +// +CUpnpSharingRequest::~CUpnpSharingRequest() + { + // Destructor + if ( iShareArr ) + { + iShareArr->Close(); + delete iShareArr; + } + if ( iUnshareArr ) + { + iUnshareArr->Close(); + delete iUnshareArr; + } + if ( iClfIds ) + { + delete iClfIds; + } + } + + +// End of File