From 8b30bc900f17659d14aeb344e2b4d13d09d334ea Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Sun, 16 May 2010 05:19:24 +0000 Subject: Added operators <= and >= to the FBasicString. --- src/fbasicstring.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/fbasicstring.h b/src/fbasicstring.h index 7825600..51e36f8 100644 --- a/src/fbasicstring.h +++ b/src/fbasicstring.h @@ -1547,6 +1547,22 @@ namespace Bu return false; } + + bool operator<=(const MyType &pData ) const + { + flatten(); + pData.flatten(); + + const chr *a = core->pFirst->pData; + chr *b = pData.core->pFirst->pData; + for( long j = 0; j < core->nLength; j++, a++, b++ ) + { + if( *a != *b ) + return *a < *b; + } + + return true; + } bool operator>(const MyType &pData ) const { @@ -1564,6 +1580,22 @@ namespace Bu return false; } + bool operator>=(const MyType &pData ) const + { + flatten(); + pData.flatten(); + + const chr *a = core->pFirst->pData; + chr *b = pData.core->pFirst->pData; + for( long j = 0; j < core->nLength; j++, a++, b++ ) + { + if( *a != *b ) + return *a > *b; + } + + return true; + } + /** * Indexing operator *@param nIndex (long) The index of the character you want. -- cgit v1.2.3