diff options
author | Jörg Frings-Fürst <jff@merkur> | 2014-05-18 16:08:14 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <jff@merkur> | 2014-05-18 16:08:14 +0200 |
commit | a15cf65c44d5c224169c32ef5495b68c758134b7 (patch) | |
tree | 3419f58fc8e1b315ba8171910ee044c5d467c162 /xsd/examples/cxx/tree/streaming/parser.hxx |
Imported Upstream version 3.3.0.2upstream/3.3.0.2
Diffstat (limited to 'xsd/examples/cxx/tree/streaming/parser.hxx')
-rw-r--r-- | xsd/examples/cxx/tree/streaming/parser.hxx | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/xsd/examples/cxx/tree/streaming/parser.hxx b/xsd/examples/cxx/tree/streaming/parser.hxx new file mode 100644 index 0000000..000d022 --- /dev/null +++ b/xsd/examples/cxx/tree/streaming/parser.hxx @@ -0,0 +1,46 @@ +// file : examples/cxx/tree/streaming/parser.hxx +// author : Boris Kolpackov <boris@codesynthesis.com> +// copyright : not copyrighted - public domain + +#ifndef PARSER_HXX +#define PARSER_HXX + +#include <string> +#include <iosfwd> +#include <memory> // std::auto_ptr + +#include <xercesc/dom/DOMDocument.hpp> + +#include <xsd/cxx/xml/dom/auto-ptr.hxx> + +class parser_impl; + +class parser +{ +public: + ~parser (); + parser (); + + // The start function returns a "carcase" of the complete document. That + // is, the root element with all the attributes but without any content. + // + xsd::cxx::xml::dom::auto_ptr<xercesc::DOMDocument> + start (std::istream& is, const std::string& id, bool validate); + + // The next function returns next first-level element with all its + // attributes and content or 0 if no more available. + // + xsd::cxx::xml::dom::auto_ptr<xercesc::DOMDocument> + next (); + +private: + parser (const parser&); + + parser& + operator= (const parser&); + +private: + std::auto_ptr<parser_impl> impl_; +}; + +#endif // PARSER_HXX |