summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2014-10-19 20:22:58 (GMT)
committerTobias Markmann <tm@ayena.de>2014-10-20 13:49:33 (GMT)
commit6b22dfcf59474dd016a0355a3102a1dd3692d92c (patch)
tree2b1fd33be433a91e81fee84fdc2bf1b52575d934 /3rdParty/Boost/src/libs/program_options/src/options_description.cpp
parent38b0cb785fea8eae5e48fae56440695fdfd10ee1 (diff)
downloadswift-contrib-6b22dfcf59474dd016a0355a3102a1dd3692d92c.zip
swift-contrib-6b22dfcf59474dd016a0355a3102a1dd3692d92c.tar.bz2
Update Boost in 3rdParty to version 1.56.0.
This updates Boost in our 3rdParty directory to version 1.56.0. Updated our update.sh script to stop on error. Changed error reporting in SwiftTools/CrashReporter.cpp to SWIFT_LOG due to missing include of <iostream> with newer Boost. Change-Id: I4b35c77de951333979a524097f35f5f83d325edc
Diffstat (limited to '3rdParty/Boost/src/libs/program_options/src/options_description.cpp')
-rw-r--r--3rdParty/Boost/src/libs/program_options/src/options_description.cpp30
1 files changed, 22 insertions, 8 deletions
diff --git a/3rdParty/Boost/src/libs/program_options/src/options_description.cpp b/3rdParty/Boost/src/libs/program_options/src/options_description.cpp
index 343bd30..9d51ce9 100644
--- a/3rdParty/Boost/src/libs/program_options/src/options_description.cpp
+++ b/3rdParty/Boost/src/libs/program_options/src/options_description.cpp
@@ -604,12 +604,9 @@ namespace boost { namespace program_options {
}
}
- void
- options_description::print(std::ostream& os) const
+ unsigned
+ options_description::get_option_column_width() const
{
- if (!m_caption.empty())
- os << m_caption << ":\n";
-
/* Find the maximum width of the option column */
unsigned width(23);
unsigned i; // vc6 has broken for loop scoping
@@ -620,6 +617,11 @@ namespace boost { namespace program_options {
ss << " " << opt.format_name() << ' ' << opt.format_parameter();
width = (max)(width, static_cast<unsigned>(ss.str().size()));
}
+
+ /* Get width of groups as well*/
+ for (unsigned j = 0; j < groups.size(); ++j)
+ width = max(width, groups[j]->get_option_column_width());
+
/* this is the column were description should start, if first
column is longer, we go to a new line */
const unsigned start_of_description_column = m_line_length - m_min_description_length;
@@ -628,9 +630,20 @@ namespace boost { namespace program_options {
/* add an additional space to improve readability */
++width;
-
+ return width;
+ }
+
+ void
+ options_description::print(std::ostream& os, unsigned width) const
+ {
+ if (!m_caption.empty())
+ os << m_caption << ":\n";
+
+ if (!width)
+ width = get_option_column_width();
+
/* The options formatting style is stolen from Subversion. */
- for (i = 0; i < m_options.size(); ++i)
+ for (unsigned i = 0; i < m_options.size(); ++i)
{
if (belong_to_group[i])
continue;
@@ -643,7 +656,8 @@ namespace boost { namespace program_options {
}
for (unsigned j = 0; j < groups.size(); ++j) {
- os << "\n" << *groups[j];
+ os << "\n";
+ groups[j]->print(os, width);
}
}