From afebd79d44b75aed3b38e867c65330ba80ddc0ee Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 13 Oct 2009 11:29:26 +0200 Subject: Extended the streaming example It now shows how to perform stream-oriented, partially in-memory XML processing using the C++/Tree mapping. --- examples/cxx/tree/streaming/parser.hxx | 46 ++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 examples/cxx/tree/streaming/parser.hxx (limited to 'examples/cxx/tree/streaming/parser.hxx') diff --git a/examples/cxx/tree/streaming/parser.hxx b/examples/cxx/tree/streaming/parser.hxx new file mode 100644 index 0000000..000d022 --- /dev/null +++ b/examples/cxx/tree/streaming/parser.hxx @@ -0,0 +1,46 @@ +// file : examples/cxx/tree/streaming/parser.hxx +// author : Boris Kolpackov +// copyright : not copyrighted - public domain + +#ifndef PARSER_HXX +#define PARSER_HXX + +#include +#include +#include // std::auto_ptr + +#include + +#include + +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 + 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 + next (); + +private: + parser (const parser&); + + parser& + operator= (const parser&); + +private: + std::auto_ptr impl_; +}; + +#endif // PARSER_HXX -- cgit v1.1