networkprotocolmodules/common/suplrrlpasn1/src/suplasn1decoder.cpp
changeset 0 9cfd9a3ee49c
equal deleted inserted replaced
-1:000000000000 0:9cfd9a3ee49c
       
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Location Based Services SUPL ASN1 Decoder API
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalTechnology
       
    21  
       
    22 */
       
    23 
       
    24 #include <e32base.h>
       
    25 #include "suplasn1decoder.h"
       
    26 #include "suplasn1decoderimpl.h"
       
    27 #include "supldevloggermacros.h" 
       
    28 
       
    29 
       
    30 /**
       
    31 Provides SUPL ASN1 decoding functionality to the SUPL Protocol Module.
       
    32 
       
    33 @return an Instance of the SUPL ASN1 decoder. The calling application becomes 
       
    34 the owner of the returned instance and is responsible for its disposal.
       
    35 
       
    36 @internalTechnology
       
    37 */
       
    38 EXPORT_C CSuplAsn1Decoder* CSuplAsn1Decoder::NewL()
       
    39 	{
       
    40 	SUPLLOG(ELogP1, "CSuplAsn1Decoder::NewL() Begin\n");
       
    41 	CSuplAsn1Decoder* newObj = new (ELeave) CSuplAsn1Decoder();
       
    42 	CleanupStack::PushL(newObj);
       
    43 	newObj->ConstructL();
       
    44 	SUPLLOG(ELogP1, "CSuplAsn1Decoder::NewL() End\n");
       
    45 	CleanupStack::Pop(newObj);
       
    46 	return newObj;
       
    47 	}
       
    48 	
       
    49 /**
       
    50 Destructor
       
    51 
       
    52 @internalTechnology
       
    53 */
       
    54 CSuplAsn1Decoder::~CSuplAsn1Decoder()
       
    55 	{
       
    56 	SUPLLOG(ELogP1, "CSuplAsn1Decoder::~CSuplAsn1Decoder() Begin\n");
       
    57 	delete iImpl;
       
    58 	iImpl = NULL;
       
    59 	SUPLLOG(ELogP1, "CSuplAsn1Decoder::~CSuplAsn1Decoder() End\n");
       
    60 	}
       
    61 	
       
    62 /**
       
    63 Default constructor.
       
    64 
       
    65 @internalTechnology
       
    66 */
       
    67 CSuplAsn1Decoder::CSuplAsn1Decoder()
       
    68 	{
       
    69 	}
       
    70 
       
    71 /**
       
    72 2nd phase constructor. 
       
    73 Creates and assigns all the required internal resources.
       
    74 
       
    75 @internalTechnology
       
    76 
       
    77 */
       
    78 void CSuplAsn1Decoder::ConstructL()
       
    79 	{
       
    80 	iImpl = CSuplAsn1DecoderImpl::NewL();
       
    81 	}
       
    82 
       
    83 /**
       
    84 Passes an ASN1 encoded SUPL message to be decoded.
       
    85 
       
    86 A system requiring concurrent access to a channel must provide its own access 
       
    87 control mechanism.
       
    88 
       
    89 @return a CSuplMessageBase derived object encapsulating the decoded message
       
    90 data. The calling application becomes the owner of the returned object and 
       
    91 is responsible for its disposal.
       
    92 
       
    93 @internalTechnology
       
    94 
       
    95 */
       
    96 EXPORT_C CSuplMessageBase* CSuplAsn1Decoder::DecodeL(const TPtrC8* aBuf, TInt& aError)
       
    97 	{
       
    98 	return iImpl->DecodeL(aBuf, aError);
       
    99 	}
       
   100