diff -r 000000000000 -r 7f85d04be362 upnpavcontroller/upnpxmlparser/inc/upnpobjectstack.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/upnpavcontroller/upnpxmlparser/inc/upnpobjectstack.inl Thu Dec 17 08:52:00 2009 +0200 @@ -0,0 +1,118 @@ +/* +* Copyright (c) 2006 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: Stack for XML SAX Parser. +* +*/ + + + + + + +// -------------------------------------------------------------------------- +// CUPnPObjectStack::CUPnPObjectStack +// See upnpobjectstack.h +// -------------------------------------------------------------------------- +inline CUPnPObjectStack::CUPnPObjectStack() + { + } + +// -------------------------------------------------------------------------- +// CUPnPObjectStack::~CUPnPObjectStack +// See upnpobjectstack.h +// -------------------------------------------------------------------------- +inline CUPnPObjectStack::~CUPnPObjectStack() + { + iStack->ResetAndDestroy(); + delete iStack; + } + +// -------------------------------------------------------------------------- +// CUPnPObjectStack::NewL +// See upnpobjectstack.h +// -------------------------------------------------------------------------- +inline CUPnPObjectStack* CUPnPObjectStack::NewL() + { + CUPnPObjectStack* self = new (ELeave) CUPnPObjectStack(); + CleanupStack::PushL(self); + self->iStack = new (ELeave) RPointerArray(); + CleanupStack::Pop( self ); + return self; + } + +// -------------------------------------------------------------------------- +// CUPnPObjectStack::Pop +// See upnpobjectstack.h +// -------------------------------------------------------------------------- +inline CUpnpObject* CUPnPObjectStack::Pop() + { + CUpnpObject* temp = NULL; + + if( Count() > 0 ) + { + CUpnpObject* temp = iStack->operator[](iStack->Count() - 1); + iStack->Remove(iStack->Count() - 1); + } + return temp; + } + +// -------------------------------------------------------------------------- +// CUPnPObjectStack::Top +// See upnpobjectstack.h +// -------------------------------------------------------------------------- +inline CUpnpObject* CUPnPObjectStack::Top() + { + if( Count() > 0 ) + { + return iStack->operator[](iStack->Count() - 1); + } + return NULL; + } + +// -------------------------------------------------------------------------- +// CUPnPObjectStack::PushL +// See upnpobjectstack.h +// -------------------------------------------------------------------------- +inline void CUPnPObjectStack::PushL( CUpnpObject* aObject ) + { + iStack->AppendL( aObject ); + } + +// -------------------------------------------------------------------------- +// CUPnPObjectStack::Count +// See upnpobjectstack.h +// -------------------------------------------------------------------------- +inline TInt CUPnPObjectStack::Count() + { + return iStack->Count(); + } + +// -------------------------------------------------------------------------- +// CUPnPObjectStack::Reset +// See upnpobjectstack.h +// -------------------------------------------------------------------------- +inline void CUPnPObjectStack::Reset() + { + iStack->Reset(); + } + +// -------------------------------------------------------------------------- +// CUPnPObjectStack::ResetAndDestroy +// See upnpobjectstack.h +// -------------------------------------------------------------------------- +inline void CUPnPObjectStack::ResetAndDestroy() + { + iStack->ResetAndDestroy(); + } +