SILVERCODERS DocToText  4.0.1512
Converts DOC, XLS, XLSB, PPT, RTF, ODF (ODT, ODS, ODP), OOXML (DOCX, XLSX, PPTX), iWork (PAGES, NUMBERS, KEYNOTE), ODFXML (FODP, FODS, FODT), PDF, EML and HTML documents to plain text. Extracts metadata and annotations.
 All Classes Functions Enumerations Pages
Public Member Functions | List of all members
doctotext::Exception Class Reference

#include <exception.h>

Inheritance diagram for doctotext::Exception:

Public Member Functions

 Exception (const std::string &first_error_message) throw ()
 
 Exception (const Exception &ex) throw ()
 
Exceptionoperator= (const Exception &ex) throw ()
 
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;
}

or you can catch exception and get "backtrace":

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

Constructor & Destructor Documentation

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

The constructor.

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

Member Function Documentation

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

Adds one more error message.

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

returns a string with all error messages. Each error message is 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: "First error message\nSecond error message\n"

size_t doctotext::Exception::getErrorCount ( ) const

Returns a number of error messages

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

returns a iterator to the first error message


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