EPUBXMLSink.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /*
00003  * This file is part of the libepubgen project.
00004  *
00005  * This Source Code Form is subject to the terms of the Mozilla Public
00006  * License, v. 2.0. If a copy of the MPL was not distributed with this
00007  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
00008  */
00009 
00010 #ifndef INCLUDED_EPUBXMLSINK_H
00011 #define INCLUDED_EPUBXMLSINK_H
00012 
00013 #include <deque>
00014 #include <memory>
00015 
00016 #include <librevenge/librevenge.h>
00017 
00018 #include <libepubgen/libepubgen.h>
00019 
00020 namespace libepubgen
00021 {
00022 
00023 class EPUBXMLElement;
00024 
00025 class EPUBXMLSink
00026 {
00027   typedef std::shared_ptr<EPUBXMLElement> EPUBXMLElementPtr_t;
00028 
00029 public:
00030   EPUBXMLSink();
00031 
00032   void openElement(const char *name, const librevenge::RVNGPropertyList &attributes = librevenge::RVNGPropertyList());
00033   void closeElement(const char *name);
00034 
00035   void insertEmptyElement(const char *name, const librevenge::RVNGPropertyList &attributes = librevenge::RVNGPropertyList());
00036 
00037   void insertCharacters(const librevenge::RVNGString &characters);
00038 
00039   void append(const EPUBXMLSink &other);
00040 
00041   void writeTo(EPUBPackage &package, const char *name);
00042 
00043   bool empty() const;
00044 
00045 private:
00046   std::deque<EPUBXMLElementPtr_t> m_elements;
00047 };
00048 
00049 }
00050 
00051 #endif // INCLUDED_EPUBXMLSINK_H
00052 
00053 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */