error.hpp 975 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. Copyright 2007-2008 Christian Henning, Andreas Pokorny, Lubomir Bourdev
  3. Use, modification and distribution are subject to the Boost Software License,
  4. Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  5. http://www.boost.org/LICENSE_1_0.txt).
  6. */
  7. /*************************************************************************************************/
  8. #ifndef BOOST_GIL_IO_ERROR_HPP
  9. #define BOOST_GIL_IO_ERROR_HPP
  10. ////////////////////////////////////////////////////////////////////////////////////////
  11. /// \file
  12. /// \brief
  13. /// \author Christian Henning \n
  14. ///
  15. /// \date 2010 \n
  16. ///
  17. ////////////////////////////////////////////////////////////////////////////////////////
  18. namespace boost { namespace gil {
  19. inline
  20. void io_error( const char* descr )
  21. {
  22. throw std::ios_base::failure( descr );
  23. }
  24. inline
  25. void io_error_if( bool expr, const char* descr )
  26. {
  27. if( expr )
  28. io_error( descr );
  29. }
  30. } // namespace gil
  31. } // namespace boost
  32. #endif