epoc32/include/xml/parser.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 parser.h
     1 // Copyright (c) 2003-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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __PARSER_H__
       
    17 #define __PARSER_H__
       
    18 
       
    19 /** 
       
    20 @file
       
    21 
       
    22 XML Framework CParser API header file.
       
    23 
       
    24 @publishedAll
       
    25 @released
       
    26 */
       
    27 
       
    28 #include <xml/contentprocessoruids.h> // needed for the typedef
       
    29 #include <xml/plugins/elementstack.h> // needed for the typedef
       
    30 
       
    31 class RFs;
       
    32 class RFile;
       
    33 
       
    34 namespace Xml
       
    35 {
       
    36 
       
    37 class MContentHandler;
       
    38 class RStringDictionaryCollection;
       
    39 class TParserImpl;
       
    40 class CMatchData;
       
    41 
       
    42 /** 
       
    43 If you need to parse xml this is the class you need to use.
       
    44 
       
    45 Default plain-text XML parser plug-in  supports following character set encodings: 
       
    46 
       
    47 ISO_8859_1
       
    48 US_ASCII
       
    49 UTF_8
       
    50 UTF_16
       
    51 UTF_16BE
       
    52 UTF_16LE
       
    53 
       
    54 @publishedAll
       
    55 @released
       
    56 */
       
    57 class CParser : public CBase
       
    58 	{
       
    59 public:
       
    60 	static IMPORT_C CParser* NewL(const TDesC8& aParserMimeType, MContentHandler& aCallback);
       
    61 	static IMPORT_C CParser* NewLC(const TDesC8& aParserMimeType, MContentHandler& aCallback);
       
    62 	
       
    63 	static IMPORT_C CParser* NewL(const CMatchData& aCriteria, MContentHandler& aCallback);
       
    64 	static IMPORT_C CParser* NewLC(const CMatchData& aCriteria, MContentHandler& aCallback);
       
    65 
       
    66 	virtual ~CParser();
       
    67 
       
    68 	IMPORT_C void ParseBeginL();
       
    69 	IMPORT_C void ParseBeginL(const TDesC8& aDocumentMimeType);
       
    70 	IMPORT_C void ParseBeginL(const CMatchData& aCriteria);	
       
    71 	IMPORT_C void ParseL(const TDesC8& aFragment);
       
    72 	IMPORT_C void ParseEndL();
       
    73 	
       
    74 	IMPORT_C void SetProcessorChainL(const RContentProcessorUids& aPlugins);
       
    75 
       
    76 	IMPORT_C TInt EnableFeature(TInt aParserFeature);
       
    77 	IMPORT_C TInt DisableFeature(TInt aParserFeature);
       
    78 	IMPORT_C TBool IsFeatureEnabled(TInt aParserFeature) const;
       
    79 
       
    80 	IMPORT_C void AddPreloadedDictionaryL(const TDesC8& aPublicId);
       
    81 
       
    82 	IMPORT_C RStringPool& StringPool();
       
    83 	IMPORT_C RStringDictionaryCollection& StringDictionaryCollection();
       
    84 	
       
    85 private:
       
    86 	CParser();
       
    87 	void ConstructL(const TDesC8& aParserMimeType, MContentHandler& aCallback);
       
    88 	void ConstructL(const CMatchData& aMatchData, MContentHandler& aCallback);
       
    89 	TParserImpl* iImpl;
       
    90 	};
       
    91 
       
    92 IMPORT_C void ParseL(CParser& aParser, const TDesC8& aDocument);
       
    93 IMPORT_C void ParseL(CParser& aParser, RFs& aFs, const TDesC& aFilename);
       
    94 IMPORT_C void ParseL(CParser& aParser, RFile& aFile);
       
    95 }
       
    96 
       
    97 #endif //__PARSER_H__