wibble  1.1
wordwrap.h
Go to the documentation of this file.
1 #include <string>
2 
3 using namespace std;
4 
5 namespace wibble {
6 namespace text {
7 
26 class WordWrap
27 {
28  std::string s;
29  size_t cursor;
30 
31 public:
35  WordWrap(const std::string& s) : s(s), cursor(0) {}
36 
41  void restart() { cursor = 0; }
42 
46  bool hasData() const { return cursor < s.size(); }
47 
52  std::string get(unsigned int width);
53 };
54 
55 }
56 }
57 
58 
59 // vim:set ts=4 sw=4: