validation.hpp 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // (C) Copyright Gennadiy Rozental 2005-2008.
  2. // Use, modification, and distribution are subject to the
  3. // Boost Software License, Version 1.0. (See accompanying file
  4. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. // See http://www.boost.org/libs/test for the library home page.
  6. //
  7. // File : $RCSfile$
  8. //
  9. // Version : $Revision: 49312 $
  10. //
  11. // Description : input validation helpers definition
  12. // ***************************************************************************
  13. #ifndef BOOST_RT_CLA_VALIDATION_HPP_062604GER
  14. #define BOOST_RT_CLA_VALIDATION_HPP_062604GER
  15. // Boost.Runtime.Parameter
  16. #include <boost/test/utils/runtime/config.hpp>
  17. #include <boost/test/utils/runtime/cla/fwd.hpp>
  18. namespace boost {
  19. namespace BOOST_RT_PARAM_NAMESPACE {
  20. namespace cla {
  21. // ************************************************************************** //
  22. // ************** runtime::cla::report_input_error ************** //
  23. // ************************************************************************** //
  24. void report_input_error( argv_traverser const& tr, format_stream& msg );
  25. //____________________________________________________________________________//
  26. #define BOOST_RT_CLA_VALIDATE_INPUT( b, tr, msg ) \
  27. if( b ) ; else ::boost::BOOST_RT_PARAM_NAMESPACE::cla::report_input_error( tr, format_stream().ref() << msg )
  28. //____________________________________________________________________________//
  29. } // namespace cla
  30. } // namespace BOOST_RT_PARAM_NAMESPACE
  31. } // namespace boost
  32. #ifndef BOOST_RT_PARAM_OFFLINE
  33. # define BOOST_RT_PARAM_INLINE inline
  34. # include <boost/test/utils/runtime/cla/validation.ipp>
  35. #endif
  36. #endif // BOOST_RT_CLA_VALIDATION_HPP_062604GER