DocWire DocToText - Powered by Silvercoders 5.0.5
A multifaceted, data extraction software development toolkit that converts all sorts of files to plain text and html. Written in C++, this data extraction tool has a parser able to convert PST & OST files along with a brand new API for better file processing. To enhance its utility, DocToText, as a data extraction tool, can be integrated with other data mining and data analytics applications. It comes equipped with a high grade, scriptable and trainable OCR that has LSTM neural networks based character recognition. This document parser is able to extract metadata along with annotations and supports a list of formats that include: DOC, XLS, XLSB, PPT, RTF, ODF (ODT, ODS, ODP), OOXML (DOCX, XLSX, PPTX), iWork (PAGES, NUMBERS, KEYNOTE), ODFXML (FODP, FODS, FODT), PDF, EML, HTML, Outlook (PST, OST), Image (JPG, JPEG, JFIF, BMP, PNM, PNG, TIFF, WEBP) and DICOM (DCM)
doctotext::Exception Class Reference

#include <exception.h>

Inheritance diagram for doctotext::Exception:
Collaboration diagram for doctotext::Exception:

Public Member Functions

 Exception (const std::string &first_error_message) noexcept
 
 Exception (const Exception &ex) noexcept
 
Exceptionoperator= (const Exception &ex) noexcept
 
const char * what ()
 
std::string getBacktrace ()
 
void appendError (const std::string &error_message)
 
std::list< std::string >::iterator getErrorIterator () const
 
size_t getErrorCount () const
 

Detailed Description

This class is implementation of std::exception, which is used by DocToText. In this implementation, errors can be formed in "stack".

In order to create exception just call:

throw Exception("First error");

You can catch exception and add one more error:

catch (Exception& ex)
{
ex.appendError("Next error message");
throw;
}
void appendError(const std::string &error_message)

or you can catch exception and get "backtrace":

catch (Exception& ex)
{
std::cerr << ex.getBacktrace();
}
std::string getBacktrace()

Definition at line 69 of file exception.h.

Constructor & Destructor Documentation

◆ Exception()

doctotext::Exception::Exception ( const std::string &  first_error_message)
explicitnoexcept

The constructor.

Parameters
first_error_messagefirst error message (gives information about cause of an error).

Member Function Documentation

◆ appendError()

void doctotext::Exception::appendError ( const std::string &  error_message)

Adds one more error message.

◆ getBacktrace()

std::string doctotext::Exception::getBacktrace ( )

Returns a string with all error messages. Each error message is numbered and separated by "\n". Suppose we have thrown an exception:

throw Exception("First error message");

Next, we have added one more error:

ex.appendError("Second error message");

In the result getBacktrace will return a string: "Backtrace:\n1. First error message\n2. Second error message\n"

◆ getErrorCount()

size_t doctotext::Exception::getErrorCount ( ) const

Returns a number of error messages.

◆ getErrorIterator()

std::list< std::string >::iterator doctotext::Exception::getErrorIterator ( ) const

returns an iterator to the first error message.

◆ what()

const char * doctotext::Exception::what ( )
inline

Definition at line 91 of file exception.h.


The documentation for this class was generated from the following file: