void HelpWriterContext::writeTextBlock(const std::string &text) const { TextLineWrapper wrapper; wrapper.settings().setLineLength(78); const char *program = ProgramInfo::getInstance().programName().c_str(); std::string newText = replaceAll(text, "[PROGRAM]", program); outputFile().writeLine(wrapper.wrapToString(substituteMarkup(newText))); }
void TextTableFormatter::addColumnLine(int index, const std::string &text) { Impl::ColumnData &column = impl_->columnData(index); TextLineWrapper wrapper; if (column.bWrap_) { wrapper.settings().setLineLength(column.width()); } std::vector<std::string> lines(wrapper.wrapToVector(text)); column.lines_.insert(column.lines_.end(), lines.begin(), lines.end()); }