From 2dd476ff6dc904174446f269eeb97ccf9ed8c379 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 7 Jan 2010 00:21:32 +0000 Subject: Added a function that really should have always been in FString... --- default.bld | 3 +++ src/fbasicstring.h | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/default.bld b/default.bld index d3cf06b..9a5c637 100644 --- a/default.bld +++ b/default.bld @@ -48,6 +48,7 @@ target files("src/tools/*.cpp").replace("src/tools/","").replace(".cpp","") { input "src/tools/${OUTPUT}.cpp"; rule "exe"; + requires "libbu++.a"; tag "tools"; CXXFLAGS += "-I."; LDFLAGS += "-L. -lbu++"; @@ -61,6 +62,7 @@ target files("src/tests/*.cpp").replace("src/","").replace(".cpp","") { input "src/${OUTPUT}.cpp"; rule "exe"; + requires "libbu++.a"; tag ["tests", "general tests"]; CXXFLAGS += "-I."; LDFLAGS += "-L. -lbu++"; @@ -87,6 +89,7 @@ target files("src/unit/*.unit").replace("src/","").replace(".unit","") { input "src/${OUTPUT}.unit"; rule "exe"; + requires "libbu++.a"; tag ["tests", "unit tests"]; CXXFLAGS += "-I."; LDFLAGS += "-L. -lbu++"; diff --git a/src/fbasicstring.h b/src/fbasicstring.h index c885cbb..838fbc2 100644 --- a/src/fbasicstring.h +++ b/src/fbasicstring.h @@ -758,6 +758,25 @@ namespace Bu _hardCopy(); core->appendChunk( pNew ); } + + /** + * Append data to your string. + *@param pData (const chr *) The data to append. + *@param nStart (long) The start position to copy from. + *@param nLen (long) The length of the data to append. + */ + void append( const chr *pData, long nStart, long nLen ) + { + if( nLen == 0 ) + return; + + Chunk *pNew = core->newChunk( nLen ); + + cpy( pNew->pData, pData+nStart, nLen ); + + _hardCopy(); + core->appendChunk( pNew ); + } /** * Append a single chr to your string. -- cgit v1.2.3