48 while (std::getline(
_ss, s))
51 if (s.length() > MAX_LINE_LENGTH)
53 const std::string continuation(
"...");
54 const size_t cont_len = continuation.length();
55 size_t num_lines = s.length() / (MAX_LINE_LENGTH - cont_len) + 1;
56 std::string split_line;
57 for (
size_t j = 0, l_begin = 0; j < num_lines; ++j, l_begin += MAX_LINE_LENGTH - cont_len)
59 size_t l_len = MAX_LINE_LENGTH - cont_len;
60 if (s.length() < l_begin + l_len)
61 l_len = s.length() - l_begin;
63 split_line = s.substr(l_begin, l_len);
65 if (l_begin + l_len != s.length())
66 split_line += continuation;