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
writer.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_WRITER_H
13 #define DOCWIRE_WRITER_H
14 
15 #include "core_export.h"
16 #include "message.h"
17 #include <ostream>
18 #include <string>
19 
20 namespace docwire
21 {
22 
24 {
25 public:
26  text_element() = default;
27  explicit text_element(std::string text) : text(std::move(text)) {};
28  virtual void write_to(std::ostream &file) const
29  {
30  file << text;
31  }
32 
33 private:
34  std::string text;
35 };
36 
40 class DOCWIRE_CORE_EXPORT writer
41 {
42 public:
48  virtual void write_to(const message_ptr& msg, std::ostream &stream) = 0;
49 };
50 
51 } // namespace docwire
52 
53 #endif //DOCWIRE_WRITER_H
The Writer class is used to write data from callbacks to an output stream.
Definition: writer.h:41
virtual void write_to(const message_ptr &msg, std::ostream &stream)=0
writes data from callback to the specific output stream
The main namespace for the DocWire SDK.
Definition: ai_elements.h:19