blob: a8050b2ed309b6ba7e5f877fcb71617945b5335b [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
Jeff Thompson3d613fd2013-10-15 15:39:04 -070016#ifndef NDNBOOST_RT_CLA_ARGUMENT_VALUE_USAGE_HPP_062604GER
17#define NDNBOOST_RT_CLA_ARGUMENT_VALUE_USAGE_HPP_062604GER
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070018
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
Jeff Thompson3d613fd2013-10-15 15:39:04 -070035namespace NDNBOOST_RT_PARAM_NAMESPACE {
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070036
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{
Jeff Thompson3d613fd2013-10-15 15:39:04 -070050 fs << NDNBOOST_RT_PARAM_CSTRING_LITERAL( "<value>" );
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070051}
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{
Jeff Thompson3d613fd2013-10-15 15:39:04 -070060 fs << NDNBOOST_RT_PARAM_CSTRING_LITERAL( "(<value1>, ..., <valueN>)" );
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070061}
62
63//____________________________________________________________________________//
64
65// specialization for type bool
66inline void
67argument_value_usage( format_stream& fs, int, bool* = 0 )
68{
Jeff Thompson3d613fd2013-10-15 15:39:04 -070069 fs << NDNBOOST_RT_PARAM_CSTRING_LITERAL( "yes|y|no|n" );
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070070}
71
72//____________________________________________________________________________//
73
74} // namespace rt_cla_detail
75
76} // namespace cla
77
Jeff Thompson3d613fd2013-10-15 15:39:04 -070078} // namespace NDNBOOST_RT_PARAM_NAMESPACE
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070079
80} // namespace ndnboost
81
Jeff Thompson3d613fd2013-10-15 15:39:04 -070082#endif // NDNBOOST_RT_CLA_ARGUMENT_VALUE_USAGE_HPP_062604GER