DocWire SDK
DocWire SDK: Award-winning modern data processing in C++20. SourceForge Community Choice & Microsoft support. AI-driven processing. Supports nearly 100 data formats, including email boxes and OCR. Boost efficiency in text extraction, web data extraction, data mining, document analysis. Offline processing possible for security and confidentiality
odfxml_parser.h
1 /*********************************************************************************************************************************************/
2 /* DocWire SDK: Award-winning modern data processing in C++20. SourceForge Community Choice & Microsoft support. AI-driven processing. */
3 /* Supports nearly 100 data formats, including email boxes and OCR. Boost efficiency in text extraction, web data extraction, data mining, */
4 /* document analysis. Offline processing possible for security and confidentiality */
5 /* */
6 /* Copyright (c) SILVERCODERS Ltd, http://silvercoders.com */
7 /* Project homepage: https://github.com/docwire/docwire */
8 /* */
9 /* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-DocWire-Commercial */
10 /*********************************************************************************************************************************************/
11 
12 #ifndef DOCWIRE_ODFXML_PARSER_H
13 #define DOCWIRE_ODFXML_PARSER_H
14 
15 #include "common_xml_document_parser.h"
16 #include "odf_ooxml_export.h"
17 #include "pimpl.h"
18 #include "safety_policy.h"
19 
20 namespace docwire
21 {
22 
27 template <safety_policy safety_level = default_safety_level>
28 class DOCWIRE_ODF_OOXML_EXPORT odfxml_parser : public common_xml_document_parser<safety_level>, public with_pimpl<odfxml_parser<safety_level>>
29 {
30  private:
34 
35  using base_type::registerODFOOXMLCommandHandler;
37 
38  protected:
39  auto create_base_context_guard(const message_callbacks& emit_message)
40  {
41  return scoped_context_stack_push{*this, emit_message};
42  }
43 
44  public:
53  continuation operator()(message_ptr msg, const message_callbacks& emit_message) override;
54  bool is_leaf() const override { return false; }
55 };
56 
57 } // namespace docwire
58 
59 #endif
Helper class to manage the context stack scope. Pushes a new context on construction and pops it on d...
Base class for XML-based document parsers (ODF, OOXML, etc.).
A parser for flat ODF XML documents.
Definition: odfxml_parser.h:29
bool is_leaf() const override
Check if chain element is a leaf (last element which doesn't produce any messages)....
Definition: odfxml_parser.h:54
continuation operator()(message_ptr msg, const message_callbacks &emit_message) override
Processes a message in the parsing chain.
odfxml_parser()
Default constructor.
The main namespace for the DocWire SDK.
Definition: ai_elements.h:19