LibreOffice: rtl::OStringBuffer Class Reference

LibreOffice LibreOffice 5.3 SDK C/C++ API Reference

Public Member Functions | List of all members
rtl::OStringBuffer Class Reference

A string buffer implements a mutable sequence of characters. More...

`#include <strbuf.hxx>`

## Public Member Functions
| OStringBuffer ()
| Constructs a string buffer with no characters in it and an initial capacity of 16 characters. More...
| OStringBuffer (const OStringBuffer &value)
| Allocates a new string buffer that contains the same sequence of characters as the string buffer argument. More...
| OStringBuffer (int length)
| Constructs a string buffer with no characters in it and an initial capacity specified by the `length` argument. More...
| OStringBuffer (const OString &value)
| Constructs a string buffer so that it represents the same sequence of characters as the string argument. More...
template<typename T >
| OStringBuffer (const T &value, typename libreoffice_internal::CharPtrDetector< T, libreoffice_internal::Dummy >::Type=libreoffice_internal::Dummy())
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
template<typename T >
| OStringBuffer (T &value, typename libreoffice_internal::NonConstCharArrayDetector< T, libreoffice_internal::Dummy >::Type=libreoffice_internal::Dummy())
template<typename T >
| OStringBuffer (T &literal, typename libreoffice_internal::ConstCharArrayDetector< T, libreoffice_internal::Dummy >::Type=libreoffice_internal::Dummy())
| Constructs a string buffer so that it represents the same sequence of characters as the string literal. More...
| OStringBuffer (const sal_Char *value, sal_Int32 length)
| Constructs a string buffer so that it represents the same sequence of characters as the string argument. More...
OStringBuffer & | operator= (const OStringBuffer &value)
| Assign to this a copy of value. More...
OStringBuffer & | operator= (OString const &string)
| Assign from a string. More...
template<typename T >
libreoffice_internal::ConstCharArrayDetector< T, OStringBuffer & >::Type | operator= (T &literal)
| Assign from a string literal. More...
| ~OStringBuffer ()
| Release the string data. More...
OString | makeStringAndClear ()
| Fill the string data in the new string and clear the buffer. More...
sal_Int32 | getLength () const
| Returns the length (character count) of this string buffer. More...
bool | isEmpty () const
| Checks if a string buffer is empty. More...
sal_Int32 | getCapacity () const
| Returns the current capacity of the String buffer. More...
void | ensureCapacity (sal_Int32 minimumCapacity)
| Ensures that the capacity of the buffer is at least equal to the specified minimum. More...
void | setLength (sal_Int32 newLength)
| Sets the length of this String buffer. More...
sal_Char | charAt (sal_Int32 index)
| Returns the character at a specific index in this string buffer. More...
OStringBuffer & | setCharAt (sal_Int32 index, sal_Char ch)
| The character at the specified index of this string buffer is set to `ch`. More...
const sal_Char * | getStr () const
| Return a null terminated character array. More...
sal_Char & | operator[] (sal_Int32 index)
| Access to individual characters. More...
const OString | toString () const
| Return a OString instance reflecting the current content of this OStringBuffer. More...
OStringBuffer & | append (const OString &str)
| Appends the string to this string buffer. More...
template<typename T >
libreoffice_internal::CharPtrDetector< T, OStringBuffer &>::Type | append (const T &str)
| Appends the string representation of the `char` array argument to this string buffer. More...
template<typename T >
libreoffice_internal::NonConstCharArrayDetector< T, OStringBuffer &>::Type | append (T &str)
template<typename T >
libreoffice_internal::ConstCharArrayDetector< T, OStringBuffer &>::Type | append (T &literal)
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This function accepts an ASCII string literal as its argument. More...
OStringBuffer & | append (const sal_Char *str, sal_Int32 len)
| Appends the string representation of the `char` array argument to this string buffer. More...
OStringBuffer & | append (sal_Bool b)
| Appends the string representation of the `sal_Bool` argument to the string buffer. More...
OStringBuffer & | append (bool b)
| Appends the string representation of the `bool` argument to the string buffer. More...
OStringBuffer & | append (sal_Char c)
| Appends the string representation of the `char` argument to this string buffer. More...
OStringBuffer & | append (sal_Int32 i, sal_Int16 radix=10)
| Appends the string representation of the `sal_Int32` argument to this string buffer. More...
OStringBuffer & | append (sal_Int64 l, sal_Int16 radix=10)
| Appends the string representation of the `long` argument to this string buffer. More...
OStringBuffer & | append (float f)
| Appends the string representation of the `float` argument to this string buffer. More...
OStringBuffer & | append (double d)
| Appends the string representation of the `double` argument to this string buffer. More...
char * | appendUninitialized (sal_Int32 length)
| Unsafe way to make space for a fixed amount of characters to be appended into this OStringBuffer. More...
OStringBuffer & | insert (sal_Int32 offset, const OString &str)
| Inserts the string into this string buffer. More...
template<typename T >
libreoffice_internal::CharPtrDetector< T, OStringBuffer &>::Type | insert (sal_Int32 offset, const T &str)
| Inserts the string representation of the `char` array argument into this string buffer. More...
template<typename T >
libreoffice_internal::NonConstCharArrayDetector< T, OStringBuffer &>::Type | insert (sal_Int32 offset, T &str)
template<typename T >
libreoffice_internal::ConstCharArrayDetector< T, OStringBuffer &>::Type | insert (sal_Int32 offset, T &literal)
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This function accepts an ASCII string literal as its argument. More...
OStringBuffer & | insert (sal_Int32 offset, const sal_Char *str, sal_Int32 len)
| Inserts the string representation of the `char` array argument into this string buffer. More...
OStringBuffer & | insert (sal_Int32 offset, sal_Bool b)
| Inserts the string representation of the `sal_Bool` argument into this string buffer. More...
OStringBuffer & | insert (sal_Int32 offset, bool b)
| Inserts the string representation of the `bool` argument into this string buffer. More...
OStringBuffer & | insert (sal_Int32 offset, sal_Char c)
| Inserts the string representation of the `char` argument into this string buffer. More...
OStringBuffer & | insert (sal_Int32 offset, sal_Int32 i, sal_Int16 radix=10)
| Inserts the string representation of the second `sal_Int32` argument into this string buffer. More...
OStringBuffer & | insert (sal_Int32 offset, sal_Int64 l, sal_Int16 radix=10)
| Inserts the string representation of the `long` argument into this string buffer. More...
OStringBuffer | insert (sal_Int32 offset, float f)
| Inserts the string representation of the `float` argument into this string buffer. More...
OStringBuffer & | insert (sal_Int32 offset, double d)
| Inserts the string representation of the `double` argument into this string buffer. More...
OStringBuffer & | remove (sal_Int32 start, sal_Int32 len)
| Removes the characters in a substring of this sequence. More...

