#include <cstdlib>
#include <iostream>
#include <iomanip>
#include <regex>
#include <system_error>
#include <filesystem>
#include <string>
#include <numeric>
#include <boost/algorithm/string.hpp>
#include <boost/version.hpp>
#include <boost/program_options.hpp>
#include <boost/exception/all.hpp>
#include <boost/property_tree/info_parser.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <boost/property_tree/xml_parser.hpp>
#include "colours.h"
#include "Options.h"
#include "version.h"
◆ set_mute()
void set_mute |
( |
bool |
flag | ) |
|
Function used by Boost::PO to disable standard error.
95 if (flag) cout.setstate(ios_base::failbit);
◆ wrap_paragraph()
string wrap_paragraph |
( |
const string & |
text | ) |
|
Wraps a given paragraph to fit within the same number of characters as the standard helper message from Boost Program Options.
151 if (text.size() == 0)
return text;
153 vector<string> paragraphs;
154 al::split(paragraphs, text, al::is_any_of(
"\n"));
157 for (
auto const& paragraph: paragraphs) {
158 vector<string> words;
159 al::split(words, paragraph, al::is_any_of(
" \t"), al::token_compress_on);
162 for (
auto const& word: words) {
163 size_t s = line.size() + word.size();
164 static const size_t sMax = po::options_description::m_default_line_length;
177 wrapped += line +
'\n';