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