10.07.2015 Views

Download - Multivac!

Download - Multivac!

Download - Multivac!

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2.4 C++ BindingIn addition to the pdflib.h C header file, an object-oriented wrapper for C++ is suppliedfor PDFlib clients. It requires the pdflib.hpp header file, which in turn includes pdflib.h.The corresponding pdflib.cpp module should be linked against the application which inturn should be linked against the generic PDFlib C library.Using the C++ object wrapper replaces the PDF_ prefix in all PDFlib function nameswith a more object-oriented approach.Error Handling in C++. PDFlib API functions will throw a C++ exception in case of anerror. These exceptions must be caught in the client code by using C++ try/catch clauses.In order to provide extended error information the PDFlib class provides a publicPDFlib::Exception class which exposes methods for retrieving the detailed error message,the exception number, and the name of the PDFlib API function which threw the exception.Native C++ exceptions thrown by PDFlib routines will behave as expected. The followingcode fragment will catch exceptions thrown by PDFlib:try {...some PDFlib instructions...catch (PDFlib::Exception &ex) {cerr

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!