summaryrefslogtreecommitdiff
path: root/sal/inc/rtl/strbuf.hxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2011-12-02 08:43:50 +0100
committerStephan Bergmann <sbergman@redhat.com>2011-12-02 11:08:15 +0100
commit05fddab006719d9d023787d7e6ee9b979907c048 (patch)
tree935272c6fec6d5b926e769d59f72e97ce052b2b7 /sal/inc/rtl/strbuf.hxx
parent0f1b0e5b7ad813069630e7ae719a800ecab640a8 (diff)
Revert "Remove charAt/setCharAt once and for all"
For backwards compatibility, they should not be removed before LO 4. They should be marked as SAL_DEPRECATED, however. This reverts commit 1820e7f575dffe53062f50f08cebf0efa37e2cc2.
Diffstat (limited to 'sal/inc/rtl/strbuf.hxx')
-rw-r--r--sal/inc/rtl/strbuf.hxx36
1 files changed, 36 insertions, 0 deletions
diff --git a/sal/inc/rtl/strbuf.hxx b/sal/inc/rtl/strbuf.hxx
index e3ae74bc3b5f..3ea6bc0db216 100644
--- a/sal/inc/rtl/strbuf.hxx
+++ b/sal/inc/rtl/strbuf.hxx
@@ -269,6 +269,42 @@ public:
}
/**
+ Returns the character at a specific index in this string buffer.
+
+ The first character of a string buffer is at index
+ <code>0</code>, the next at index <code>1</code>, and so on, for
+ array indexing.
+ <p>
+ The index argument must be greater than or equal to
+ <code>0</code>, and less than the length of this string buffer.
+
+ @param index the index of the desired character.
+ @return the character at the specified index of this string buffer.
+ */
+ sal_Char charAt( sal_Int32 index )
+ {
+ assert(index >= 0 && index < pData->length);
+ return pData->buffer[ index ];
+ }
+
+ /**
+ The character at the specified index of this string buffer is set
+ to <code>ch</code>.
+
+ The index argument must be greater than or equal to
+ <code>0</code>, and less than the length of this string buffer.
+
+ @param index the index of the character to modify.
+ @param ch the new character.
+ */
+ OStringBuffer & setCharAt(sal_Int32 index, sal_Char ch)
+ {
+ assert(index >= 0 && index < pData->length);
+ pData->buffer[ index ] = ch;
+ return *this;
+ }
+
+ /**
Return a null terminated character array.
*/
const sal_Char* getStr() const { return pData->buffer; }