xml/libxml2libs/test/xmlengtester/xmlengtester_target/src/testfileoutputstream.cpp
changeset 0 e35f40988205
equal deleted inserted replaced
-1:000000000000 0:e35f40988205
       
     1 // Copyright (c) 2005-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 // Text node functions
       
    15 //
       
    16 
       
    17 
       
    18 #include "TestFileOutputStream.h"
       
    19 
       
    20 TInt CTestFileOutputStream::Write(const TDesC8 &aBuffer)
       
    21 	{
       
    22 	TRAP(iError,WriteL(aBuffer));
       
    23 	if(iError)
       
    24 	    {
       
    25     	return -1;
       
    26 	    }
       
    27 	return aBuffer.Size();
       
    28 	};
       
    29 	
       
    30 TInt CTestFileOutputStream::Close()
       
    31 	{
       
    32 	return KErrNone;
       
    33 	}
       
    34 	
       
    35 TInt CTestFileOutputStream::CheckError()
       
    36     {
       
    37     return iError;
       
    38     }
       
    39 	
       
    40 CTestFileOutputStream::CTestFileOutputStream(RFile& aFile,RFs& aRFs)
       
    41 	{
       
    42 	iError = KErrNone;
       
    43 	iFile = aFile;
       
    44 	iRFs = aRFs;
       
    45 	}
       
    46    
       
    47 void CTestFileOutputStream::WriteL(const TDesC8 &aBuffer)
       
    48 	{
       
    49 	TInt drive;
       
    50 	TDriveInfo drInfo;
       
    51 	User::LeaveIfError(iFile.Drive(drive,drInfo));
       
    52 	User::LeaveIfError(iFile.Write(aBuffer));
       
    53 	}
       
    54