summaryrefslogtreecommitdiff
path: root/boost/program_options/errors.hpp
diff options
context:
space:
mode:
authorChanho Park <chanho61.park@samsung.com>2014-12-11 18:55:56 +0900
committerChanho Park <chanho61.park@samsung.com>2014-12-11 18:55:56 +0900
commit08c1e93fa36a49f49325a07fe91ff92c964c2b6c (patch)
tree7a7053ceb8874b28ec4b868d4c49b500008a102e /boost/program_options/errors.hpp
parentbb4dd8289b351fae6b55e303f189127a394a1edd (diff)
downloadboost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.tar.gz
boost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.tar.bz2
boost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.zip
Imported Upstream version 1.57.0upstream/1.57.0
Diffstat (limited to 'boost/program_options/errors.hpp')
-rw-r--r--boost/program_options/errors.hpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/boost/program_options/errors.hpp b/boost/program_options/errors.hpp
index addb8d6d59..f31defbd36 100644
--- a/boost/program_options/errors.hpp
+++ b/boost/program_options/errors.hpp
@@ -25,7 +25,8 @@ namespace boost { namespace program_options {
inline std::string strip_prefixes(const std::string& text)
{
- return text.substr(text.find_last_of("-/") + 1);
+ // "--foo-bar" -> "foo-bar"
+ return text.substr(text.find_first_not_of("-/"));
}
/** Base class for all errors in the library. */
@@ -104,13 +105,13 @@ namespace boost { namespace program_options {
std::map<std::string, string_pair > m_substitution_defaults;
public:
- /** template with placeholders */
- std::string m_error_template;
+ /** template with placeholders */
+ std::string m_error_template;
- error_with_option_name(const std::string& template_,
- const std::string& option_name = "",
- const std::string& original_token = "",
- int option_style = 0);
+ error_with_option_name(const std::string& template_,
+ const std::string& option_name = "",
+ const std::string& original_token = "",
+ int option_style = 0);
/** gcc says that throw specification on dtor is loosened
* without this line
@@ -250,7 +251,7 @@ namespace boost { namespace program_options {
}
/** Does NOT set option name, because no option name makes sense */
- virtual void set_option_name(const std::string& option_name){}
+ virtual void set_option_name(const std::string&) {}
~error_with_no_option_name() throw() {}
};