## Detailed Description

A string buffer implements a mutable sequence of characters.

## Constructor & Destructor Documentation

## ◆ OStringBuffer() [1/8]

rtl::OStringBuffer::OStringBuffer | ( |  | ) |
| inline

Constructs a string buffer with no characters in it and an initial capacity of 16 characters.

## ◆ OStringBuffer() [2/8]

rtl::OStringBuffer::OStringBuffer | ( | const OStringBuffer & | value | ) |
| inline

Allocates a new string buffer that contains the same sequence of characters as the string buffer argument.

Parameters

  value | a `OStringBuffer`.

## ◆ OStringBuffer() [3/8]

rtl::OStringBuffer::OStringBuffer | ( | int | length | ) |
| inlineexplicit

Constructs a string buffer with no characters in it and an initial capacity specified by the `length` argument.

Parameters

  length | the initial capacity.

## ◆ OStringBuffer() [4/8]

rtl::OStringBuffer::OStringBuffer | ( | const OString & | value | ) |
| inline

Constructs a string buffer so that it represents the same sequence of characters as the string argument.

The initial capacity of the string buffer is `16` plus the length of the string argument.

Parameters

  value | the initial string value.

## ◆ OStringBuffer() [5/8]

template<typename T >

rtl::OStringBuffer::OStringBuffer | ( | const T & | value,
|  | typename libreoffice_internal::CharPtrDetector< T, libreoffice_internal::Dummy >::Type | = `libreoffice_internal::Dummy()`
| ) |  |
| inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Since
  LibreOffice 3.6

## ◆ OStringBuffer() [6/8]

template<typename T >

rtl::OStringBuffer::OStringBuffer | ( | T & | value,
|  | typename libreoffice_internal::NonConstCharArrayDetector< T, libreoffice_internal::Dummy >::Type | = `libreoffice_internal::Dummy()`
| ) |  |
| inline

