| API Docs for SAX and DOM |
| Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members # XMLReaderFactory.hpp Go to the documentation of this file.
    00001 /*
    00002  * Copyright 1999-2000,2004 The Apache Software Foundation.
    00003  *
    00004  * Licensed under the Apache License, Version 2.0 (the "License");
    00005  * you may not use this file except in compliance with the License.
    00006  * You may obtain a copy of the License at
    00007  *
    00008  *      http://www.apache.org/licenses/LICENSE-2.0
    00009  *
    00010  * Unless required by applicable law or agreed to in writing, software
    00011  * distributed under the License is distributed on an "AS IS" BASIS,
    00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    00013  * See the License for the specific language governing permissions and
    00014  * limitations under the License.
    00015  */
    00016
    00017 /*
    00018  * $Log: XMLReaderFactory.hpp,v $
    00019  * Revision 1.7  2004/09/08 13:56:20  peiyongz
    00020  * Apache License Version 2.0
    00021  *
    00022  * Revision 1.6  2004/01/29 11:46:32  cargilld
    00023  * Code cleanup changes to get rid of various compiler diagnostic messages.
    00024  *
    00025  * Revision 1.5  2003/06/20 18:56:45  peiyongz
    00026  * Stateless Grammar Pool :: Part I
    00027  *
    00028  * Revision 1.4  2003/05/15 18:27:11  knoaman
    00029  * Partial implementation of the configurable memory manager.
    00030  *
    00031  * Revision 1.3  2002/11/04 14:55:45  tng
    00032  * C++ Namespace Support.
    00033  *
    00034  * Revision 1.2  2002/05/07 17:45:52  knoaman
    00035  * SAX2 documentation update.
    00036  *
    00037  * Revision 1.1.1.1  2002/02/01 22:22:09  peiyongz
    00038  * sane_include
    00039  *
    00040  * Revision 1.3  2000/08/30 22:21:37  andyh
    00041  * Unix Build script fixes.  Clean up some UNIX compiler warnings.
    00042  *
    00043  * Revision 1.2  2000/08/07 18:21:27  jpolast
    00044  * change  module to
    00045  *
    00046  * Revision 1.1  2000/08/02 18:02:35  jpolast
    00047  * initial checkin of sax2 implementation
    00048  * submitted by Simon Fell (simon@fell.com)
    00049  * and Joe Polastre (jpolast@apache.org)
    00050  *
    00051  *
    00052  */
    00053
    00054 #ifndef XMLREADERFACTORY_HPP
    00055 #define XMLREADERFACTORY_HPP
    00056
    00057 #include <xercesc/parsers/SAX2XMLReaderImpl.hpp>
    00058 #include <xercesc/sax/SAXException.hpp>
    00059
    00060 XERCES_CPP_NAMESPACE_BEGIN
    00061
    00062 class MemoryManager;
    00063 class XMLGrammarPool;
    00064
    00074 class  XMLReaderFactory
    00075 {
    00076 protected:                // really should be private, but that causes compiler warnings.
    00077     XMLReaderFactory() ;
    00078     ~XMLReaderFactory() ;
    00079
    00080 public:
    00081     static SAX2XMLReader * createXMLReader(
    00082                                                MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
    00083                                              , XMLGrammarPool* const gramPool = 0
    00084                                                ) ;
    00085     static SAX2XMLReader * createXMLReader(const XMLCh* className)  ;
    00086
    00087 private:
    00088     // -----------------------------------------------------------------------
    00089     //  Unimplemented constructors and operators
    00090     // -----------------------------------------------------------------------
    00091     XMLReaderFactory(const XMLReaderFactory&);
    00092     XMLReaderFactory& operator=(const XMLReaderFactory&);
    00093 };
    00094
    00095
    00096 inline SAX2XMLReader * XMLReaderFactory::createXMLReader(MemoryManager* const  manager
    00097                                                        , XMLGrammarPool* const gramPool)
    00098 {
    00099     return (SAX2XMLReader*)(new (manager) SAX2XMLReaderImpl(manager, gramPool));
    00100 }
    00101
    00102 inline SAX2XMLReader * XMLReaderFactory::createXMLReader(const XMLCh *)
    00103 {
    00104     throw SAXNotSupportedException();
    00105     // unimplemented
    00106     return 0;
    00107 }
    00108
    00109 XERCES_CPP_NAMESPACE_END
    00110
    00111 #endif

Copyright © 1994-2004 The Apache Software Foundation. All Rights Reserved.