summaryrefslogtreecommitdiff
path: root/sax/inc/sax_delegate.hh
blob: 59af2b70bdbf606da56ee8af67509dbd3d12d03e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef MODXML_SAX_DELEGATE_HH
#define MODXML_SAX_DELEGATE_HH

#include <cstdint>
#include <string_view>

namespace modxml {
namespace sax {

class Attributes;

/**
 * Delegate for processor.
 * Implement to handle events.
 */
class Delegate {
 public:
  virtual ~Delegate() = default;

  virtual void start_element(std::string_view name,
                             Attributes const& attributes);

  virtual void end_element(std::string_view name);

  virtual void empty_element(std::string_view name,
                             Attributes const& attributes);

  virtual void character_data(std::string_view data);

  virtual void processing_instruction(std::string_view target,
                                      std::string_view data);

  virtual void comment(std::string_view data);

  virtual void error(std::string_view message);

 protected:
  Delegate() = default;
};

}  // namespace sax
}  // namespace modxml

#endif  // MODXML_SAX_DELEGATE_HH