00001 #ifndef DOMWriter_HEADER_GUARD_ 00002 #define DOMWriter_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: DOMWriter.hpp 231323 2005-08-10 20:58:40Z cargilld $ 00022 */ 00023 00244 #include <xercesc/dom/DOMNode.hpp> 00245 #include <xercesc/dom/DOMWriterFilter.hpp> 00246 #include <xercesc/dom/DOMErrorHandler.hpp> 00247 #include <xercesc/framework/XMLFormatter.hpp> 00248 00249 XERCES_CPP_NAMESPACE_BEGIN 00250 00251 class CDOM_EXPORT DOMWriter { 00252 protected : 00253 // ----------------------------------------------------------------------- 00254 // Hidden constructors 00255 // ----------------------------------------------------------------------- 00258 DOMWriter() {}; 00260 private: 00261 // ----------------------------------------------------------------------- 00262 // Unimplemented constructors and operators 00263 // ----------------------------------------------------------------------- 00266 DOMWriter(const DOMWriter &); 00267 DOMWriter & operator = (const DOMWriter &); 00269 00270 00271 public: 00272 // ----------------------------------------------------------------------- 00273 // All constructors are hidden, just the destructor is available 00274 // ----------------------------------------------------------------------- 00281 virtual ~DOMWriter() {}; 00283 00284 // ----------------------------------------------------------------------- 00285 // Virtual DOMWriter interface 00286 // ----------------------------------------------------------------------- 00289 // ----------------------------------------------------------------------- 00290 // Feature methods 00291 // ----------------------------------------------------------------------- 00307 virtual bool canSetFeature(const XMLCh* const featName 00308 , bool state) const = 0; 00328 virtual void setFeature(const XMLCh* const featName 00329 , bool state) = 0; 00330 00347 virtual bool getFeature(const XMLCh* const featName) const = 0; 00348 00349 // ----------------------------------------------------------------------- 00350 // Setter methods 00351 // ----------------------------------------------------------------------- 00368 virtual void setEncoding(const XMLCh* const encoding) = 0; 00369 00398 virtual void setNewLine(const XMLCh* const newLine) = 0; 00399 00413 virtual void setErrorHandler(DOMErrorHandler *errorHandler) = 0; 00414 00427 virtual void setFilter(DOMWriterFilter *filter) = 0; 00428 00429 // ----------------------------------------------------------------------- 00430 // Getter methods 00431 // ----------------------------------------------------------------------- 00441 virtual const XMLCh* getEncoding() const = 0; 00442 00453 virtual const XMLCh* getNewLine() const = 0; 00454 00465 virtual DOMErrorHandler* getErrorHandler() const = 0; 00466 00476 virtual DOMWriterFilter* getFilter() const = 0; 00477 00478 // ----------------------------------------------------------------------- 00479 // Write methods 00480 // ----------------------------------------------------------------------- 00500 virtual bool writeNode(XMLFormatTarget* const destination 00501 , const DOMNode &nodeToWrite) = 0; 00502 00521 virtual XMLCh* writeToString(const DOMNode &nodeToWrite) = 0; 00522 00524 00525 // ----------------------------------------------------------------------- 00526 // Non-standard Extension 00527 // ----------------------------------------------------------------------- 00536 virtual void release() = 0; 00538 00539 00540 }; 00541 00542 XERCES_CPP_NAMESPACE_END 00543 00544 #endif