| API Docs for SAX and DOM |

Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members

# DOMBuilder.hpp

Go to the documentation of this file.

    00001 #ifndef DOMBuilder_HEADER_GUARD_
    00002 #define DOMBuilder_HEADER_GUARD_
    00003
    00004 /*
    00005  * The Apache Software License, Version 1.1
    00006  *
    00007  * Copyright (c) 2002 The Apache Software Foundation.  All rights
    00008  * reserved.
    00009  *
    00010  * Redistribution and use in source and binary forms, with or without
    00011  * modification, are permitted provided that the following conditions
    00012  * are met:
    00013  *
    00014  * 1. Redistributions of source code must retain the above copyright
    00015  *    notice, this list of conditions and the following disclaimer.
    00016  *
    00017  * 2. Redistributions in binary form must reproduce the above copyright
    00018  *    notice, this list of conditions and the following disclaimer in
    00019  *    the documentation and/or other materials provided with the
    00020  *    distribution.
    00021  *
    00022  * 3. The end-user documentation included with the redistribution,
    00023  *    if any, must include the following acknowledgment:
    00024  *       "This product includes software developed by the
    00025  *        Apache Software Foundation (http://www.apache.org/)."
    00026  *    Alternately, this acknowledgment may appear in the software itself,
    00027  *    if and wherever such third-party acknowledgments normally appear.
    00028  *
    00029  * 4. The names "Xerces" and "Apache Software Foundation" must
    00030  *    not be used to endorse or promote products derived from this
    00031  *    software without prior written permission. For written
    00032  *    permission, please contact apache\@apache.org.
    00033  *
    00034  * 5. Products derived from this software may not be called "Apache",
    00035  *    nor may "Apache" appear in their name, without prior written
    00036  *    permission of the Apache Software Foundation.
    00037  *
    00038  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    00039  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    00040  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    00041  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    00042  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    00043  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    00044  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    00045  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    00046  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    00047  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    00048  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    00049  * SUCH DAMAGE.
    00050  * ====================================================================
    00051  *
    00052  * This software consists of voluntary contributions made by many
    00053  * individuals on behalf of the Apache Software Foundation, and was
    00054  * originally based on software copyright (c) 2001, International
    00055  * Business Machines, Inc., http://www.ibm.com .  For more information
    00056  * on the Apache Software Foundation, please see
    00057  * <http://www.apache.org/>.
    00058  */
    00059
    00060 /*
    00061  * $Id: DOMBuilder.hpp,v 1.11 2003/03/07 19:58:58 tng Exp $
    00062  *
    00063  */
    00064
    00065
    00066 #include <xercesc/util/XercesDefs.hpp>
    00067
    00068 XERCES_CPP_NAMESPACE_BEGIN
    00069
    00070
    00071 class DOMErrorHandler;
    00072 class DOMEntityResolver;
    00073 class DOMInputSource;
    00074 class DOMBuilderFilter;
    00075 class DOMNode;
    00076 class DOMDocument;
    00077 class Grammar;
    00078
    00089 class  DOMBuilder
    00090 {
    00091 protected :
    00092     // -----------------------------------------------------------------------
    00093     //  Hidden constructors
    00094     // -----------------------------------------------------------------------
    00097     DOMBuilder() {};
    00099
    00100 private:
    00101     // -----------------------------------------------------------------------
    00102     // Unimplemented constructors and operators
    00103     // -----------------------------------------------------------------------
    00106     DOMBuilder(const DOMBuilder &);
    00107     DOMBuilder & operator = (const DOMBuilder &);
    00109
    00110 public:
    00111     // -----------------------------------------------------------------------
    00112     //  All constructors are hidden, just the destructor is available
    00113     // -----------------------------------------------------------------------
    00120     virtual ~DOMBuilder() {};
    00122
    00123     // -----------------------------------------------------------------------
    00124     //  Class types
    00125     // -----------------------------------------------------------------------
    00155     enum ActionType
    00156     {
    00157         ACTION_REPLACE            = 1,
    00158         ACTION_APPEND_AS_CHILDREN = 2,
    00159         ACTION_INSERT_AFTER       = 3,
    00160         ACTION_INSERT_BEFORE      = 4
    00161     };
    00163
    00164     // -----------------------------------------------------------------------
    00165     //  Virtual DOMBuilder interface
    00166     // -----------------------------------------------------------------------
    00169
    00170     // -----------------------------------------------------------------------
    00171     //  Getter methods
    00172     // -----------------------------------------------------------------------
    00173
    00185     virtual DOMErrorHandler* getErrorHandler() = 0;
    00186
    00198     virtual const DOMErrorHandler* getErrorHandler() const = 0;
    00199
    00211     virtual DOMEntityResolver* getEntityResolver() = 0;
    00212
    00224     virtual const DOMEntityResolver* getEntityResolver() const = 0;
    00225
    00237     virtual DOMBuilderFilter* getFilter() = 0;
    00238
    00250     virtual const DOMBuilderFilter* getFilter() const = 0;
    00251
    00252     // -----------------------------------------------------------------------
    00253     //  Setter methods
    00254     // -----------------------------------------------------------------------
    00272     virtual void setErrorHandler(DOMErrorHandler* const handler) = 0;
    00273
    00293     virtual void setEntityResolver(DOMEntityResolver* const handler) = 0;
    00294
    00316     virtual void setFilter(DOMBuilderFilter* const filter) = 0;
    00317
    00318     // -----------------------------------------------------------------------
    00319     //  Feature methods
    00320     // -----------------------------------------------------------------------
    00344     virtual void setFeature(const XMLCh* const name, const bool state) = 0;
    00345
    00361     virtual bool getFeature(const XMLCh* const name) const = 0;
    00362
    00379     virtual bool canSetFeature(const XMLCh* const name, const bool state) const = 0;
    00380
    00381     // -----------------------------------------------------------------------
    00382     //  Parsing methods
    00383     // -----------------------------------------------------------------------
    00414     virtual DOMDocument* parse(const DOMInputSource& source) = 0;
    00415
    00443     virtual DOMDocument* parseURI(const XMLCh* const systemId) = 0;
    00444
    00471     virtual DOMDocument* parseURI(const char* const systemId) = 0;
    00472
    00501     virtual void parseWithContext
    00502     (
    00503         const   DOMInputSource& source
    00504         ,       DOMNode* const contextNode
    00505         , const short action
    00506     ) = 0;
    00508
    00509     // -----------------------------------------------------------------------
    00510     //  Non-standard Extension
    00511     // -----------------------------------------------------------------------
    00514
    00536     virtual void* getProperty(const XMLCh* const name) const = 0 ;
    00537
    00559     virtual void setProperty(const XMLCh* const name, void* value) = 0 ;
    00560
    00567     virtual void              release() = 0;
    00568
    00592     virtual void              resetDocumentPool() = 0;
    00593
    00621     virtual Grammar* loadGrammar(const DOMInputSource& source,
    00622                                  const short grammarType,
    00623                                  const bool toCache = false) = 0;
    00624
    00650     virtual Grammar* loadGrammar(const XMLCh* const systemId,
    00651                                  const short grammarType,
    00652                                  const bool toCache = false) = 0;
    00653
    00679     virtual Grammar* loadGrammar(const char* const systemId,
    00680                                  const short grammarType,
    00681                                  const bool toCache = false) = 0;
    00682
    00689     virtual Grammar* getGrammar(const XMLCh* const nameSpaceKey) const = 0;
    00690
    00696     virtual Grammar* getRootGrammar() const = 0;
    00697
    00704     virtual const XMLCh* getURIText(unsigned int uriId) const = 0;
    00705
    00709     virtual void resetCachedGrammarPool() = 0;
    00710
    00716     virtual unsigned int getSrcOffset() const = 0;
    00717
    00719
    00720 };
    00721
    00722
    00723 XERCES_CPP_NAMESPACE_END
    00724
    00725 #endif

Copyright © 2000 The Apache Software Foundation. All Rights Reserved.