From fc4547b412e28164af1bf8981234c6af959ccc0b Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Tue, 13 Jun 2023 10:07:16 +0200 Subject: WIP --- sax/inc/sax_processor.hh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 sax/inc/sax_processor.hh (limited to 'sax/inc/sax_processor.hh') diff --git a/sax/inc/sax_processor.hh b/sax/inc/sax_processor.hh new file mode 100644 index 0000000..7ca32f7 --- /dev/null +++ b/sax/inc/sax_processor.hh @@ -0,0 +1,37 @@ +#ifndef MODXML_SAX_PROCESSOR_HH +#define MODXML_SAX_PROCESSOR_HH + +#include + +namespace modxml { +namespace sax { + +class Delegate; + +/** + * The XML processor, or parser if you like that term better. + * Feed it data and the processor will give the delegate calls with events or + * possibly errors. + */ +class Processor { + public: + virtual ~Processor() = default; + + /** + * Construct a Processor. Same as creating a ProcessorBuilder + * and not changing any options and just calling build. + */ + static std::unique_ptr create(std::shared_ptr delegate); + + protected: + Processor() = default; + + private: + Processor(Processor const&) = delete; + Processor& operator=(Processor const&) = delete; +}; + +} // namespace sax +} // namespace modxml + +#endif // MODXML_SAX_PROCESSOR_HH -- cgit v1.2.3-70-g09d2