diff options
author | Mike Buland <eichlan@xagasoft.com> | 2007-10-04 10:46:46 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2007-10-04 10:46:46 +0000 |
commit | 86f9fbefa58d91e151190c969216c751573bc664 (patch) | |
tree | 4e13de2666bfb063964877986dc7b8d310714483 /src/fstring.h | |
parent | b3eef5b0b82c20a9f11868ba376f6bb2d94faae4 (diff) | |
download | libbu++-86f9fbefa58d91e151190c969216c751573bc664.tar.gz libbu++-86f9fbefa58d91e151190c969216c751573bc664.tar.bz2 libbu++-86f9fbefa58d91e151190c969216c751573bc664.tar.xz libbu++-86f9fbefa58d91e151190c969216c751573bc664.zip |
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.
Diffstat (limited to 'src/fstring.h')
-rw-r--r-- | src/fstring.h | 24 |
1 files changed, 20 insertions, 4 deletions
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 | |||
605 | 605 | ||
606 | /** | 606 | /** |
607 | * Find the index of the first occurrance of (sText) | 607 | * Find the index of the first occurrance of (sText) |
608 | *@param sText (const char *) The string to search for. | 608 | *@param sText (const chr *) The string to search for. |
609 | *@returns (long) The index of the first occurrance. -1 for not found. | 609 | *@returns (long) The index of the first occurrance. -1 for not found. |
610 | */ | 610 | */ |
611 | long find( const char *sText ) | 611 | long find( const chr cChar ) |
612 | { | ||
613 | flatten(); | ||
614 | for( long j = 0; j < pFirst->nLength; j++ ) | ||
615 | { | ||
616 | if( pFirst->pData[j] == cChar ) | ||
617 | return j; | ||
618 | } | ||
619 | return -1; | ||
620 | } | ||
621 | |||
622 | /** | ||
623 | * Find the index of the first occurrance of cChar | ||
624 | *@param cChar (const chr) The character to search for. | ||
625 | *@returns (long) The index of the first occurrance. -1 for not found. | ||
626 | */ | ||
627 | long find( const chr *sText ) | ||
612 | { | 628 | { |
613 | long nTLen = strlen( sText ); | 629 | long nTLen = strlen( sText ); |
614 | flatten(); | 630 | flatten(); |
@@ -622,10 +638,10 @@ namespace Bu | |||
622 | 638 | ||
623 | /** | 639 | /** |
624 | * Do a reverse search for (sText) | 640 | * Do a reverse search for (sText) |
625 | *@param sText (const char *) The string to search for. | 641 | *@param sText (const chr *) The string to search for. |
626 | *@returns (long) The index of the last occurrance. -1 for not found. | 642 | *@returns (long) The index of the last occurrance. -1 for not found. |
627 | */ | 643 | */ |
628 | long rfind( const char *sText ) | 644 | long rfind( const chr *sText ) |
629 | { | 645 | { |
630 | long nTLen = strlen( sText ); | 646 | long nTLen = strlen( sText ); |
631 | flatten(); | 647 | flatten(); |