18 return ch ==
' ' || ch ==
'\f' || ch ==
'\t' ||
19 ch ==
'\r' || ch ==
'\n' || ch ==
'\v';
24 out.resize(str.size());
26 std::string::size_type i = 0, last_space;
28 while (i < str.size())
30 last_space = std::string::npos;
33 for (std::string::size_type count = 0; count < wrap; ++count)
35 if (i == str.size()) {
52 if (last_space != std::string::npos)
55 out[last_space] =
'\n';
57 if (i == str.size()) {
67 while (i != str.size() && !
is_space(str[i]))
70 if (i == str.size()) {
std::string word_wrap(const std::string &str, unsigned int wrap)
Try to wrap a string to 80 columns without split words.
std::basic_string< char, std::char_traits< char >, Allocator< char > > string
string with Manager tracking