diff options
author | Mike Buland <eichlan@xagasoft.com> | 2015-08-22 18:27:31 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2015-08-22 18:27:31 +0000 |
commit | 61165ba36ee0cbada8a97d075bdaaf13cb5c5a4a (patch) | |
tree | ab4e4a34193fdf3f0ab76ebce0b280a854410c74 | |
parent | 13c4e8415e2f86e6dc389d6b53bd54aa1c50d8c2 (diff) | |
download | libbu++-61165ba36ee0cbada8a97d075bdaaf13cb5c5a4a.tar.gz libbu++-61165ba36ee0cbada8a97d075bdaaf13cb5c5a4a.tar.bz2 libbu++-61165ba36ee0cbada8a97d075bdaaf13cb5c5a4a.tar.xz libbu++-61165ba36ee0cbada8a97d075bdaaf13cb5c5a4a.zip |
Added some handy functions to inject data back into the telnet buffer.
This is great if you want to pre-fill a field, say.
Diffstat (limited to '')
-rw-r--r-- | src/stable/protocoltelnet.cpp | 10 | ||||
-rw-r--r-- | src/stable/protocoltelnet.h | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/stable/protocoltelnet.cpp b/src/stable/protocoltelnet.cpp index f6fbd4b..51e33a8 100644 --- a/src/stable/protocoltelnet.cpp +++ b/src/stable/protocoltelnet.cpp | |||
@@ -347,6 +347,16 @@ void Bu::ProtocolTelnet::close() | |||
347 | pClient->close(); | 347 | pClient->close(); |
348 | } | 348 | } |
349 | 349 | ||
350 | void Bu::ProtocolTelnet::setBuffer( const Bu::String &sNewBuffer ) | ||
351 | { | ||
352 | sDataBuf = sNewBuffer; | ||
353 | } | ||
354 | |||
355 | void Bu::ProtocolTelnet::appendBuffer( const Bu::String &sNewData ) | ||
356 | { | ||
357 | sDataBuf += sNewData; | ||
358 | } | ||
359 | |||
350 | void Bu::ProtocolTelnet::onWill( char cCode ) | 360 | void Bu::ProtocolTelnet::onWill( char cCode ) |
351 | { | 361 | { |
352 | Bu::MutexLocker l( mWrite ); | 362 | Bu::MutexLocker l( mWrite ); |
diff --git a/src/stable/protocoltelnet.h b/src/stable/protocoltelnet.h index efc8889..23a2ee0 100644 --- a/src/stable/protocoltelnet.h +++ b/src/stable/protocoltelnet.h | |||
@@ -128,6 +128,8 @@ namespace Bu | |||
128 | void close(); | 128 | void close(); |
129 | 129 | ||
130 | const Bu::String &getBuffer() { return sDataBuf; } | 130 | const Bu::String &getBuffer() { return sDataBuf; } |
131 | void setBuffer( const Bu::String &sNewBuffer ); | ||
132 | void appendBuffer( const Bu::String &sNewData ); | ||
131 | 133 | ||
132 | public: | 134 | public: |
133 | /** | 135 | /** |