xml/xmldomandxpath/src/xmlenginedom/xmlengfileoutputstream.h
changeset 0 e35f40988205
equal deleted inserted replaced
-1:000000000000 0:e35f40988205
       
     1 // Copyright (c) 2006-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 
       
    19 
       
    20 /**
       
    21  @file
       
    22  @internalComponent
       
    23  @released
       
    24 */
       
    25 #ifndef XMLENGTFILEOUTPUTSTREAM_H
       
    26 #define XMLENGTFILEOUTPUTSTREAM_H
       
    27 
       
    28 #include <f32file.h>
       
    29 #include <xml/dom/xmlengoutputstream.h>
       
    30 
       
    31 
       
    32 
       
    33 /**
       
    34  * TXmlEngFileOutputStream is used by XML Engine to serialize XML data from file.
       
    35  *
       
    36  */
       
    37 class TXmlEngFileOutputStream : public MXmlEngOutputStream
       
    38 	{
       
    39 public:
       
    40     /**
       
    41      * Default constructor
       
    42      *
       
    43      * @param aFile Instance of class RFile
       
    44      * @param aRFs File server handle   
       
    45      */
       
    46     TXmlEngFileOutputStream(RFile& aFile,RFs& aRFs);
       
    47     
       
    48     /**
       
    49      * Callback for writing a buffer with data to output stream
       
    50      *
       
    51      * @return number of bytes written or -1 in case of error
       
    52      */	
       
    53     TInt Write(const TDesC8 &aBuffer);
       
    54     
       
    55     /**
       
    56      * Callback for closing output stream
       
    57      *
       
    58      * @return 
       
    59      *       0 is succeeded, 
       
    60      *      -1 in case of error
       
    61      */		
       
    62     TInt Close();
       
    63     
       
    64     /**
       
    65      * Checks error flag
       
    66      *
       
    67      * @return error code
       
    68      */				
       
    69     TInt CheckError();
       
    70 
       
    71 private:
       
    72 
       
    73     void WriteL(const TDesC8 &aBuffer);
       
    74 			
       
    75 private:
       
    76     /** 
       
    77      *Instance of class RFile 
       
    78      */
       
    79     RFile iFile;
       
    80     
       
    81     /**
       
    82      * File server handle   
       
    83      */
       
    84     RFs iRFs;
       
    85     
       
    86     /** Error flag **/
       
    87     TInt iError;
       
    88     
       
    89     /** Drive No. **/
       
    90     TInt iDrive;
       
    91 }; 
       
    92 
       
    93 
       
    94 
       
    95 #endif /* XMLENGTFILEOUTPUTSTREAM_H */