mirror of
https://github.com/boostorg/program_options.git
synced 2026-01-27 07:02:14 +00:00
Compare commits
1 Commits
svn-branch
...
svn-branch
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
112dc094b0 |
@@ -107,7 +107,7 @@ if (vm.count("response-file")) {
|
||||
// Load the file and tokenize it
|
||||
ifstream ifs(vm["response-file"].as<string>().c_str());
|
||||
if (!ifs) {
|
||||
cout << "Could not open the response file\n";
|
||||
cout << "Could no open the response file\n";
|
||||
return 1;
|
||||
}
|
||||
// Read the whole file into a string
|
||||
@@ -146,7 +146,7 @@ if (vm.count("response-file")) {
|
||||
vector<string> args = split_winmain(lpCmdLine);
|
||||
store(command_line_parser(args).options(desc).run(), vm);
|
||||
</programlisting>
|
||||
The <code>split_winmain</code> function is overloaded for <code>wchar_t</code> strings, so can
|
||||
The function is an overload for <code>wchar_t</code> strings, so can
|
||||
also be used in Unicode applications.
|
||||
</para>
|
||||
|
||||
|
||||
@@ -29,8 +29,8 @@ namespace boost { namespace program_options {
|
||||
template<class charT>
|
||||
basic_command_line_parser<charT>::
|
||||
basic_command_line_parser(const std::vector<
|
||||
std::basic_string<charT> >& xargs)
|
||||
: detail::cmdline(to_internal(xargs))
|
||||
std::basic_string<charT> >& args)
|
||||
: detail::cmdline(to_internal(args))
|
||||
{}
|
||||
|
||||
|
||||
@@ -64,9 +64,9 @@ namespace boost { namespace program_options {
|
||||
|
||||
template<class charT>
|
||||
basic_command_line_parser<charT>&
|
||||
basic_command_line_parser<charT>::style(int xstyle)
|
||||
basic_command_line_parser<charT>::style(int style)
|
||||
{
|
||||
detail::cmdline::style(xstyle);
|
||||
detail::cmdline::style(style);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
@@ -143,9 +143,9 @@ namespace boost { namespace program_options {
|
||||
a validator for class T, we use it even
|
||||
when parsing vector<T>. */
|
||||
boost::any a;
|
||||
std::vector<std::basic_string<charT> > cv;
|
||||
cv.push_back(s[i]);
|
||||
validate(a, cv, (T*)0, 0);
|
||||
std::vector<std::basic_string<charT> > v;
|
||||
v.push_back(s[i]);
|
||||
validate(a, v, (T*)0, 0);
|
||||
tv->push_back(boost::any_cast<T>(a));
|
||||
}
|
||||
catch(const bad_lexical_cast& /*e*/) {
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace boost { namespace program_options {
|
||||
/** Base class for all errors in the library. */
|
||||
class BOOST_PROGRAM_OPTIONS_DECL error : public std::logic_error {
|
||||
public:
|
||||
error(const std::string& xwhat) : std::logic_error(xwhat) {}
|
||||
error(const std::string& what) : std::logic_error(what) {}
|
||||
};
|
||||
|
||||
class BOOST_PROGRAM_OPTIONS_DECL invalid_syntax : public error {
|
||||
@@ -78,9 +78,9 @@ namespace boost { namespace program_options {
|
||||
class BOOST_PROGRAM_OPTIONS_DECL ambiguous_option : public error {
|
||||
public:
|
||||
ambiguous_option(const std::string& name,
|
||||
const std::vector<std::string>& xalternatives)
|
||||
const std::vector<std::string>& alternatives)
|
||||
: error(std::string("ambiguous option ").append(name))
|
||||
, m_alternatives(xalternatives)
|
||||
, m_alternatives(alternatives)
|
||||
, m_option_name(name)
|
||||
{}
|
||||
|
||||
|
||||
@@ -28,10 +28,10 @@ namespace boost { namespace program_options {
|
||||
, unregistered(false)
|
||||
, case_insensitive(false)
|
||||
{}
|
||||
basic_option(const std::string& xstring_key,
|
||||
const std::vector< std::string> &xvalue)
|
||||
: string_key(xstring_key)
|
||||
, value(xvalue)
|
||||
basic_option(const std::string& string_key,
|
||||
const std::vector< std::string> &value)
|
||||
: string_key(string_key)
|
||||
, value(value)
|
||||
, unregistered(false)
|
||||
, case_insensitive(false)
|
||||
{}
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace program_options {
|
||||
The 'name' parameter is interpreted by the following rules:
|
||||
- if there's no "," character in 'name', it specifies long name
|
||||
- otherwise, the part before "," specifies long name and the part
|
||||
after -- short name.
|
||||
after -- long name.
|
||||
*/
|
||||
option_description(const char* name,
|
||||
const value_semantic* s);
|
||||
@@ -81,12 +81,12 @@ namespace program_options {
|
||||
enum match_result { no_match, full_match, approximate_match };
|
||||
|
||||
/** Given 'option', specified in the input source,
|
||||
returns 'true' if 'option' specifies *this.
|
||||
return 'true' is 'option' specifies *this.
|
||||
*/
|
||||
match_result match(const std::string& option, bool approx,
|
||||
bool long_ignore_case, bool short_ignore_case) const;
|
||||
|
||||
/** Returns the key that should identify the option, in
|
||||
/** Return the key that should identify the option, in
|
||||
particular in the variables_map class.
|
||||
The 'option' parameter is the option spelling from the
|
||||
input source.
|
||||
@@ -107,7 +107,7 @@ namespace program_options {
|
||||
/// Returns the option name, formatted suitably for usage message.
|
||||
std::string format_name() const;
|
||||
|
||||
/** Returns the parameter name and properties, formatted suitably for
|
||||
/** Return the parameter name and properties, formatted suitably for
|
||||
usage message. */
|
||||
std::string format_parameter() const;
|
||||
|
||||
@@ -211,7 +211,7 @@ namespace program_options {
|
||||
friend BOOST_PROGRAM_OPTIONS_DECL std::ostream& operator<<(std::ostream& os,
|
||||
const options_description& desc);
|
||||
|
||||
/** Outputs 'desc' to the specified stream, calling 'f' to output each
|
||||
/** Output 'desc' to the specified stream, calling 'f' to output each
|
||||
option_description element. */
|
||||
void print(std::ostream& os) const;
|
||||
|
||||
@@ -247,7 +247,7 @@ namespace program_options {
|
||||
/** Class thrown when duplicate option description is found. */
|
||||
class BOOST_PROGRAM_OPTIONS_DECL duplicate_option_error : public error {
|
||||
public:
|
||||
duplicate_option_error(const std::string& xwhat) : error(xwhat) {}
|
||||
duplicate_option_error(const std::string& what) : error(what) {}
|
||||
};
|
||||
}}
|
||||
|
||||
|
||||
@@ -31,8 +31,8 @@ namespace boost { namespace program_options {
|
||||
template<class charT>
|
||||
class basic_parsed_options {
|
||||
public:
|
||||
explicit basic_parsed_options(const options_description* xdescription)
|
||||
: description(xdescription) {}
|
||||
explicit basic_parsed_options(const options_description* description)
|
||||
: description(description) {}
|
||||
/** Options found in the source. */
|
||||
std::vector< basic_option<charT> > options;
|
||||
/** Options description that was used for parsing.
|
||||
|
||||
@@ -53,8 +53,8 @@ namespace boost { namespace program_options {
|
||||
class BOOST_PROGRAM_OPTIONS_DECL variable_value {
|
||||
public:
|
||||
variable_value() : m_defaulted(false) {}
|
||||
variable_value(const boost::any& xv, bool xdefaulted)
|
||||
: v(xv), m_defaulted(xdefaulted)
|
||||
variable_value(const boost::any& v, bool defaulted)
|
||||
: v(v), m_defaulted(defaulted)
|
||||
{}
|
||||
|
||||
/** If stored value if of type T, returns that value. Otherwise,
|
||||
|
||||
Reference in New Issue
Block a user