11 void wrapAndPrintLine(std::ostream& os,
std::string const&
text,
size_t indent,
size_t suggestedWidth) {
12 char oldFill = os.fill();
14 size_t length =
text.size();
17 size_t startLine = 0
U;
20 size_t startNextSearch = 0
U;
26 if ((length - startLine) <= suggestedWidth) {
27 os << std::setfill(
' ') << std::setw(
indent) <<
"";
31 os <<
text.substr(startLine);
37 size_t pos =
text.find_first_of(
' ', startNextSearch);
40 if (
pos == std::string::npos) {
45 if (startNextSearch != startLine) {
46 os << std::setfill(
' ') << std::setw(
indent) <<
"";
47 os <<
text.substr(startLine, startNextSearch - startLine);
49 startLine = startNextSearch;
51 os << std::setfill(
' ') << std::setw(
indent) <<
"";
52 os <<
text.substr(startLine);
57 if ((
pos + 1
U - startLine) > suggestedWidth) {
62 if (startNextSearch != startLine) {
63 os << std::setfill(
' ') << std::setw(
indent) <<
"";
64 os <<
text.substr(startLine, startNextSearch - startLine);
66 startLine = startNextSearch;
68 if ((
pos + 1
U - startLine) > suggestedWidth) {
69 os << std::setfill(
' ') << std::setw(
indent) <<
"";
70 os <<
text.substr(startLine,
pos + 1
U - startLine);
75 startNextSearch =
pos + 1
U;
101 size_t suggestedWidth) {
102 size_t pos =
text.find_first_of(
'\n');
103 if (
pos == std::string::npos) {
105 wrapAndPrintLine(os,
text,
indent, suggestedWidth);
108 wrapAndPrintLine(os,
text.substr(0,
pos),
indent, suggestedWidth);
135 char oldFill = os.fill();
136 os << std::setfill(
' ') << std::setw(
indentation_) <<
"";
141 char oldFill = os.fill();
151 auto iter = std::find_if(
const char * pluginCategory()