## ◆ OStringBuffer() [7/8]

template<typename T >

rtl::OStringBuffer::OStringBuffer | ( | T & | literal,
|  | typename libreoffice_internal::ConstCharArrayDetector< T, libreoffice_internal::Dummy >::Type | = `libreoffice_internal::Dummy()`
| ) |  |
| inline

Constructs a string buffer so that it represents the same sequence of characters as the string literal.

If there are any embedded \0's in the string literal, the result is undefined. Use the overload that explicitly accepts length.

Since
  LibreOffice 3.6

Parameters

  literal | a string literal

## ◆ OStringBuffer() [8/8]

rtl::OStringBuffer::OStringBuffer | ( | const sal_Char * | value,
|  | sal_Int32 | length
| ) |  |
| inline

Constructs a string buffer so that it represents the same sequence of characters as the string argument.

The initial capacity of the string buffer is `16` plus length

Parameters

  value | a character array.
  length | the number of character which should be copied. The character array length must be greater or equal than this value.

## ◆ ~OStringBuffer()

rtl::OStringBuffer::~OStringBuffer | ( |  | ) |
| inline

Release the string data.

## Member Function Documentation

## ◆ append() [1/12]

OStringBuffer& rtl::OStringBuffer::append | ( | const OString & | str | ) |
| inline

Appends the string to this string buffer.

The characters of the `String` 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.

Parameters

  str | a string.

Returns
  this string buffer.

## ◆ append() [2/12]

template<typename T >

libreoffice_internal::CharPtrDetector< T, OStringBuffer& >::Type rtl::OStringBuffer::append | ( | const T & | str | ) |
| inline

Appends the string representation of the `char` array argument to this string buffer.

The characters of the array argument are appended, in order, to the contents of this string buffer. The length of this string buffer increases by the length of the argument.

Parameters

  str | the characters to be appended.

Returns
  this string buffer.

## ◆ append() [3/12]

template<typename T >

libreoffice_internal::NonConstCharArrayDetector< T, OStringBuffer& >::Type rtl::OStringBuffer::append | ( | T & | str | ) |
| inline

## ◆ append() [4/12]

template<typename T >

libreoffice_internal::ConstCharArrayDetector< T, OStringBuffer& >::Type rtl::OStringBuffer::append | ( | T & | literal | ) |
| inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This function accepts an ASCII string literal as its argument.

Since
  LibreOffice 3.6

## ◆ append() [5/12]

OStringBuffer& rtl::OStringBuffer::append | ( | const sal_Char * | str,
|  | sal_Int32 | len
| ) |  |
| inline

Appends the string representation of the `char` array argument to this string buffer.

Characters of the character array `str` are appended, in order, to the contents of this string buffer. The length of this string buffer increases by the value of `len`.

Parameters

  str | the characters to be appended; must be non-null, and must point to at least len characters
  len | the number of characters to append; must be non-negative

Returns
  this string buffer.

## ◆ append() [6/12]

OStringBuffer& rtl::OStringBuffer::append | ( | sal_Bool | b | ) |
| inline

Appends the string representation of the `sal_Bool` argument to the string buffer.

The argument is converted to a string as if by the method `String.valueOf`, and the characters of that string are then appended to this string buffer.

Parameters

  b | a `sal_Bool`.

Returns
  this string buffer.

## ◆ append() [7/12]

OStringBuffer& rtl::OStringBuffer::append | ( | bool | b | ) |
| inline

Appends the string representation of the `bool` argument to the string buffer.

The argument is converted to a string as if by the method `String.valueOf`, and the characters of that string are then appended to this string buffer.

Parameters

  b | a `bool`.

Returns
  this string buffer.

Since
  LibreOffice 4.3

## ◆ append() [8/12]

OStringBuffer& rtl::OStringBuffer::append | ( | sal_Char | c | ) |
| inline

Appends the string representation of the `char` argument to this string buffer.

The argument is appended to the contents of this string buffer. The length of this string buffer increases by `1`.

Parameters

  c | a `char`.

Returns
  this string buffer.

## ◆ append() [9/12]

OStringBuffer& rtl::OStringBuffer::append | ( | sal_Int32 | i,
|  | sal_Int16 | radix = `10`
| ) |  |
| inline

Appends the string representation of the `sal_Int32` argument to this string buffer.

