Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
2 * Copyright (c) 2004-2006 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: DOM parser functions
24 #ifndef XMLENGINE_DOMPARSER_H_INCLUDED
25 #define XMLENGINE_DOMPARSER_H_INCLUDED
29 class RXmlEngDOMImplementation;
30 class RXmlEngDocument;
33 * DOM parser class implements methods for parsing XML data.
35 * Parse XML data in one chunk. Data can be parsed from file
38 * Sample code for parsing from buffer:
40 * RXmlEngDOMImplementation domImpl;
41 * domImpl.OpenL(); ///< opening DOM implementation object
42 * RXmlEngDOMParser parser;
43 * parser.Open( domImpl ); ///< opening parser object
44 * RXmlEngDocument iDoc;
45 * iDoc =parser.ParseL( *aInput ); ///< parsing aInput - buffer
46 * iDoc.Close(); ///< closing all opened objects
51 * Sample code for parsing from file:
53 * RXmlEngDOMImplementation domImpl;
54 * domImpl.OpenL(); ///< opening DOM implementation object
55 * RXmlEngDOMParser parser;
56 * parser.Open( domImpl ); ///< opening parser object
57 * RXmlEngDocument iDoc;
58 * iDoc =parser.ParseFileL( aFileName ); ///< parsing from file
59 * iDoc.Close(); ///< closing all openend objects
64 * @lib XmlEngineDOM.lib
67 class RXmlEngDOMParser
73 IMPORT_C RXmlEngDOMParser();
79 * @param aDOMImpl DOM implementation object
80 * @return KErrNone if succeed.
82 IMPORT_C TInt Open(RXmlEngDOMImplementation& aDOMImpl);
89 IMPORT_C void Close();
92 * Parses chunk of XML data from memory buffer and builds DOM RXmlEngDocument.
95 * @param aBuffer XML data buffer
97 * @leave KXmlEngErrParsing or one of general codes (e.g. KErrNoMemory)
99 IMPORT_C void ParseChunkL(const TDesC8& aBuffer);
101 * Creates document from parsed chunks of data.
102 * Should be called after parsing of allchunks.
103 * Ownership over returned RXmlEngDocument object is transferred to the caller of the method.
106 * @return RXmlEngDocument created document.
108 * @leave KXmlEngErrParsing or one of general codes (e.g. KErrNoMemory)
110 IMPORT_C RXmlEngDocument FinishL();
113 * Parses XML file and builds DOM RXmlEngDocument
116 * @param aRFs File server session
117 * @param aFileName File name
118 * @param aChunkSize Size of chunk (if 0 chunks won't be used)
119 * @return Document handle
121 * @leave KXmlEngErrParsing or one of general codes (e.g. KErrNoMemory)
123 IMPORT_C RXmlEngDocument ParseFileL(RFs &aRFs, const TDesC& aFileName, TUint aChunkSize = 0);
126 * Parses XML file and builds DOM RXmlEngDocument
129 * @param aFileName File name
130 * @param aChunkSize Size of chunk (if 0 chunks won't be used)
131 * @return Document handle
133 * @leave KXmlEngErrParsing or one of general codes (e.g. KErrNoMemory)
135 IMPORT_C RXmlEngDocument ParseFileL(const TDesC& aFileName, TUint aChunkSize = 0);
138 * Parses XML data from memory buffer and builds DOM RXmlEngDocument without chunks
141 * @param aBuffer XML data buffer
142 * @return Document handle
144 * @leave KXmlEngErrParsing code (besides system I/O error codes)
146 IMPORT_C RXmlEngDocument ParseL(const TDesC8& aBuffer);
149 * Return last parsing error code.
152 * @return positive number
154 * @note Error codes are positive numbers. User can find them
157 IMPORT_C TInt GetLastParsingError();
160 * Parses XML file and builds DOM RXmlEngDocument without usage of chunks
162 * @param aRFs File server session
163 * @param aFileName File name
164 * @return Document handle
166 * @leave KXmlEngErrParsing code (besides system I/O error codes)
168 RXmlEngDocument ParseFileWithoutChunksL(RFs& aRFs, const TDesC& aFileName);
171 * Cleanup internal data.
179 RXmlEngDOMImplementation* iImpl;
184 #endif /* XMLENGINE_DOMPARSER_H_INCLUDED */