blob: b78097b019075d4bf080b536cfdd4dd80f071652 [file] [log] [blame]
Jeff Thompsonef2d5a42013-08-22 19:09:24 -07001// (C) Copyright Gennadiy Rozental 2005-2008.
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$
10//
11// Version : $Revision: 54633 $
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 <ndnboost/test/utils/runtime/config.hpp>
21#include <ndnboost/test/utils/runtime/cla/argv_traverser.hpp>
22
23// Boost.Test
24#include <ndnboost/test/utils/basic_cstring/io.hpp>
25#include <ndnboost/test/utils/basic_cstring/compare.hpp>
26
27#include <ndnboost/lexical_cast.hpp>
28
29// STL
30// !! can we eliminate these includes?
31#include <list>
32
33namespace ndnboost {
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 ndnboost
81
82#endif // BOOST_RT_CLA_ARGUMENT_VALUE_USAGE_HPP_062604GER