DF-0
DF-0: Data processing Framework with Zero-overhead
Loading...
Searching...
No Matches
office_formats_parser.h
1/**************************************************************************/
2/* */
3/* DF-0: Data processing Framework with Zero-overhead */
4/* */
5/* Copyright (c) DF-0 Team https://github.com/df0-io/df0 */
6/* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-DF0-Commercial */
7/* */
8/**************************************************************************/
9
10
11#ifndef DF0_OFFICE_FORMATS_PARSER_H
12#define DF0_OFFICE_FORMATS_PARSER_H
13
14#include "doc_parser.h"
15#include "html_parser.h"
16#include "iwork_parser.h"
17#include "odfxml_parser.h"
18#include "pdf_parser.h"
19#include "xls_parser.h"
20#include "xlsb_parser.h"
21#include "odf_ooxml_parser.h"
22#include "pipeline/composition.hpp"
23#include "ppt_parser.h"
24#include "rtf_parser.h"
25#include "txt_parser.h"
26#include "xml_parser.h"
27#include "audit/auditor_ref.hpp"
28#include "audit/with_auditor.hpp"
29#include <concepts>
30#include <utility>
31
32namespace df0
33{
34
35// Forward declaration so the detail alias can reference the class.
36template <safety_policy safety_level, typename auditor_type>
38
39namespace detail
40{
41
42template <safety_policy safety_level, typename auditor_type>
43using office_formats_parser_base = pipeline::composition_wrapper<
44 office_formats_parser<safety_level, auditor_type>,
45 html_parser<auditor_type>,
46 doc_parser<auditor_type>,
47 pdf_parser<auditor_type>,
48 xls_parser<auditor_type>,
49 xlsb_parser<auditor_type>,
50 iwork_parser<auditor_type>,
51 ppt_parser<auditor_type>,
52 rtf_parser<auditor_type>,
53 odf_ooxml_parser<safety_level, auditor_type>,
54 odfxml_parser<safety_level, auditor_type>,
55 xml_parser<safety_level, auditor_type>,
56 txt_parser<auditor_type>>;
57
58} // namespace detail
59
72template <safety_policy safety_level = default_safety_level,
73 typename auditor_type = audit::null_auditor>
75 : public detail::office_formats_parser_base<safety_level, auditor_type>
76{
77public:
78 using base_type = detail::office_formats_parser_base<safety_level, auditor_type>;
79
83 template<audit::stateless_auditor stateless_auditor_type = auditor_type>
86 audit::auditor_ref<stateless_auditor_type>{})
87 {}
88
93 audit::auditor_ref<auditor_type> auditor)
94 : base_type(auditor)
95 {}
96};
97
98// Default deduction guide enabling `office_formats_parser{}`.
100 office_formats_parser<default_safety_level, audit::null_auditor>;
101
102} // namespace df0
103
104#endif //DF0_OFFICE_FORMATS_PARSER_H
Composite parser for common office document formats.
office_formats_parser()
Constructs the composite parser with the default stateless audit policy.
office_formats_parser(audit::auditor_ref< auditor_type > auditor)
Constructs the composite parser with an explicit injected auditor.