summaryrefslogtreecommitdiff
path: root/sax/inc/sax_processor.hh
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@spawned.biz>2023-06-13 10:07:16 +0200
committerJoel Klinghed <the_jk@spawned.biz>2023-06-13 10:07:16 +0200
commitfc4547b412e28164af1bf8981234c6af959ccc0b (patch)
tree061253e7a4f6abaca282223b36d10f0bed8cad23 /sax/inc/sax_processor.hh
WIP
Diffstat (limited to 'sax/inc/sax_processor.hh')
-rw-r--r--sax/inc/sax_processor.hh37
1 files changed, 37 insertions, 0 deletions
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 <memory>
+
+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<Processor> create(std::shared_ptr<Delegate> delegate);
+
+ protected:
+ Processor() = default;
+
+ private:
+ Processor(Processor const&) = delete;
+ Processor& operator=(Processor const&) = delete;
+};
+
+} // namespace sax
+} // namespace modxml
+
+#endif // MODXML_SAX_PROCESSOR_HH