Chris@16: // (C) Copyright Gennadiy Rozental 2005-2008. Chris@16: // Use, modification, and distribution are subject to the Chris@16: // Boost Software License, Version 1.0. (See accompanying file Chris@16: // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: // See http://www.boost.org/libs/test for the library home page. Chris@16: // Chris@16: // File : $RCSfile$ Chris@16: // Chris@101: // Version : $Revision$ Chris@16: // Chris@16: // Description : input validation helpers implementation Chris@16: // *************************************************************************** Chris@16: Chris@16: #ifndef BOOST_RT_CLA_VALIDATION_IPP_070604GER Chris@16: #define BOOST_RT_CLA_VALIDATION_IPP_070604GER Chris@16: Chris@16: // Boost.Runtime.Parameter Chris@16: #include Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include // BOOST_RT_PARAM_NAMESPACE::logic_error Chris@16: Chris@16: // Boost Chris@16: #include Chris@16: Chris@16: // STL Chris@16: Chris@16: namespace boost { Chris@16: Chris@16: namespace BOOST_RT_PARAM_NAMESPACE { Chris@16: Chris@16: namespace cla { Chris@16: Chris@16: // ************************************************************************** // Chris@16: // ************** runtime::cla::validation ************** // Chris@16: // ************************************************************************** // Chris@16: Chris@16: BOOST_RT_PARAM_INLINE void Chris@16: report_input_error( argv_traverser const& tr, format_stream& msg ) Chris@16: { Chris@16: if( tr.eoi() ) Chris@16: msg << BOOST_RT_PARAM_LITERAL( " at the end of input" ); Chris@16: else { Chris@16: msg << BOOST_RT_PARAM_LITERAL( " in the following position: " ); Chris@16: Chris@16: if( tr.input().size() > 5 ) Chris@16: msg << tr.input().substr( 0, 5 ) << BOOST_RT_PARAM_LITERAL( "..." ); Chris@16: else Chris@16: msg << tr.input(); Chris@16: } Chris@16: Chris@16: throw BOOST_RT_PARAM_NAMESPACE::logic_error( msg.str() ); Chris@16: } Chris@16: Chris@16: //____________________________________________________________________________// Chris@16: Chris@16: } // namespace cla Chris@16: Chris@16: } // namespace BOOST_RT_PARAM_NAMESPACE Chris@16: Chris@16: } // namespace boost Chris@16: Chris@16: #endif // BOOST_RT_CLA_VALIDATION_IPP_070604GER