diff options
author | Mike Buland <eichlan@xagasoft.com> | 2010-01-07 00:21:32 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2010-01-07 00:21:32 +0000 |
commit | 2dd476ff6dc904174446f269eeb97ccf9ed8c379 (patch) | |
tree | 99d73b5024b19b6b83c91f63e64024908c772cd7 | |
parent | 845da7977140eef97189f913f9b664dd12eebe42 (diff) | |
download | libbu++-2dd476ff6dc904174446f269eeb97ccf9ed8c379.tar.gz libbu++-2dd476ff6dc904174446f269eeb97ccf9ed8c379.tar.bz2 libbu++-2dd476ff6dc904174446f269eeb97ccf9ed8c379.tar.xz libbu++-2dd476ff6dc904174446f269eeb97ccf9ed8c379.zip |
Added a function that really should have always been in FString...
Diffstat (limited to '')
-rw-r--r-- | default.bld | 3 | ||||
-rw-r--r-- | src/fbasicstring.h | 19 |
2 files changed, 22 insertions, 0 deletions
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","") | |||
48 | { | 48 | { |
49 | input "src/tools/${OUTPUT}.cpp"; | 49 | input "src/tools/${OUTPUT}.cpp"; |
50 | rule "exe"; | 50 | rule "exe"; |
51 | requires "libbu++.a"; | ||
51 | tag "tools"; | 52 | tag "tools"; |
52 | CXXFLAGS += "-I."; | 53 | CXXFLAGS += "-I."; |
53 | LDFLAGS += "-L. -lbu++"; | 54 | LDFLAGS += "-L. -lbu++"; |
@@ -61,6 +62,7 @@ target files("src/tests/*.cpp").replace("src/","").replace(".cpp","") | |||
61 | { | 62 | { |
62 | input "src/${OUTPUT}.cpp"; | 63 | input "src/${OUTPUT}.cpp"; |
63 | rule "exe"; | 64 | rule "exe"; |
65 | requires "libbu++.a"; | ||
64 | tag ["tests", "general tests"]; | 66 | tag ["tests", "general tests"]; |
65 | CXXFLAGS += "-I."; | 67 | CXXFLAGS += "-I."; |
66 | LDFLAGS += "-L. -lbu++"; | 68 | LDFLAGS += "-L. -lbu++"; |
@@ -87,6 +89,7 @@ target files("src/unit/*.unit").replace("src/","").replace(".unit","") | |||
87 | { | 89 | { |
88 | input "src/${OUTPUT}.unit"; | 90 | input "src/${OUTPUT}.unit"; |
89 | rule "exe"; | 91 | rule "exe"; |
92 | requires "libbu++.a"; | ||
90 | tag ["tests", "unit tests"]; | 93 | tag ["tests", "unit tests"]; |
91 | CXXFLAGS += "-I."; | 94 | CXXFLAGS += "-I."; |
92 | LDFLAGS += "-L. -lbu++"; | 95 | 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 | |||
758 | _hardCopy(); | 758 | _hardCopy(); |
759 | core->appendChunk( pNew ); | 759 | core->appendChunk( pNew ); |
760 | } | 760 | } |
761 | |||
762 | /** | ||
763 | * Append data to your string. | ||
764 | *@param pData (const chr *) The data to append. | ||
765 | *@param nStart (long) The start position to copy from. | ||
766 | *@param nLen (long) The length of the data to append. | ||
767 | */ | ||
768 | void append( const chr *pData, long nStart, long nLen ) | ||
769 | { | ||
770 | if( nLen == 0 ) | ||
771 | return; | ||
772 | |||
773 | Chunk *pNew = core->newChunk( nLen ); | ||
774 | |||
775 | cpy( pNew->pData, pData+nStart, nLen ); | ||
776 | |||
777 | _hardCopy(); | ||
778 | core->appendChunk( pNew ); | ||
779 | } | ||
761 | 780 | ||
762 | /** | 781 | /** |
763 | * Append a single chr to your string. | 782 | * Append a single chr to your string. |