aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2009-12-21 22:24:08 +0000
committerMike Buland <eichlan@xagasoft.com>2009-12-21 22:24:08 +0000
commitd6986e5d77917cbfd1b5fab86d79c6abbd9b4aac (patch)
treeecf15c46a50ba909fb29bbf65a0dcd6e1f0f3e90 /src
parent184669188717673c4cb36698192fe8c14aa3af68 (diff)
downloadlibbu++-d6986e5d77917cbfd1b5fab86d79c6abbd9b4aac.tar.gz
libbu++-d6986e5d77917cbfd1b5fab86d79c6abbd9b4aac.tar.bz2
libbu++-d6986e5d77917cbfd1b5fab86d79c6abbd9b4aac.tar.xz
libbu++-d6986e5d77917cbfd1b5fab86d79c6abbd9b4aac.zip
Added a trimBack fonction to FBasicString that removes all occurances of once
char from the back of the string.
Diffstat (limited to 'src')
-rw-r--r--src/fbasicstring.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/fbasicstring.h b/src/fbasicstring.h
index 5271b62..c885cbb 100644
--- a/src/fbasicstring.h
+++ b/src/fbasicstring.h
@@ -1859,6 +1859,14 @@ namespace Bu
1859 core->appendChunk( pNew ); 1859 core->appendChunk( pNew );
1860 } 1860 }
1861 1861
1862 void trimBack( chr c )
1863 {
1864 if( core->pFirst == NULL )
1865 return;
1866 flatten();
1867 for( ; core->pFirst->nLength > 0 && core->pFirst->pData[core->pFirst->nLength-1] == c; core->pFirst->nLength--, core->nLength-- ) { }
1868 }
1869
1862 void format( const char *sFrmt, ...) 1870 void format( const char *sFrmt, ...)
1863 { 1871 {
1864 _hardCopy(); 1872 _hardCopy();