wordwrap.h
Go to the documentation of this file.
#include <string>
using namespace std;
namespace wibble {
namespace text {
class WordWrap
{
std::string s;
size_t cursor;
public:
WordWrap(const std::string& s) : s(s), cursor(0) {}
void restart() { cursor = 0; }
bool hasData() const { return cursor < s.size(); }
std::string get(unsigned int width);
};
}
}
// vim:set ts=4 sw=4:
wibble::text::WordWrap
Simple string wrapper.
Definition: wordwrap.h:27
wibble::text::WordWrap::restart
void restart()
Rewind the word wrapper, restarting the output from the beginning of the string.
Definition: wordwrap.h:41
wibble::text::WordWrap::WordWrap
WordWrap(const std::string &s)
Creates a new word wrapper that takes data from the given string.
Definition: wordwrap.h:35
wibble::text::WordWrap::hasData
bool hasData() const
Returns true if there is still data to be read in the string.
Definition: wordwrap.h:46
wibble
Definition: amorph.h:17