pdfmm 0.9.20
Classes | Namespaces | Macros | Enumerations
PdfError.h File Reference
#include "pdfmmdefs.h"
#include <queue>
#include <functional>
#include "PdfFormat.h"

Classes

class  mm::PdfError
 

Namespaces

namespace  mm
 

Macros

#define PDFMM_RAISE_ERROR(code)   throw ::mm::PdfError(code, __FILE__, __LINE__, { })
 
#define PDFMM_RAISE_ERROR_INFO(code, msg, ...)   throw ::mm::PdfError(code, __FILE__, __LINE__, PDFMM_FORMAT(msg, ##__VA_ARGS__))
 
#define PDFMM_PUSH_FRAME(err)   err.AddToCallstack(__FILE__, __LINE__, { })
 
#define PDFMM_PUSH_FRAME_INFO(err, msg, ...)   err.AddToCallstack(__FILE__, __LINE__, PDFMM_FORMAT(msg, ##__VA_ARGS__))
 

Enumerations

enum class  mm::PdfErrorCode {
  mm::Unknown = 0 , mm::Ok , mm::TestFailed , mm::InvalidHandle ,
  mm::FileNotFound , mm::InvalidDeviceOperation , mm::UnexpectedEOF , mm::OutOfMemory ,
  mm::ValueOutOfRange , mm::InternalLogic , mm::InvalidEnumValue , mm::BrokenFile ,
  mm::PageNotFound , mm::NoPdfFile , mm::NoXRef , mm::NoTrailer ,
  mm::NoNumber , mm::NoObject , mm::NoEOFToken , mm::InvalidTrailerSize ,
  mm::InvalidLinearization , mm::InvalidDataType , mm::InvalidXRef , mm::InvalidXRefStream ,
  mm::InvalidXRefType , mm::InvalidPredictor , mm::InvalidStrokeStyle , mm::InvalidHexString ,
  mm::InvalidStream , mm::InvalidStreamLength , mm::InvalidKey , mm::InvalidName ,
  mm::InvalidEncryptionDict , mm::InvalidPassword , mm::InvalidFontFile , mm::InvalidContentStream ,
  mm::UnsupportedFilter , mm::UnsupportedFontFormat , mm::ActionAlreadyPresent , mm::WrongDestinationType ,
  mm::MissingEndStream , mm::Date , mm::Flate , mm::FreeType ,
  mm::SignatureError , mm::UnsupportedImageFormat , mm::CannotConvertColor , mm::NotImplemented ,
  mm::DestinationAlreadyPresent , mm::ChangeOnImmutable , mm::NotCompiled , mm::OutlineItemAlreadyPresent ,
  mm::NotLoadedForUpdate , mm::CannotEncryptedForUpdate , mm::XmpMetadata
}
 
enum class  mm::LogSeverity {
  mm::None = 0 , mm::Error , mm::Warning , mm::Information ,
  mm::Debug
}
 

Detailed Description

Copyright (C) 2006 by Dominik Seichter domse.nosp@m.icht.nosp@m.er@we.nosp@m.b.de Copyright (C) 2020 by Francesco Pretto ceztk.nosp@m.o@gm.nosp@m.ail.c.nosp@m.om

Licensed under GNU Library General Public License 2.0 or later. Some rights reserved. See COPYING, AUTHORS.

Error information and logging is implemented in this file.

Macro Definition Documentation

◆ PDFMM_PUSH_FRAME

#define PDFMM_PUSH_FRAME (   err)    err.AddToCallstack(__FILE__, __LINE__, { })

Add frame to error callastack

Evaluate ‘cond’ as a binary predicate and if it is true, raise a logic error with the info string ‘msg’ .

◆ PDFMM_PUSH_FRAME_INFO

#define PDFMM_PUSH_FRAME_INFO (   err,
  msg,
  ... 
)    err.AddToCallstack(__FILE__, __LINE__, PDFMM_FORMAT(msg, ##__VA_ARGS__))

Add frame to error callastack with msg information

◆ PDFMM_RAISE_ERROR

#define PDFMM_RAISE_ERROR (   code)    throw ::mm::PdfError(code, __FILE__, __LINE__, { })

Throw an exception of type PdfError with the error code x, which should be one of the values of the enum PdfErrorCode. File and line info are included.

◆ PDFMM_RAISE_ERROR_INFO

#define PDFMM_RAISE_ERROR_INFO (   code,
  msg,
  ... 
)    throw ::mm::PdfError(code, __FILE__, __LINE__, PDFMM_FORMAT(msg, ##__VA_ARGS__))

Throw an exception of type PdfError with the error code, which should be one of the values of the enum PdfErrorCode. File and line info are included. Additionally extra information on the error, msg is set, which will also be output by PdfError::PrintErrorMsg(). msg can be a C string, but can also be a C++ std::string.