From bbc76396d899e6b59ce17643095c8d48f7083662 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 24 Feb 2009 02:32:55 +0000 Subject: Corrected some iterator confusion in FString and added a helper to ProtocolTelnet. I'm going to have to do some reading and find out just where ProtocolTelnet is... --- src/fbasicstring.h | 20 ++++++++++++++++---- src/protocoltelnet.h | 2 ++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/fbasicstring.h b/src/fbasicstring.h index 8303b5a..8bbbe91 100644 --- a/src/fbasicstring.h +++ b/src/fbasicstring.h @@ -150,6 +150,12 @@ namespace Bu { } + const_iterator() : + pChunk( NULL ), + iPos( 0 ) + { + } + bool operator==( const const_iterator &i ) const { return pChunk == i.pChunk && iPos == i.iPos; @@ -365,6 +371,12 @@ namespace Bu { } + iterator() : + pChunk( NULL ), + iPos( 0 ) + { + } + operator const_iterator() const { return const_iterator( pChunk, iPos ); @@ -1383,7 +1395,7 @@ namespace Bu } const_iterator find( const chr cChar, - const_iterator iStart=begin() ) const + const_iterator iStart=typename MyType::const_iterator() ) const { for( ; iStart; iStart++ ) { @@ -1394,7 +1406,7 @@ namespace Bu } const_iterator find( const chr *sText, int nLen, - const_iterator iStart=begin() ) const + const_iterator iStart=typename MyType::const_iterator() ) const { for( ; iStart; iStart++ ) { @@ -1405,7 +1417,7 @@ namespace Bu } const_iterator find( const MyType &rStr, - const_iterator iStart=begin() ) const + const_iterator iStart=typename MyType::const_iterator() ) const { for( ; iStart; iStart++ ) { @@ -1416,7 +1428,7 @@ namespace Bu } const_iterator find( const MyType &rStr, int nLen, - const_iterator iStart=begin() ) const + const_iterator iStart=typename MyType::const_iterator() ) const { for( ; iStart; iStart++ ) { diff --git a/src/protocoltelnet.h b/src/protocoltelnet.h index 532db4b..9b25c5d 100644 --- a/src/protocoltelnet.h +++ b/src/protocoltelnet.h @@ -121,6 +121,8 @@ namespace Bu void write( const char *pData, int iSize ); void write( char cData ); + const Bu::FString &getBuffer() { return sDataBuf; } + public: /** * If you wish to know the current dimensions of the client window, -- cgit v1.2.3