The argument is converted to a string as if by the method `String.valueOf`, and the characters of that string are then appended to this string buffer.

Parameters

  i | an `sal_Int32`.
  radix | the radix

Returns
  this string buffer.

## ◆ append() [10/12]

OStringBuffer& rtl::OStringBuffer::append | ( | sal_Int64 | l,
|  | sal_Int16 | radix = `10`
| ) |  |
| inline

Appends the string representation of the `long` argument to this string buffer.

The argument is converted to a string as if by the method `String.valueOf`, and the characters of that string are then appended to this string buffer.

Parameters

  l | a `long`.
  radix | the radix

Returns
  this string buffer.

## ◆ append() [11/12]

OStringBuffer& rtl::OStringBuffer::append | ( | float | f | ) |
| inline

Appends the string representation of the `float` argument to this string buffer.

The argument is converted to a string as if by the method `String.valueOf`, and the characters of that string are then appended to this string buffer.

Parameters

  f | a `float`.

Returns
  this string buffer.

## ◆ append() [12/12]

OStringBuffer& rtl::OStringBuffer::append | ( | double | d | ) |
| inline

Appends the string representation of the `double` argument to this string buffer.

The argument is converted to a string as if by the method `String.valueOf`, and the characters of that string are then appended to this string buffer.

Parameters

  d | a `double`.

Returns
  this string buffer.

## ◆ appendUninitialized()

char* rtl::OStringBuffer::appendUninitialized | ( | sal_Int32 | length | ) |
| inline

Unsafe way to make space for a fixed amount of characters to be appended into this OStringBuffer.

A call to this function must immediately be followed by code that completely fills the uninitialized block pointed to by the return value.

Parameters

  length | the length of the uninitialized block of char entities; must be non-negative

Returns
  a pointer to the start of the uninitialized block; only valid until this OStringBuffer's capacity changes

Since
  LibreOffice 4.4

## ◆ charAt()

sal_Char rtl::OStringBuffer::charAt | ( | sal_Int32 | index | ) |
| inline

Returns the character at a specific index in this string buffer.

The first character of a string buffer is at index `0`, the next at index `1`, and so on, for array indexing.

The index argument must be greater than or equal to `0`, and less than the length of this string buffer.

Parameters

  index | the index of the desired character.

Returns
  the character at the specified index of this string buffer.

## ◆ ensureCapacity()

void rtl::OStringBuffer::ensureCapacity | ( | sal_Int32 | minimumCapacity | ) |
| inline

Ensures that the capacity of the buffer is at least equal to the specified minimum.

The new capacity will be at least as large as the maximum of the current length (so that no contents of the buffer is destroyed) and the given minimumCapacity. If the given minimumCapacity is negative, nothing is changed.

Parameters

  minimumCapacity | the minimum desired capacity.

## ◆ getCapacity()

sal_Int32 rtl::OStringBuffer::getCapacity | ( |  | ) | const
| inline

Returns the current capacity of the String buffer.

The capacity is the amount of storage available for newly inserted characters. The real buffer size is 2 bytes longer, because all strings are 0 terminated.

Returns
  the current capacity of this string buffer.

## ◆ getLength()

sal_Int32 rtl::OStringBuffer::getLength | ( |  | ) | const
| inline

Returns the length (character count) of this string buffer.

Returns
  the number of characters in this string buffer.

## ◆ getStr()

const sal_Char* rtl::OStringBuffer::getStr | ( |  | ) | const
| inline

Return a null terminated character array.

## ◆ insert() [1/12]

OStringBuffer& rtl::OStringBuffer::insert | ( | sal_Int32 | offset,
|  | const OString & | str
| ) |  |
| inline

Inserts the string into this string buffer.

The characters of the `String` argument are inserted, in order, into this string buffer at the indicated offset. The length of this string buffer is increased by the length of the argument.

The offset argument must be greater than or equal to `0`, and less than or equal to the length of this string buffer.

Parameters

  offset | the offset.
  str | a string.

Returns
  this string buffer.

## ◆ insert() [2/12]

template<typename T >

libreoffice_internal::CharPtrDetector< T, OStringBuffer& >::Type rtl::OStringBuffer::insert | ( | sal_Int32 | offset,
|  | const T & | str
| ) |  |
| inline

Inserts the string representation of the `char` array argument into this string buffer.

