http://xml.apache.org/http://www.apache.org/http://www.w3.org/

Home

Readme
Release Info

Installation
Download
Build

FAQs
Samples
API Docs

DOM C++ Binding
Programming
Migration Guide

Feedback
Bug-Reporting
PDF Document

CVS Repository
Mail Archive

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  * Copyright 2002,2004 The Apache Software Foundation.
00006  * 
00007  * Licensed under the Apache License, Version 2.0 (the "License");
00008  * you may not use this file except in compliance with the License.
00009  * You may obtain a copy of the License at
00010  * 
00011  *      http://www.apache.org/licenses/LICENSE-2.0
00012  * 
00013  * Unless required by applicable law or agreed to in writing, software
00014  * distributed under the License is distributed on an "AS IS" BASIS,
00015  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00016  * See the License for the specific language governing permissions and
00017  * limitations under the License.
00018  */
00019 
00020 /*
00021  * $Id: DOMBuilder.hpp,v 1.12 2004/09/08 13:55:38 peiyongz Exp $
00022  *
00023  */
00024 
00025 
00026 #include <xercesc/util/XercesDefs.hpp>
00027 
00028 XERCES_CPP_NAMESPACE_BEGIN
00029 
00030 
00031 class DOMErrorHandler;
00032 class DOMEntityResolver;
00033 class DOMInputSource;
00034 class DOMBuilderFilter;
00035 class DOMNode;
00036 class DOMDocument;
00037 class Grammar;
00038 
00049 class  DOMBuilder
00050 {
00051 protected :
00052     // -----------------------------------------------------------------------
00053     //  Hidden constructors
00054     // -----------------------------------------------------------------------
00057     DOMBuilder() {};
00059 
00060 private:    
00061     // -----------------------------------------------------------------------
00062     // Unimplemented constructors and operators
00063     // -----------------------------------------------------------------------
00066     DOMBuilder(const DOMBuilder &);
00067     DOMBuilder & operator = (const DOMBuilder &);
00069 
00070 public:
00071     // -----------------------------------------------------------------------
00072     //  All constructors are hidden, just the destructor is available
00073     // -----------------------------------------------------------------------
00080     virtual ~DOMBuilder() {};
00082 
00083     // -----------------------------------------------------------------------
00084     //  Class types
00085     // -----------------------------------------------------------------------
00115     enum ActionType
00116     {
00117         ACTION_REPLACE            = 1,
00118         ACTION_APPEND_AS_CHILDREN = 2,
00119         ACTION_INSERT_AFTER       = 3,
00120         ACTION_INSERT_BEFORE      = 4
00121     };
00123 
00124     // -----------------------------------------------------------------------
00125     //  Virtual DOMBuilder interface
00126     // -----------------------------------------------------------------------
00129 
00130     // -----------------------------------------------------------------------
00131     //  Getter methods
00132     // -----------------------------------------------------------------------
00133 
00145     virtual DOMErrorHandler* getErrorHandler() = 0;
00146 
00158     virtual const DOMErrorHandler* getErrorHandler() const = 0;
00159 
00171     virtual DOMEntityResolver* getEntityResolver() = 0;
00172 
00184     virtual const DOMEntityResolver* getEntityResolver() const = 0;
00185 
00197     virtual DOMBuilderFilter* getFilter() = 0;
00198 
00210     virtual const DOMBuilderFilter* getFilter() const = 0;
00211 
00212     // -----------------------------------------------------------------------
00213     //  Setter methods
00214     // -----------------------------------------------------------------------
00232     virtual void setErrorHandler(DOMErrorHandler* const handler) = 0;
00233 
00253     virtual void setEntityResolver(DOMEntityResolver* const handler) = 0;
00254 
00276     virtual void setFilter(DOMBuilderFilter* const filter) = 0;
00277 
00278     // -----------------------------------------------------------------------
00279     //  Feature methods
00280     // -----------------------------------------------------------------------
00304     virtual void setFeature(const XMLCh* const name, const bool state) = 0;
00305 
00321     virtual bool getFeature(const XMLCh* const name) const = 0;
00322 
00339     virtual bool canSetFeature(const XMLCh* const name, const bool state) const = 0;
00340 
00341     // -----------------------------------------------------------------------
00342     //  Parsing methods
00343     // -----------------------------------------------------------------------
00374     virtual DOMDocument* parse(const DOMInputSource& source) = 0;
00375 
00403     virtual DOMDocument* parseURI(const XMLCh* const systemId) = 0;
00404 
00431     virtual DOMDocument* parseURI(const char* const systemId) = 0;
00432 
00461     virtual void parseWithContext
00462     (
00463         const   DOMInputSource& source
00464         ,       DOMNode* const contextNode
00465         , const short action
00466     ) = 0;
00468 
00469     // -----------------------------------------------------------------------
00470     //  Non-standard Extension
00471     // -----------------------------------------------------------------------
00474 
00496     virtual void* getProperty(const XMLCh* const name) const = 0 ;
00497 
00519     virtual void setProperty(const XMLCh* const name, void* value) = 0 ;
00520 
00527     virtual void              release() = 0;
00528 
00552     virtual void              resetDocumentPool() = 0;
00553 
00581     virtual Grammar* loadGrammar(const DOMInputSource& source,
00582                                  const short grammarType,
00583                                  const bool toCache = false) = 0;
00584 
00610     virtual Grammar* loadGrammar(const XMLCh* const systemId,
00611                                  const short grammarType,
00612                                  const bool toCache = false) = 0;
00613 
00639     virtual Grammar* loadGrammar(const char* const systemId,
00640                                  const short grammarType,
00641                                  const bool toCache = false) = 0;
00642 
00649     virtual Grammar* getGrammar(const XMLCh* const nameSpaceKey) const = 0;
00650 
00656     virtual Grammar* getRootGrammar() const = 0;
00657 
00664     virtual const XMLCh* getURIText(unsigned int uriId) const = 0;
00665 
00669     virtual void resetCachedGrammarPool() = 0;
00670 
00676     virtual unsigned int getSrcOffset() const = 0;
00677 
00679 
00680 };
00681 
00682 
00683 XERCES_CPP_NAMESPACE_END
00684 
00685 #endif


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