diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-03-27 14:52:05 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-04-03 09:26:35 +0200 |
commit | 8cfa7f4dc00f3dd37e57917ef25c806b0e9e6e73 (patch) | |
tree | 35408cf40d7bf3f93ff7405695f48796abc6089b /include/rtl/ustrbuf.hxx | |
parent | 93f1c3665fcdc31c36078f179ac37fd69d3ebb00 (diff) |
add more append methods to *StringBuffer
which performs the append without needing the creation of a temporary
*String
Change-Id: If9ad3222275f26659db2e7df8d34f068977c4d17
Reviewed-on: https://gerrit.libreoffice.org/69826
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/rtl/ustrbuf.hxx')
-rw-r--r-- | include/rtl/ustrbuf.hxx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/rtl/ustrbuf.hxx b/include/rtl/ustrbuf.hxx index 62ba9f6b2cd7..9f3c8d1650ff 100644 --- a/include/rtl/ustrbuf.hxx +++ b/include/rtl/ustrbuf.hxx @@ -536,6 +536,26 @@ public: return append( str.getStr(), str.getLength() ); } + /** + Appends a portion of the string to this string buffer. + + The characters of the <code>OUString</code> argument are appended, in + order, to the contents of this string buffer, increasing the + length of this string buffer by the length of the argument. + + @param str a string. + @param beginIndex the beginning index, inclusive. + @param count the number of characters. + @return this string buffer. + @since Libreoffice 6.4 + */ + OUStringBuffer & append(const OUString &str, sal_Int32 beginIndex, sal_Int32 count) + { + assert( count == 0 || (beginIndex >= 0 && beginIndex < str.getLength()) ); + assert( beginIndex <= str.getLength() - count ); + return append( str.getStr() + beginIndex, count ); + } + #if defined LIBO_INTERNAL_ONLY OUStringBuffer & append(std::u16string_view sv) { if (sv.size() > sal_uInt32(std::numeric_limits<sal_Int32>::max())) { |