<html> <head> <title>class OStringBuffer</title> <link rel="stylesheet" type="text/css" href="../../cpp.css"> </head> <body> <div id="adc-cppref"> <a name="_top_"> </a><table class="navimain" border="0" cellpadding="1" cellspacing="0"> <tr align="center" valign="top"> <td class="navimain"> <a href="../../index.html">Overview</a> </td> <td class="navimain"> <a href="index.html">Namespace</a> </td> <td class="navimainself"> Class </td> <td class="navimain"> <a href="../../index-files/index-1.html">Index</a> </td> <td class="navimain"> <a href="../../help.html">Help</a> </td> </tr> </table> <table class="navisub" cellpadding="0" cellspacing="3"> <tr> <td width="20%"><font size="-2">PUBLIC MEMBERS:</font></td> <td> <font size="-2">CLASSES</font> | <font size="-2">STRUCTS</font> | <font size="-2">UNIONS</font> | <font size="-2">ENUMS</font> | <font size="-2">TYPEDEFS</font> | <a href="#publ_ops"><font size="-2"><b>METHODS</b></font></a> | <font size="-2">STATIC METHODS</font> | <font size="-2">DATA</font> | <font size="-2">STATIC DATA</font></td> </tr> <tr> <td width="20%"><font size="-2">PRIVATE MEMBERS:</font></td> <td> <font size="-2">CLASSES</font> | <font size="-2">STRUCTS</font> | <font size="-2">UNIONS</font> | <font size="-2">ENUMS</font> | <font size="-2">TYPEDEFS</font> | <font size="-2">METHODS</font> | <font size="-2">STATIC METHODS</font> | <a href="#priv_vars"><font size="-2"><b>DATA</b></font></a> | <font size="-2">STATIC DATA</font></td> </tr> </table> <hr> <a href="../../names/index.html" alt="Global Namespace in C++"><font size="+1"><b>::</b></font></a> <a href="index.html" alt="namespace"><font size="+1"><b>rtl</b></font></a><font size="+1"> :: </font><div class="title"><h2>class OStringBuffer</h2> </div><hr> <dl> <dt>Base Classes</dt> <dd>None.</dd> </dl> <dl> <dt>Known Derived Classes</dt> <dd>None.</dd> </dl> <br> <table class="flag-table" border="1" cellspacing="0"> <tr> <td width="25%" class="flagname">virtual</td> <td width="25%" class="flagname">abstract</td> <td width="25%" class="flagname">interface</td> <td width="25%" class="flagname">template</td> </tr> <tr> <td class="flagno">NO</td> <td class="flagno">NO</td> <td class="flagno">NO</td> <td class="flagno">NO</td> </tr> </table> <dl> <dt>Description</dt> <dd>A string buffer implements a mutable sequence of characters. <p> String buffers are safe for use by multiple threads. The methods are synchronized where necessary so that all the operations on any particular instance behave as if they occur in some serial order. <p> String buffers are used by the compiler to implement the binary string concatenation operator <code>+</code>. For example, the code: <p><blockquote><pre> x = "a" + 4 + "c" </pre></blockquote><p> is compiled to the equivalent of: <p><blockquote><pre> x = new OStringBuffer().append("a").append(4).append("c") .toString() </pre></blockquote><p> The principal operations on a <code>OStringBuffer</code> are the <code>append</code> and <code>insert</code> methods, which are overloaded so as to accept data of any type. Each effectively converts a given datum to a string and then appends or inserts the characters of that string to the string buffer. The <code>append</code> method always adds these characters at the end of the buffer; the <code>insert</code> method adds the characters at a specified point. <p> For example, if <code>z</code> refers to a string buffer object whose current contents are "<code>start</code>", then the method call <code>z.append("le")</code> would cause the string buffer to contain "<code>startle</code>", whereas <code>z.insert(4, "le")</code> would alter the string buffer to contain "<code>starlet</code>". <p> Every string buffer has a capacity. As long as the length of the character sequence contained in the string buffer does not exceed the capacity, it is not necessary to allocate a new internal buffer array. If the internal buffer overflows, it is automatically made larger. </dd> </dl> <dl> <dt>File</dt> <dd>strbuf.hxx</dd> </dl> <hr> <dl> <dt class="subtitle"><a name="publ_"><h3>Public Members</h3> </a></dt> <dd><a name="publ_ops"> </a><table class="childlist" border="1" cellpadding="5" cellspacing="0" width="100%"> <tr class="subtitle"> <td colspan="2"><h4>Methods</h4> </td> </tr> <tr> <td> <br> <a href="OStringBuffer/o.html#OStringBuffer-1383">OStringBuffer</a>( );</td> <td width="50%"> Constructs a string buffer with no characters in it and an initial capacity of 16 characters. </td> </tr> <tr> <td> <br> <a href="OStringBuffer/o.html#OStringBuffer-1384">OStringBuffer</a>( const OStringBuffer & value );</td> <td width="50%"> Allocates a new string buffer that contains the same sequence of characters as the string buffer argument. </td> </tr> <tr> <td> <br> <a href="OStringBuffer/o.html#OStringBuffer-1385">OStringBuffer</a>( sal_Int32 length );</td> <td width="50%"> Constructs a string buffer with no characters in it and an initial capacity specified by the <code>length</code> argument. </td> </tr> <tr> <td> <br> <a href="OStringBuffer/o.html#OStringBuffer-1386">OStringBuffer</a>( OString value );</td> <td width="50%"> Constructs a string buffer so that it represents the same sequence of characters as the string argument. </td> </tr> <tr> <td>OStringBuffer & <br> <a href="OStringBuffer/o.html#operator=-1387">operator=</a>( const OStringBuffer & value );</td> <td width="50%"> Assign to this a copy of value. </td> </tr> <tr> <td> <br> <a href="OStringBuffer/o.html#~OStringBuffer-1388">~OStringBuffer</a>( );</td> <td width="50%"> Release the string data. </td> </tr> <tr> <td>OString <br> <a href="OStringBuffer/o.html#makeStringAndClear-1389">makeStringAndClear</a>( );</td> <td width="50%"> Fill the string data in the new string and clear the buffer. </td> </tr> <tr> <td>sal_Int32 <br> <a href="OStringBuffer/o.html#getLength-1390">getLength</a>( ) const;</td> <td width="50%"> Returns the length (character count) of this string buffer. </td> </tr> <tr> <td>sal_Int32 <br> <a href="OStringBuffer/o.html#getCapacity-1391">getCapacity</a>( ) const;</td> <td width="50%"> Returns the current capacity of the String buffer. </td> </tr> <tr> <td>void <br> <a href="OStringBuffer/o.html#ensureCapacity-1392">ensureCapacity</a>( sal_Int32 minimumCapacity );</td> <td width="50%"> Ensures that the capacity of the buffer is at least equal to the specified minimum. </td> </tr> <tr> <td>void <br> <a href="OStringBuffer/o.html#setLength-1393">setLength</a>( sal_Int32 newLength );</td> <td width="50%"> Sets the length of this String buffer. </td> </tr> <tr> <td>sal_Char <br> <a href="OStringBuffer/o.html#charAt-1394">charAt</a>( sal_Int32 index );</td> <td width="50%"> Returns the character at a specific index in this string buffer. </td> </tr> <tr> <td> <br> <a href="OStringBuffer/o.html#operator const sal_Char *-1395">operator const sal_Char *</a>( ) const;</td> <td width="50%"> Return a null terminated character array. </td> </tr> <tr> <td>const sal_Char * <br> <a href="OStringBuffer/o.html#getStr-1396">getStr</a>( ) const;</td> <td width="50%"> Return a null terminated character array. </td> </tr> <tr> <td>OStringBuffer & <br> <a href="OStringBuffer/o.html#setCharAt-1397">setCharAt</a>( sal_Int32 index, sal_Char ch );</td> <td width="50%"> The character at the specified index of this string buffer is set to <code>ch</code>. </td> </tr> <tr> <td>OStringBuffer & <br> <a href="OStringBuffer/o.html#append-1398">append</a>( const OString & str );</td> <td width="50%"> Appends the string to this string buffer. </td> </tr> <tr> <td>OStringBuffer & <br> <a href="OStringBuffer/o.html#append-1399">append</a>( const sal_Char * str );</td> <td width="50%"> Appends the string representation of the <code>char</code> array argument to this string buffer. </td> </tr> <tr> <td>OStringBuffer & <br> <a href="OStringBuffer/o.html#append-1400">append</a>( const sal_Char * str, sal_Int32 len );</td> <td width="50%"> Appends the string representation of the <code>char</code> array argument to this string buffer. </td> </tr> <tr> <td>OStringBuffer & <br> <a href="OStringBuffer/o.html#append-1401">append</a>( sal_Bool b );</td> <td width="50%"> Appends the string representation of the <code>sal_Bool</code> argument to the string buffer. </td> </tr> <tr> <td>OStringBuffer & <br> <a href="OStringBuffer/o.html#append-1402">append</a>( sal_Char c );</td> <td width="50%"> Appends the string representation of the <code>char</code> argument to this string buffer. </td> </tr> <tr> <td>OStringBuffer & <br> <a href="OStringBuffer/o.html#append-1403">append</a>( sal_Int32 i, sal_Int16 radix = 10 );</td> <td width="50%"> Appends the string representation of the <code>sal_Int32</code> argument to this string buffer. </td> </tr> <tr> <td>OStringBuffer & <br> <a href="OStringBuffer/o.html#append-1404">append</a>( sal_Int64 l, sal_Int16 radix = 10 );</td> <td width="50%"> Appends the string representation of the <code>long</code> argument to this string buffer. </td> </tr> <tr> <td>OStringBuffer & <br> <a href="OStringBuffer/o.html#append-1405">append</a>( float f );</td> <td width="50%"> Appends the string representation of the <code>float</code> argument to this string buffer. </td> </tr> <tr> <td>OStringBuffer & <br> <a href="OStringBuffer/o.html#append-1406">append</a>( double d );</td> <td width="50%"> Appends the string representation of the <code>double</code> argument to this string buffer. </td> </tr> <tr> <td>OStringBuffer & <br> <a href="OStringBuffer/o.html#insert-1407">insert</a>( sal_Int32 offset, const OString & str );</td> <td width="50%"> Inserts the string into this string buffer. </td> </tr> <tr> <td>OStringBuffer & <br> <a href="OStringBuffer/o.html#insert-1408">insert</a>( sal_Int32 offset, const sal_Char * str );</td> <td width="50%"> Inserts the string representation of the <code>char</code> array argument into this string buffer. </td> </tr> <tr> <td>OStringBuffer & <br> <a href="OStringBuffer/o.html#insert-1409">insert</a>( sal_Int32 offset, const sal_Char * str, sal_Int32 len );</td> <td width="50%"> Inserts the string representation of the <code>char</code> array argument into this string buffer. </td> </tr> <tr> <td>OStringBuffer & <br> <a href="OStringBuffer/o.html#insert-1410">insert</a>( sal_Int32 offset, sal_Bool b );</td> <td width="50%"> Inserts the string representation of the <code>sal_Bool</code> argument into this string buffer. </td> </tr> <tr> <td>OStringBuffer & <br> <a href="OStringBuffer/o.html#insert-1411">insert</a>( sal_Int32 offset, sal_Char c );</td> <td width="50%"> Inserts the string representation of the <code>char</code> argument into this string buffer. </td> </tr> <tr> <td>OStringBuffer & <br> <a href="OStringBuffer/o.html#insert-1412">insert</a>( sal_Int32 offset, sal_Int32 i, sal_Int16 radix = 10 );</td> <td width="50%"> Inserts the string representation of the second <code>sal_Int32</code> argument into this string buffer. </td> </tr> <tr> <td>OStringBuffer & <br> <a href="OStringBuffer/o.html#insert-1413">insert</a>( sal_Int32 offset, sal_Int64 l, sal_Int16 radix = 10 );</td> <td width="50%"> Inserts the string representation of the <code>long</code> argument into this string buffer. </td> </tr> <tr> <td>OStringBuffer <br> <a href="OStringBuffer/o.html#insert-1414">insert</a>( sal_Int32 offset, float f );</td> <td width="50%"> Inserts the string representation of the <code>float</code> argument into this string buffer. </td> </tr> <tr> <td>OStringBuffer & <br> <a href="OStringBuffer/o.html#insert-1415">insert</a>( sal_Int32 offset, double d );</td> <td width="50%"> Inserts the string representation of the <code>double</code> argument into this string buffer. </td> </tr> </table> <hr> </dd> </dl> <dl> <dt class="subtitle"><a name="priv_"><h3>Private Members</h3> </a></dt> <dd><a name="priv_vars"> </a><table class="childlist" border="1" cellpadding="5" cellspacing="0" width="100%"> <tr class="subtitle"> <td colspan="2"><h4>Data</h4> </td> </tr> <tr bgcolor="white"> <td><a href="../t-rtl_String.html">rtl_String</a> * <a href="OStringBuffer/d.html#pData"><strong>pData;</strong></a></td> <td>A pointer to the data structur which contains the data. </td> </tr> <tr bgcolor="white"> <td><a href="../t-sal_Int32.html">sal_Int32</a> <a href="OStringBuffer/d.html#nCapacity"><strong>nCapacity;</strong></a></td> <td>The len of the pData->buffer. </td> </tr> </table> <hr> </dd> </dl> <a href="#_top_" class="objchapter">Top of Page</a><hr size="3"><p class="copyright" align="center">Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.</p> </div> <!-- id="adc-cppref" --> </body> </html>