Type: info
         Title: new: OUStringBufferAppender and intersperse
     Posted by: m...@openoffice.org
      Affected: comphelper
         TaskId: i90620
<http://www.openoffice.org/issues/show_bug.cgi?id=90620>
Effective from: CWS odfmetadata2
           CWS:
<http://eis.services.openoffice.org/EIS2/cws.ShowCWS?Path=DEV300/odfmetadata2>
    CWS status: new


*Summary*
--------
<comphelper/stl_types.hxx>:
+ class OUStringBufferAppender
+ OutputIter intersperse(
    ForwardIter start, ForwardIter end, OutputIter out, T const & separator)

*Description*
-------------
+ class OUStringBufferAppender

This class implements the STL output iterator interface and allows
appending to an OUStringBuffer with STL algorithms.

+ algorithm intersperse

This STL-inspired algorithm will copy a STL sequence, inserting a
separator element between every element of the source sequence.


Usage example that combines UNO Sequence STL iterators,
OUStringBufferAppender and intersperse:

::rtl::OUString convertCommaSeparated(
    ::com::sun::star::uno::Sequence< ::rtl::OUString > const& i_rSeq)
{
    ::rtl::OUStringBuffer buf;
    ::comphelper::intersperse(
        ::comphelper::stl_begin(i_rSeq), ::comphelper::stl_end(i_rSeq),
        ::comphelper::OUStringBufferAppender(buf),
        ::rtl::OUString::createFromAscii(", "));
    return buf.makeStringAndClear();
}



Send feedback to interface-announce@openoffice.org


---------------------------------------------------------------------
To unsubscribe, e-mail: interface-announce-unsubscr...@openoffice.org
For additional commands, e-mail: interface-announce-h...@openoffice.org

Reply via email to