xml/libxml2libs/test/xmlengtester/xmlengtester_target/inc/testfileoutputstream.h
changeset 0 e35f40988205
child 24 74f0b3eb154c
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 // Interface class describing class that may be used as
       
    15 // output stream for dom tree
       
    16 //
       
    17 
       
    18 #ifndef CTestFileOutputStream_H_INCLUDED
       
    19 #define CTestFileOutputStream_H_INCLUDED
       
    20 
       
    21 #include <f32file.h>
       
    22 #include "XmlEngOutputStream.h"
       
    23 
       
    24 
       
    25 
       
    26 /**
       
    27  * TXmlEngFileOutputStream is used by XML Engine to serialize XML data from file.
       
    28  *  XmlEngineDOM.lib
       
    29  * @since S60 v3.2
       
    30  */
       
    31 class CTestFileOutputStream : public MXmlEngOutputStream
       
    32 	{
       
    33 public:
       
    34     /**
       
    35      * Default constructor
       
    36      *
       
    37      * @since S60 v3.2
       
    38      * @param aFile Instance of class RFile
       
    39      * @param aRFs File server handle   
       
    40      */
       
    41     CTestFileOutputStream(RFile& aFile,RFs& aRFs);
       
    42     
       
    43     /**
       
    44      * Callback for writing a buffer with data to output stream
       
    45      *
       
    46      * @since S60 v3.2
       
    47      * @return number of bytes written or -1 in case of error
       
    48      */	
       
    49     TInt Write(const TDesC8 &aBuffer);
       
    50     
       
    51     /**
       
    52      * Callback for closing output stream
       
    53      *
       
    54      * @since S60 v3.2
       
    55      * @return 
       
    56      *       0 is succeeded, 
       
    57      *      -1 in case of error
       
    58      */		
       
    59     TInt Close();
       
    60     
       
    61     /**
       
    62      * Checks error flag
       
    63      *
       
    64      * @since S60 v3.2
       
    65      * @return error code
       
    66      */				
       
    67     TInt CheckError();
       
    68 
       
    69 private:
       
    70 
       
    71     void WriteL(const TDesC8 &aBuffer);
       
    72 			
       
    73 private:
       
    74     /** 
       
    75      *Instance of class RFile 
       
    76      */
       
    77     RFile iFile;
       
    78     
       
    79     /**
       
    80      * File server handle   
       
    81      */
       
    82     RFs iRFs;
       
    83     
       
    84     /** Error flag **/
       
    85     TInt iError;
       
    86 }; 
       
    87 
       
    88 
       
    89 
       
    90 #endif /* CTestFileOutputStream_H_INCLUDED */