00001 #ifndef DOMWriter_HEADER_GUARD_ 00002 #define DOMWriter_HEADER_GUARD_ 00003 00004 /* 00005 * Licensed to the Apache Software Foundation (ASF) under one or more 00006 * contributor license agreements. See the NOTICE file distributed with 00007 * this work for additional information regarding copyright ownership. 00008 * The ASF licenses this file to You under the Apache License, Version 2.0 00009 * (the "License"); you may not use this file except in compliance with 00010 * the License. You may obtain a copy of the License at 00011 * 00012 * http://www.apache.org/licenses/LICENSE-2.0 00013 * 00014 * Unless required by applicable law or agreed to in writing, software 00015 * distributed under the License is distributed on an "AS IS" BASIS, 00016 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00017 * See the License for the specific language governing permissions and 00018 * limitations under the License. 00019 */ 00020 00021 /* 00022 * $Id: DOMWriter.hpp 568078 2007-08-21 11:43:25Z amassari $ 00023 */ 00024 00245 #include <xercesc/dom/DOMNode.hpp> 00246 #include <xercesc/dom/DOMWriterFilter.hpp> 00247 #include <xercesc/dom/DOMErrorHandler.hpp> 00248 #include <xercesc/framework/XMLFormatter.hpp> 00249 00250 XERCES_CPP_NAMESPACE_BEGIN 00251 00252 class CDOM_EXPORT DOMWriter { 00253 protected : 00254 // ----------------------------------------------------------------------- 00255 // Hidden constructors 00256 // ----------------------------------------------------------------------- 00259 DOMWriter() {}; 00261 private: 00262 // ----------------------------------------------------------------------- 00263 // Unimplemented constructors and operators 00264 // ----------------------------------------------------------------------- 00267 DOMWriter(const DOMWriter &); 00268 DOMWriter & operator = (const DOMWriter &); 00270 00271 00272 public: 00273 // ----------------------------------------------------------------------- 00274 // All constructors are hidden, just the destructor is available 00275 // ----------------------------------------------------------------------- 00282 virtual ~DOMWriter() {}; 00284 00285 // ----------------------------------------------------------------------- 00286 // Virtual DOMWriter interface 00287 // ----------------------------------------------------------------------- 00290 // ----------------------------------------------------------------------- 00291 // Feature methods 00292 // ----------------------------------------------------------------------- 00308 virtual bool canSetFeature(const XMLCh* const featName 00309 , bool state) const = 0; 00329 virtual void setFeature(const XMLCh* const featName 00330 , bool state) = 0; 00331 00348 virtual bool getFeature(const XMLCh* const featName) const = 0; 00349 00350 // ----------------------------------------------------------------------- 00351 // Setter methods 00352 // ----------------------------------------------------------------------- 00369 virtual void setEncoding(const XMLCh* const encoding) = 0; 00370 00399 virtual void setNewLine(const XMLCh* const newLine) = 0; 00400 00414 virtual void setErrorHandler(DOMErrorHandler *errorHandler) = 0; 00415 00428 virtual void setFilter(DOMWriterFilter *filter) = 0; 00429 00430 // ----------------------------------------------------------------------- 00431 // Getter methods 00432 // ----------------------------------------------------------------------- 00442 virtual const XMLCh* getEncoding() const = 0; 00443 00454 virtual const XMLCh* getNewLine() const = 0; 00455 00466 virtual DOMErrorHandler* getErrorHandler() const = 0; 00467 00477 virtual DOMWriterFilter* getFilter() const = 0; 00478 00479 // ----------------------------------------------------------------------- 00480 // Write methods 00481 // ----------------------------------------------------------------------- 00501 virtual bool writeNode(XMLFormatTarget* const destination 00502 , const DOMNode &nodeToWrite) = 0; 00503 00522 virtual XMLCh* writeToString(const DOMNode &nodeToWrite) = 0; 00523 00525 00526 // ----------------------------------------------------------------------- 00527 // Non-standard Extension 00528 // ----------------------------------------------------------------------- 00537 virtual void release() = 0; 00539 00540 00541 }; 00542 00543 XERCES_CPP_NAMESPACE_END 00544 00545 #endif