From 86f9fbefa58d91e151190c969216c751573bc664 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 4 Oct 2007 10:46:46 +0000 Subject: Discovered that the Bu::Client::disconnect() function didn't do anything. That has been fixed, it now safely disconnects after emptying the Client's outgoing buffer. Added some more helpers to Bu::FString. Added the beginings of ProtocolHttp using a new method for processing protocols that's based more strongly on an NFA state machine, this makes sense, but I never had the desire to actually try implementing it before. It's working pretty well. --- src/fstring.h | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'src/fstring.h') diff --git a/src/fstring.h b/src/fstring.h index 9de6a56..0306aa1 100644 --- a/src/fstring.h +++ b/src/fstring.h @@ -605,10 +605,26 @@ namespace Bu /** * Find the index of the first occurrance of (sText) - *@param sText (const char *) The string to search for. + *@param sText (const chr *) The string to search for. *@returns (long) The index of the first occurrance. -1 for not found. */ - long find( const char *sText ) + long find( const chr cChar ) + { + flatten(); + for( long j = 0; j < pFirst->nLength; j++ ) + { + if( pFirst->pData[j] == cChar ) + return j; + } + return -1; + } + + /** + * Find the index of the first occurrance of cChar + *@param cChar (const chr) The character to search for. + *@returns (long) The index of the first occurrance. -1 for not found. + */ + long find( const chr *sText ) { long nTLen = strlen( sText ); flatten(); @@ -622,10 +638,10 @@ namespace Bu /** * Do a reverse search for (sText) - *@param sText (const char *) The string to search for. + *@param sText (const chr *) The string to search for. *@returns (long) The index of the last occurrance. -1 for not found. */ - long rfind( const char *sText ) + long rfind( const chr *sText ) { long nTLen = strlen( sText ); flatten(); -- cgit v1.2.3