The characters of the array argument are inserted into the contents of this string buffer at the position indicated by `offset`. The length of this string buffer increases by the length of the argument.

The offset argument must be greater than or equal to `0`, and less than or equal to the length of this string buffer.

Parameters

  offset | the offset.
  str | a character array.

Returns
  this string buffer.

## ◆ insert() [3/12]

template<typename T >

libreoffice_internal::NonConstCharArrayDetector< T, OStringBuffer& >::Type rtl::OStringBuffer::insert | ( | sal_Int32 | offset,
|  | T & | str
| ) |  |
| inline

## ◆ insert() [4/12]

template<typename T >

libreoffice_internal::ConstCharArrayDetector< T, OStringBuffer& >::Type rtl::OStringBuffer::insert | ( | sal_Int32 | offset,
|  | T & | literal
| ) |  |
| inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This function accepts an ASCII string literal as its argument.

Since
  LibreOffice 3.6

## ◆ insert() [5/12]

OStringBuffer& rtl::OStringBuffer::insert | ( | sal_Int32 | offset,
|  | const sal_Char * | str,
|  | sal_Int32 | len
| ) |  |
| inline

Inserts the string representation of the `char` array argument into this string buffer.

The characters of the array argument are inserted into the contents of this string buffer at the position indicated by `offset`. The length of this string buffer increases by the length of the argument.

The offset argument must be greater than or equal to `0`, and less than or equal to the length of this string buffer.

Parameters

  offset | the offset.
  str | a character array.
  len | the number of characters to append.

Returns
  this string buffer.

## ◆ insert() [6/12]

OStringBuffer& rtl::OStringBuffer::insert | ( | sal_Int32 | offset,
|  | sal_Bool | b
| ) |  |
| inline

Inserts the string representation of the `sal_Bool` argument into this string buffer.

The second argument is converted to a string as if by the method `String.valueOf`, and the characters of that string are then inserted into this string buffer at the indicated offset.

The offset argument must be greater than or equal to `0`, and less than or equal to the length of this string buffer.

Parameters

  offset | the offset.
  b | a `sal_Bool`.

Returns
  this string buffer.

## ◆ insert() [7/12]

OStringBuffer& rtl::OStringBuffer::insert | ( | sal_Int32 | offset,
|  | bool | b
| ) |  |
| inline

Inserts the string representation of the `bool` argument into this string buffer.

The second argument is converted to a string as if by the method `OString::boolean`, and the characters of that string are then inserted into this string buffer at the indicated offset.

The offset argument must be greater than or equal to `0`, and less than or equal to the length of this string buffer.

Parameters

  offset | the offset.
  b | a `bool`.

Returns
  this string buffer.

Since
  LibreOffice 4.3

## ◆ insert() [8/12]

OStringBuffer& rtl::OStringBuffer::insert | ( | sal_Int32 | offset,
|  | sal_Char | c
| ) |  |
| inline

Inserts the string representation of the `char` argument into this string buffer.

The second argument is inserted into the contents of this string buffer at the position indicated by `offset`. The length of this string buffer increases by one.

The offset argument must be greater than or equal to `0`, and less than or equal to the length of this string buffer.

Parameters

  offset | the offset.
  c | a `char`.

Returns
  this string buffer.

## ◆ insert() [9/12]

OStringBuffer& rtl::OStringBuffer::insert | ( | sal_Int32 | offset,
|  | sal_Int32 | i,
|  | sal_Int16 | radix = `10`
| ) |  |
| inline

Inserts the string representation of the second `sal_Int32` argument into this string buffer.

The second argument is converted to a string as if by the method `String.valueOf`, and the characters of that string are then inserted into this string buffer at the indicated offset.

The offset argument must be greater than or equal to `0`, and less than or equal to the length of this string buffer.

Parameters

  offset | the offset.
  i | an `sal_Int32`.
  radix | the radix

Returns
  this string buffer.

## ◆ insert() [10/12]

OStringBuffer& rtl::OStringBuffer::insert | ( | sal_Int32 | offset,
|  | sal_Int64 | l,
|  | sal_Int16 | radix = `10`
| ) |  |
| inline

Inserts the string representation of the `long` argument into this string buffer.

The second argument is converted to a string as if by the method `String.valueOf`, and the characters of that string are then inserted into this string buffer at the indicated offset.

The offset argument must be greater than or equal to `0`, and less than or equal to the length of this string buffer.

