1 // Copyright Vladimir Prus 2004.
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE_1_0.txt
4 // or copy at http://www.boost.org/LICENSE_1_0.txt)
6 #ifndef BOOST_OPTION_HPP_VP_2004_02_25
7 #define BOOST_OPTION_HPP_VP_2004_02_25
9 #include <boost/program_options/config.hpp>
14 namespace boost { namespace program_options {
16 /** Option found in input source.
17 Contains a key and a value. The key, in turn, can be a string (name of
18 an option), or an integer (position in input source) \-- in case no name
19 is specified. The latter is only possible for command line.
20 The template parameter specifies the type of char used for storing the
29 , case_insensitive(false)
31 basic_option(const std::string& xstring_key,
32 const std::vector< std::string> &xvalue)
33 : string_key(xstring_key)
36 , case_insensitive(false)
39 /** String key of this option. Intentionally independent of the template
41 std::string string_key;
42 /** Position key of this option. All options without an explicit name are
43 sequentially numbered starting from 0. If an option has explicit name,
44 'position_key' is equal to -1. It is possible that both
45 position_key and string_key is specified, in case name is implicitly
50 std::vector< std::basic_string<charT> > value;
51 /** The original unchanged tokens this option was
53 std::vector< std::basic_string<charT> > original_tokens;
54 /** True if option was not recognized. In that case,
55 'string_key' and 'value' are results of purely
56 syntactic parsing of source. The original tokens can be
57 recovered from the "original_tokens" member.
60 /** True if string_key has to be handled
63 bool case_insensitive;
65 typedef basic_option<char> option;
66 typedef basic_option<wchar_t> woption;