summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2012-11-23 18:45:07 -0600
committerNorbert Thiebaud <nthiebaud@gmail.com>2012-11-27 22:59:26 -0600
commit2a1b5e7ff56e75b16dbfd9048bb2b8154c098e4a (patch)
treec24a03cfcdc3dee2f8a52429879c5a6e15e53c23 /sal
parent43c6bfa9287d5c2ed1e771d468daaa5c9cc79f33 (diff)
add API to OUStringBuffer to make assignment/copy more versatile
Change-Id: I95cd8e97044cd5a65500d3a674995f417c4f2e29
Diffstat (limited to 'sal')
-rw-r--r--sal/inc/rtl/ustrbuf.hxx30
1 files changed, 29 insertions, 1 deletions
diff --git a/sal/inc/rtl/ustrbuf.hxx b/sal/inc/rtl/ustrbuf.hxx
index 25195f1434da..ecea7153130e 100644
--- a/sal/inc/rtl/ustrbuf.hxx
+++ b/sal/inc/rtl/ustrbuf.hxx
@@ -223,6 +223,15 @@ public:
return *this;
}
+ /** Assign to this a copy of value.
+ */
+ OUStringBuffer& operator = ( const OUString& value )
+ {
+ remove();
+ append(value);
+ return *this;
+ }
+
/**
Release the string data.
*/
@@ -385,7 +394,7 @@ public:
/**
Appends the string to this string buffer.
- The characters of the <code>String</code> argument are appended, in
+ 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.
@@ -398,6 +407,25 @@ public:
}
/**
+ Appends the content of a stringbuffer to this string buffer.
+
+ The characters of the <code>OUStringBuffer</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.
+ @return this string buffer.
+ */
+ OUStringBuffer & append(OUStringBuffer &str)
+ {
+ if(str.getLength() > 0)
+ {
+ append( str.getStr(), str.getLength() );
+ }
+ return *this;
+ }
+
+ /**
Appends the string representation of the <code>char</code> array
argument to this string buffer.