00001
00002
00003
00004
00005
00006
00007 #ifndef __WVWORDWRAP_H
00008 #define __WVWORDWRAP_H
00009
00010 #include "wvencoder.h"
00011
00020 class WvWordWrapEncoder : public WvEncoder
00021 {
00022 const int maxwidth;
00023 char *line;
00024 int width;
00025 int curindex;
00026 int wordindex;
00027 bool inword;
00028
00029 public:
00030 WvWordWrapEncoder(int maxwidth);
00031 virtual ~WvWordWrapEncoder();
00032
00033 protected:
00034
00035 virtual bool _encode(WvBuf &inbuf, WvBuf &outbuf, bool flush);
00036 virtual bool _reset();
00037
00038 private:
00039 void flushline(WvBuf &outbuf);
00040 };
00041
00042 #endif // __WVWORDWRAP_H