From b6e100b94b12f3f92ec025dc2363eaf7c0ee6662 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 10 Apr 2007 16:02:07 +0000 Subject: Well, we've got the basis of a workable unit test harness thing. There should be a few more add-ons to it, but it works just fine, and eventually it should cover command line options and creating logs, and possibly even provide output functionality so that output from tests can be logged and kept track of well. --- src/fstring.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/fstring.h') diff --git a/src/fstring.h b/src/fstring.h index 0184301..751beb8 100644 --- a/src/fstring.h +++ b/src/fstring.h @@ -364,6 +364,30 @@ namespace Bu } } + long find( const char *sText ) + { + long nTLen = strlen( sText ); + flatten(); + for( long j = 0; j < pFirst->nLength-nTLen; j++ ) + { + if( !strncmp( sText, pFirst->pData+j, nTLen ) ) + return j; + } + return -1; + } + + long rfind( const char *sText ) + { + long nTLen = strlen( sText ); + flatten(); + for( long j = pFirst->nLength-nTLen-1; j >= 0; j-- ) + { + if( !strncmp( sText, pFirst->pData+j, nTLen ) ) + return j; + } + return -1; + } + void archive( class Archive &ar ) { if( ar.isLoading() ) -- cgit v1.2.3