source: NonGTP/Boost/boost/test/utils/runtime/cla/detail/argument_value_usage.hpp @ 857

Revision 857, 2.8 KB checked in by igarcia, 18 years ago (diff)
Line 
1//  (C) Copyright Gennadiy Rozental 2005.
2//  Permission to copy, use, modify, sell and distribute this software
3//  is granted provided this copyright notice appears in all copies.
4//  This software is provided "as is" without express or implied warranty,
5//  and with no claim as to its suitability for any purpose.
6 
7//  See http://www.boost.org for updates, documentation, and revision history.
8//
9//  File        : $RCSfile: argument_value_usage.hpp,v $
10//
11//  Version     : $Revision: 1.1 $
12//
13//  Description : argument usage printing helpers
14// ***************************************************************************
15
16#ifndef BOOST_RT_CLA_ARGUMENT_VALUE_USAGE_HPP_062604GER
17#define BOOST_RT_CLA_ARGUMENT_VALUE_USAGE_HPP_062604GER
18
19// Boost.Runtime.Parameter
20#include <boost/test/utils/runtime/config.hpp>
21#include <boost/test/utils/runtime/cla/argv_traverser.hpp>
22
23// Boost.Test
24#include <boost/test/utils/basic_cstring/io.hpp>
25#include <boost/test/utils/basic_cstring/compare.hpp>
26
27#include <boost/lexical_cast.hpp>
28
29// STL
30// !! could we eliminate these includes?
31#include <list>
32
33namespace boost {
34
35namespace BOOST_RT_PARAM_NAMESPACE {
36
37namespace cla {
38
39namespace rt_cla_detail {
40
41// ************************************************************************** //
42// **************             argument_value_usage             ************** //
43// ************************************************************************** //
44
45// generic case
46template<typename T>
47inline void
48argument_value_usage( format_stream& fs, long, T* = 0 )
49{
50    fs << BOOST_RT_PARAM_CSTRING_LITERAL( "<value>" );
51}
52
53//____________________________________________________________________________//
54
55// specialization for list of values
56template<typename T>
57inline void
58argument_value_usage( format_stream& fs, int, std::list<T>* = 0 )
59{
60    fs << BOOST_RT_PARAM_CSTRING_LITERAL( "(<value1>, ..., <valueN>)" );
61}
62
63//____________________________________________________________________________//
64
65// specialization for type bool
66inline void
67argument_value_usage( format_stream& fs,  int, bool* = 0 )
68{
69    fs << BOOST_RT_PARAM_CSTRING_LITERAL( "[yes|y|no|n]" );
70}
71
72//____________________________________________________________________________//
73
74} // namespace rt_cla_detail
75
76} // namespace cla
77
78} // namespace BOOST_RT_PARAM_NAMESPACE
79
80} // namespace boost
81
82// ************************************************************************** //
83//   Revision History:
84//
85//   $Log: argument_value_usage.hpp,v $
86//   Revision 1.1  2005/04/12 06:42:43  rogeeff
87//   Runtime.Param library initial commit
88//
89// ************************************************************************** //
90
91#endif // BOOST_RT_CLA_ARGUMENT_VALUE_USAGE_HPP_062604GER
Note: See TracBrowser for help on using the repository browser.