File indexing completed on 2025-01-18 09:50:14
0001
0002
0003
0004
0005
0006
0007 #ifndef BOOST_CMDLINE_VP_2003_05_19
0008 #define BOOST_CMDLINE_VP_2003_05_19
0009
0010 #include <boost/program_options/config.hpp>
0011 #include <boost/program_options/errors.hpp>
0012 #include <boost/program_options/cmdline.hpp>
0013 #include <boost/program_options/option.hpp>
0014 #include <boost/program_options/options_description.hpp>
0015 #include <boost/program_options/positional_options.hpp>
0016
0017
0018 #include <boost/detail/workaround.hpp>
0019
0020 #include <boost/function.hpp>
0021
0022 #include <string>
0023 #include <vector>
0024
0025 #if defined(BOOST_MSVC)
0026 # pragma warning (push)
0027 # pragma warning (disable:4251)
0028 #endif
0029
0030 namespace boost { namespace program_options { namespace detail {
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059 class BOOST_PROGRAM_OPTIONS_DECL cmdline {
0060 public:
0061
0062 typedef ::boost::program_options::command_line_style::style_t style_t;
0063
0064 typedef function1<std::pair<std::string, std::string>,
0065 const std::string&>
0066 additional_parser;
0067
0068 typedef function1<std::vector<option>, std::vector<std::string>&>
0069 style_parser;
0070
0071
0072
0073
0074
0075
0076
0077
0078 cmdline(const std::vector<std::string>& args);
0079
0080
0081 cmdline(int argc, const char*const * argv);
0082
0083 void style(int style);
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094 int get_canonical_option_prefix();
0095
0096 void allow_unregistered();
0097
0098 void set_options_description(const options_description& desc);
0099 void set_positional_options(
0100 const positional_options_description& m_positional);
0101
0102 std::vector<option> run();
0103
0104 std::vector<option> parse_long_option(std::vector<std::string>& args);
0105 std::vector<option> parse_short_option(std::vector<std::string>& args);
0106 std::vector<option> parse_dos_option(std::vector<std::string>& args);
0107 std::vector<option> parse_disguised_long_option(
0108 std::vector<std::string>& args);
0109 std::vector<option> parse_terminator(
0110 std::vector<std::string>& args);
0111 std::vector<option> handle_additional_parser(
0112 std::vector<std::string>& args);
0113
0114
0115
0116
0117
0118
0119
0120
0121
0122
0123 void set_additional_parser(additional_parser p);
0124
0125 void extra_style_parser(style_parser s);
0126
0127 void check_style(int style) const;
0128
0129 bool is_style_active(style_t style) const;
0130
0131 void init(const std::vector<std::string>& args);
0132
0133 void
0134 finish_option(option& opt,
0135 std::vector<std::string>& other_tokens,
0136 const std::vector<style_parser>& style_parsers);
0137
0138
0139 std::vector<std::string> m_args;
0140 style_t m_style;
0141 bool m_allow_unregistered;
0142
0143 const options_description* m_desc;
0144 const positional_options_description* m_positional;
0145
0146 additional_parser m_additional_parser;
0147 style_parser m_style_parser;
0148 };
0149
0150 void test_cmdline_detail();
0151
0152 }}}
0153
0154 #if defined(BOOST_MSVC)
0155 # pragma warning (pop)
0156 #endif
0157
0158 #endif
0159