5

Here is what I'm looking for.

I'd like to find a library or method that formats output text, such that it word wraps at 80 columns (or user configurable), and allows user defined indentation.

I know that I could create one, but I suspect that there is already a library available that does this. I've googled around and I've found pages for iomanip -- which gave me ideas for creating my own.

I've done a cursory search through the boost libraries, but I didn't really find anything that quite matched.

Tobu
  • 24,771
  • 4
  • 91
  • 98
John Rocha
  • 1,656
  • 3
  • 19
  • 30

3 Answers3

4

Here it is, search harder next time ;)

2.2.4. Line-Wrapping Filters

http://www.boost.org/doc/libs/1_47_0/libs/iostreams/doc/tutorial/line_wrapping_filters.html

K-ballo
  • 80,396
  • 20
  • 159
  • 169
1

https://github.com/catchorg/textflowcpp is probably the best way to do this nowadays.

makeworld
  • 1,266
  • 12
  • 17
1

If you're on a POSIX platform, you could look at ncurses or termcap and see if they will accomplish what you need.

Swiss
  • 5,556
  • 1
  • 28
  • 42