diff options
author | Mike Buland <eichlan@xagasoft.com> | 2010-05-16 05:19:24 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2010-05-16 05:19:24 +0000 |
commit | 8b30bc900f17659d14aeb344e2b4d13d09d334ea (patch) | |
tree | 3aac19a53bda92fee98a76517cccd67b3c1ae0e6 /src | |
parent | 306b80c1cf9ab490a83b36d3e7cf07e09f9e5d68 (diff) | |
download | libbu++-8b30bc900f17659d14aeb344e2b4d13d09d334ea.tar.gz libbu++-8b30bc900f17659d14aeb344e2b4d13d09d334ea.tar.bz2 libbu++-8b30bc900f17659d14aeb344e2b4d13d09d334ea.tar.xz libbu++-8b30bc900f17659d14aeb344e2b4d13d09d334ea.zip |
Added operators <= and >= to the FBasicString.
Diffstat (limited to '')
-rw-r--r-- | src/fbasicstring.h | 32 |
1 files changed, 32 insertions, 0 deletions
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 | |||
1547 | 1547 | ||
1548 | return false; | 1548 | return false; |
1549 | } | 1549 | } |
1550 | |||
1551 | bool operator<=(const MyType &pData ) const | ||
1552 | { | ||
1553 | flatten(); | ||
1554 | pData.flatten(); | ||
1555 | |||
1556 | const chr *a = core->pFirst->pData; | ||
1557 | chr *b = pData.core->pFirst->pData; | ||
1558 | for( long j = 0; j < core->nLength; j++, a++, b++ ) | ||
1559 | { | ||
1560 | if( *a != *b ) | ||
1561 | return *a < *b; | ||
1562 | } | ||
1563 | |||
1564 | return true; | ||
1565 | } | ||
1550 | 1566 | ||
1551 | bool operator>(const MyType &pData ) const | 1567 | bool operator>(const MyType &pData ) const |
1552 | { | 1568 | { |
@@ -1564,6 +1580,22 @@ namespace Bu | |||
1564 | return false; | 1580 | return false; |
1565 | } | 1581 | } |
1566 | 1582 | ||
1583 | bool operator>=(const MyType &pData ) const | ||
1584 | { | ||
1585 | flatten(); | ||
1586 | pData.flatten(); | ||
1587 | |||
1588 | const chr *a = core->pFirst->pData; | ||
1589 | chr *b = pData.core->pFirst->pData; | ||
1590 | for( long j = 0; j < core->nLength; j++, a++, b++ ) | ||
1591 | { | ||
1592 | if( *a != *b ) | ||
1593 | return *a > *b; | ||
1594 | } | ||
1595 | |||
1596 | return true; | ||
1597 | } | ||
1598 | |||
1567 | /** | 1599 | /** |
1568 | * Indexing operator | 1600 | * Indexing operator |
1569 | *@param nIndex (long) The index of the character you want. | 1601 | *@param nIndex (long) The index of the character you want. |