You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
For further information visit http://plib.sourceforge.net
class NetChat : public NetBufferChannel
{
- char* terminator;
-
+ std::string terminator;
+ int bytesToCollect;
+
+protected:
virtual void handleBufferRead (NetBuffer& buffer) ;
public:
- NetChat () : terminator (0) {}
+ NetChat () :
+ bytesToCollect(-1)
+ {}
+
+ void setTerminator(const std::string& t);
+ const char* getTerminator() const;
- void setTerminator (const char* t);
- const char* getTerminator (void);
+ /**
+ * set byte count to collect - 'foundTerminator' will be called once
+ * this many bytes have been collected
+ */
+ void setByteCount(int bytes);
bool push (const char* s);