os/kernelhwsrv/baseapitest/basesvs/validation/f32/sfsrv/src/T_FileActiveCallback.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2005-2009 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: 
    15 *
    16 */
    17 
    18 
    19 /**
    20 @test
    21 @internalComponent
    22 
    23 This contains CT_FileActiveCallback
    24 */
    25 
    26 //	User includes
    27 #include "T_FileActiveCallback.h"
    28 
    29 CT_FileActiveCallback* CT_FileActiveCallback::NewL(MActiveCallback& aCallback, TInt aPriority)
    30 /**
    31  * Two phase constructor
    32  */
    33 	{
    34 	CT_FileActiveCallback*	ret = NewLC(aCallback, aPriority);
    35 	CleanupStack::Pop(ret);
    36 	return ret;	
    37 	}
    38 
    39 CT_FileActiveCallback* CT_FileActiveCallback::NewLC(MActiveCallback& aCallback, TInt aPriority)
    40 /**
    41  * Two phase constructor
    42  */
    43 	{
    44 	CT_FileActiveCallback*	ret = new (ELeave) CT_FileActiveCallback(aCallback, aPriority);
    45 	CleanupStack::PushL(ret);
    46 	ret->ConstructL();
    47 	return ret;	
    48 	}
    49 
    50 CT_FileActiveCallback::CT_FileActiveCallback(MActiveCallback& aCallback, TInt aPriority)
    51 /**
    52  * Protected constructor. First phase construction
    53  */
    54 :	CActiveCallback(aCallback, aPriority),
    55     iFileData(NULL),
    56     iSection(NULL)
    57 	{
    58 	}
    59 	
    60 CT_FileActiveCallback::~CT_FileActiveCallback()
    61 	{ 	
    62 	delete iFileData;
    63 	iFileData = NULL;
    64 	}
    65 
    66 void CT_FileActiveCallback::Activate()
    67 	{
    68 	CActiveCallback::Activate(iAsyncErrorIndex);
    69 	}
    70 	
    71 void CT_FileActiveCallback::Activate(TInt aAsyncErrorIndex)
    72 	{
    73 	CActiveCallback::Activate(aAsyncErrorIndex);
    74 	}	
    75 
    76 TInt CT_FileActiveCallback::DecCount()
    77 	{
    78 	return --iCount;
    79 	}
    80 
    81 void CT_FileActiveCallback::SetSection(const TDesC& aSection)
    82 	{
    83 	this->iSection=const_cast<TDesC*>(&aSection);
    84 	}
    85 	
    86 void CT_FileActiveCallback::CreateFileDataBufferL(TInt aLength)
    87 	{
    88 	iFileData = HBufC8::NewL(aLength);
    89 	}
    90