Parameters

  offset | the offset.
  l | a `long`.
  radix | the radix

Returns
  this string buffer.

## ◆ insert() [11/12]

OStringBuffer rtl::OStringBuffer::insert | ( | sal_Int32 | offset,
|  | float | f
| ) |  |
| inline

Inserts the string representation of the `float` argument into this string buffer.

The second argument is converted to a string as if by the method `String.valueOf`, and the characters of that string are then inserted into this string buffer at the indicated offset.

The offset argument must be greater than or equal to `0`, and less than or equal to the length of this string buffer.

Parameters

  offset | the offset.
  f | a `float`.

Returns
  this string buffer.

## ◆ insert() [12/12]

OStringBuffer& rtl::OStringBuffer::insert | ( | sal_Int32 | offset,
|  | double | d
| ) |  |
| inline

Inserts the string representation of the `double` argument into this string buffer.

The second argument is converted to a string as if by the method `String.valueOf`, and the characters of that string are then inserted into this string buffer at the indicated offset.

The offset argument must be greater than or equal to `0`, and less than or equal to the length of this string buffer.

Parameters

  offset | the offset.
  d | a `double`.

Returns
  this string buffer.

## ◆ isEmpty()

bool rtl::OStringBuffer::isEmpty | ( |  | ) | const
| inline

Checks if a string buffer is empty.

Returns
  true if the string buffer is empty; false, otherwise.

Since
  LibreOffice 4.1

## ◆ makeStringAndClear()

OString rtl::OStringBuffer::makeStringAndClear | ( |  | ) |
| inline

Fill the string data in the new string and clear the buffer.

This method is more efficient than the constructor of the string. It does not copy the buffer.

Returns
  the string previously contained in the buffer.

## ◆ operator=() [1/3]

OStringBuffer& rtl::OStringBuffer::operator= | ( | const OStringBuffer & | value | ) |
| inline

Assign to this a copy of value.

## ◆ operator=() [2/3]

OStringBuffer& rtl::OStringBuffer::operator= | ( | OString const & | string | ) |
| inline

Assign from a string.

Since
  LibreOffice 5.3

## ◆ operator=() [3/3]

template<typename T >

libreoffice_internal::ConstCharArrayDetector<T, OStringBuffer &>::Type rtl::OStringBuffer::operator= | ( | T & | literal | ) |
| inline

Assign from a string literal.

Since
  LibreOffice 5.3

## ◆ operator[]()

sal_Char& rtl::OStringBuffer::operator[] | ( | sal_Int32 | index | ) |
| inline

Access to individual characters.

Parameters

  index | must be non-negative and less than length.

Returns
  a reference to the character at the given index.

Since
  LibreOffice 3.5

## ◆ remove()

OStringBuffer& rtl::OStringBuffer::remove | ( | sal_Int32 | start,
|  | sal_Int32 | len
| ) |  |
| inline

Removes the characters in a substring of this sequence.

The substring begins at the specified `start` and is `len` characters long.

start must be >= 0 && <= getLength() && <= end

Parameters

  start | The beginning index, inclusive
  len | The substring length

Returns
  this string buffer.

## ◆ setCharAt()

OStringBuffer& rtl::OStringBuffer::setCharAt | ( | sal_Int32 | index,
|  | sal_Char | ch
| ) |  |
| inline

The character at the specified index of this string buffer is set to `ch`.

The index argument must be greater than or equal to `0`, and less than the length of this string buffer.

Parameters

  index | the index of the character to modify.
  ch | the new character.

## ◆ setLength()

void rtl::OStringBuffer::setLength | ( | sal_Int32 | newLength | ) |
| inline

Sets the length of this String buffer.

If the `newLength` argument is less than the current length of the string buffer, the string buffer is truncated to contain exactly the number of characters given by the `newLength` argument.

If the `newLength` argument is greater than or equal to the current length, sufficient null characters (`'&#92;u0000'`) are appended to the string buffer so that length becomes the `newLength` argument.

The `newLength` argument must be greater than or equal to `0`.

Parameters

  newLength | the new length of the buffer.

## ◆ toString()

const OString rtl::OStringBuffer::toString | ( |  | ) | const
| inline

Return a OString instance reflecting the current content of this OStringBuffer.

The documentation for this class was generated from the following file:

- rtl/strbuf.hxx