X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fio%2Fsg_netChat.hxx;h=abba2b68479c485b0c1f2b11c9ea5116a0870102;hb=45f642c4e4e966f573154b5253d72335492ed4dd;hp=e9ab2e039d9384aa9936e45433dcf80083c93c7c;hpb=bfd76880a9ca297d308a7a8c5b3ee154ab1187d2;p=simgear.git diff --git a/simgear/io/sg_netChat.hxx b/simgear/io/sg_netChat.hxx index e9ab2e03..abba2b68 100644 --- a/simgear/io/sg_netChat.hxx +++ b/simgear/io/sg_netChat.hxx @@ -61,6 +61,8 @@ #ifndef SG_NET_CHAT_H #define SG_NET_CHAT_H +#include +#include #include namespace simgear @@ -69,16 +71,25 @@ namespace simgear class NetChat : public NetBufferChannel { char* terminator; - + int bytesToCollect; virtual void handleBufferRead (NetBuffer& buffer) ; public: - NetChat () : terminator (0) {} + NetChat () : + terminator (NULL), + bytesToCollect(-1) + {} 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); virtual void collectIncomingData (const char* s, int n) {}