Exiv2
Functions
enforce.hpp File Reference

Port of D's enforce() to C++ & Exiv2. More...

#include <string>
#include "error.hpp"

Go to the source code of this file.

Functions

template<typename exception_t , typename T >
void enforce (bool condition, const T &arg1)
 Ensure that condition is true, otherwise throw an exception of the type exception_t. More...
 
void enforce (bool condition, Exiv2::ErrorCode err_code)
 Ensure that condition is true, otherwise throw an Exiv2::Error with the given error_code.
 
template<typename T >
void enforce (bool condition, Exiv2::ErrorCode err_code, const T &arg1)
 Ensure that condition is true, otherwise throw an Exiv2::Error with the given error_code & arg1.
 
template<typename T , typename U >
void enforce (bool condition, Exiv2::ErrorCode err_code, const T &arg1, const U &arg2)
 Ensure that condition is true, otherwise throw an Exiv2::Error with the given error_code, arg1 & arg2.
 
template<typename T , typename U , typename V >
void enforce (bool condition, Exiv2::ErrorCode err_code, const T &arg1, const U &arg2, const V &arg3)
 Ensure that condition is true, otherwise throw an Exiv2::Error with the given error_code, arg1, arg2 & arg3.
 

Detailed Description

Port of D's enforce() to C++ & Exiv2.

Author
Dan Čermák (D4N) dan.cermak@cgc-instruments.com
Date
11-March-18, D4N: created

Function Documentation

◆ enforce()

template<typename exception_t , typename T >
void enforce ( bool  condition,
const T &  arg1 
)
inline

Ensure that condition is true, otherwise throw an exception of the type exception_t.

Template Parameters
exception_tException type that is thrown, must provide a constructor that accepts a single argument to which arg1 is forwarded.

Referenced by Exiv2::TimeValue::copy(), Exiv2::Internal::TiffDirectory::doWrite(), Exiv2::WebPImage::readMetadata(), Exiv2::MrwImage::readMetadata(), Exiv2::PgfImage::readMetadata(), Exiv2::RafImage::readMetadata(), Exiv2::PsdImage::readMetadata(), Exiv2::JpegBase::readMetadata(), Exiv2::Internal::TiffReader::readTiffEntry(), Exiv2::strError(), and Exiv2::Internal::TiffReader::visitBinaryElement().