ValidityChecker.hpp
1 #pragma once
2 #include <score/plugins/InterfaceList.hpp>
3 
4 #include <score_lib_base_export.h>
5 
6 namespace score
7 {
8 class Document;
9 struct DocumentContext;
10 
20 class SCORE_LIB_BASE_EXPORT ValidityChecker : public score::InterfaceBase
21 {
22  SCORE_INTERFACE(ValidityChecker, "08d4e533-e212-41ba-b0c1-643cc2c98cae")
23 public:
24  ~ValidityChecker() override;
25 
26  virtual bool validate(const score::DocumentContext&) = 0;
27 };
28 
30 
34 class SCORE_LIB_BASE_EXPORT DocumentValidator
35 {
36 public:
38 
40  bool operator()() const;
41 
42 private:
43  const ValidityCheckerList& m_list;
44  const score::Document& m_doc;
45 };
46 
47 class SCORE_LIB_BASE_EXPORT ValidityCheckerList final
48  : public InterfaceList<score::ValidityChecker>
49 {
50 public:
52  DocumentValidator make(const score::Document& ctx);
53 };
54 }
The Document class is the central part of the software.
Definition: Document.hpp:51
Checks that a document is valid according to a list of checks to run.
Definition: ValidityChecker.hpp:35
Base class for plug-in interfaces.
Definition: Interface.hpp:52
InterfaceList Default implementation of InterfaceListBase.
Definition: InterfaceList.hpp:80
Implement validation checks on the document.
Definition: ValidityChecker.hpp:21
Definition: ValidityChecker.hpp:49
Base toolkit upon which the software is built.
Definition: Application.cpp:90
Definition: DocumentContext.hpp:18