upnp/upnpstack/serviceframework/src/upnpignorecontenthandler.cpp
changeset 0 f5a58ecadc66
equal deleted inserted replaced
-1:000000000000 0:f5a58ecadc66
       
     1 /** @file
       
     2 * Copyright (c) 2007 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:  Implements the CUpnpIgnoreContentHandler class
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #include "upnpignorecontenthandler.h"
       
    20 #include "upnpcontenthandlerscontroller.h"
       
    21 
       
    22 // -----------------------------------------------------------------------------
       
    23 // CUpnpIgnoreContentHandler::NewL
       
    24 // Two-phased constructor
       
    25 // -----------------------------------------------------------------------------
       
    26 //
       
    27 CUpnpIgnoreContentHandler* CUpnpIgnoreContentHandler::NewL(
       
    28     CUpnpContentHandlersController& aController )
       
    29     {
       
    30     CUpnpIgnoreContentHandler* dummyContentHandler = 
       
    31         CUpnpIgnoreContentHandler::NewLC( aController );
       
    32     CleanupStack::Pop( dummyContentHandler );
       
    33     return dummyContentHandler;
       
    34     }
       
    35 
       
    36 // -----------------------------------------------------------------------------
       
    37 // CUpnpIgnoreContentHandler::NewLC
       
    38 // Two-phased constructor. Leaves the object on the CleanupStack
       
    39 // -----------------------------------------------------------------------------
       
    40 //
       
    41 CUpnpIgnoreContentHandler* CUpnpIgnoreContentHandler::NewLC(
       
    42     CUpnpContentHandlersController& aController )
       
    43     {
       
    44     CUpnpIgnoreContentHandler* dummyContentHandler = 
       
    45         new (ELeave) CUpnpIgnoreContentHandler( aController );
       
    46     CleanupStack::PushL( dummyContentHandler );
       
    47     return dummyContentHandler;
       
    48     }
       
    49 
       
    50 // -----------------------------------------------------------------------------
       
    51 // CUpnpContentHandler::OnStartElementL
       
    52 // This method is a callback to indicate an element has been parsed.
       
    53 // -----------------------------------------------------------------------------
       
    54 //
       
    55 void CUpnpIgnoreContentHandler::OnStartElementL( const RTagInfo& /*aElement*/, 
       
    56     const RAttributeArray& /*aAttributes*/ )
       
    57     {
       
    58     ++iOpenedTagCounter;
       
    59     }
       
    60 
       
    61 // -----------------------------------------------------------------------------
       
    62 // CUpnpIgnoreContentHandler::OnEndElementL
       
    63 // This method is a callback to indicate the end of the element has been reached.
       
    64 // -----------------------------------------------------------------------------
       
    65 //
       
    66 void CUpnpIgnoreContentHandler::OnEndElementL( const RTagInfo& /*aElement*/ )
       
    67     {
       
    68     ASSERT( iOpenedTagCounter > 0 );
       
    69     --iOpenedTagCounter;
       
    70     if ( iOpenedTagCounter == 0 )
       
    71         {
       
    72         iController.SetPreviousContentHandler();
       
    73         }
       
    74     }
       
    75 
       
    76 // -----------------------------------------------------------------------------
       
    77 // CUpnpIgnoreContentHandler::OnContentL
       
    78 // This method is a callback that sends the content of the element.
       
    79 // -----------------------------------------------------------------------------
       
    80 //
       
    81 void CUpnpIgnoreContentHandler::OnContentL( const TDesC8& /*aBytes*/ )
       
    82     {
       
    83     }
       
    84     
       
    85 // -----------------------------------------------------------------------------
       
    86 // CUpnpIgnoreContentHandler::CUpnpIgnoreContentHandler
       
    87 // Constructor
       
    88 // -----------------------------------------------------------------------------
       
    89 //
       
    90 CUpnpIgnoreContentHandler::CUpnpIgnoreContentHandler(
       
    91     CUpnpContentHandlersController& aController ) :
       
    92     CUpnpContentHandler( aController ), iOpenedTagCounter( 1 )
       
    93     {
       
    94     }
       
    95 
       
    96 //  End of File