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
reuse_chain.cpp

This example shows how to create a single processing chain and reuse it to parse multiple input files.

#include "docwire.h"
#include <fstream>
int main(int argc, char* argv[])
{
using namespace docwire;
try
{
auto chain = content_type::detector{} | office_formats_parser{} | plain_text_exporter() | std::cout; // create a chain of steps to parse a file
for (int i = 1; i < 3; ++i)
std::ifstream(std::to_string(i) + ".docx", std::ios_base::binary) | chain; // set the input file as an input stream
}
catch (const std::exception& e)
{
std::cerr << errors::diagnostic_message(e) << std::endl;
return 1;
}
return 0;
}
DOCWIRE_CORE_EXPORT std::string diagnostic_message(const std::exception &e)
Generates a diagnostic message for the given nested exceptions chain.
The main namespace for the DocWire SDK.
Definition: ai_elements.h:19