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
odf_ooxml_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_ODFOOXML_PARSER_H
13 #define DOCWIRE_ODFOOXML_PARSER_H
14 
15 #include "common_xml_document_parser.h"
16 #include "data_source.h"
17 #include "odf_ooxml_export.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 odf_ooxml_parser : public common_xml_document_parser<safety_level>, public with_pimpl<odf_ooxml_parser<safety_level>>
29 {
33 
34  using base_type::registerODFOOXMLCommandHandler;
35  using base_type::blanks;
36  using base_type::set_blanks;
37  using base_type::extractText;
38  using base_type::parseODFMetadata;
39  using base_type::parseXmlChildren;
40  using base_type::getSharedStrings;
41  using base_type::activeEmittingSignals;
44 
45  class CommandHandlersSet;
46  int lastOOXMLRowNum();
47  void setLastOOXMLRowNum(int r);
48  int lastOOXMLColNum();
49  void setLastOOXMLColNum(int c);
50  void parse(const data_source& data, XmlParseMode mode, const message_callbacks& emit_message);
51  attributes::metadata metaData(zip_reader& zipfile) const;
52 
53  public:
54 
60  void parse(const data_source& data, const message_callbacks& emit_message);
61 
70  continuation operator()(message_ptr msg, const message_callbacks& emit_message) override;
71  bool is_leaf() const override { return false; }
72 };
73 
74 } // namespace docwire
75 
76 #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 ODF and OOXML document formats.
odf_ooxml_parser()
Default constructor.
bool is_leaf() const override
Check if chain element is a leaf (last element which doesn't produce any messages)....
void parse(const data_source &data, const message_callbacks &emit_message)
Parses the given data source.
continuation operator()(message_ptr msg, const message_callbacks &emit_message) override
Processes a message in the parsing chain.
The main namespace for the DocWire SDK.
Definition: ai_elements.h:19
Represents a shared string, a common optimization in OOXML formats.