info/CWS odfmetadata2 : new: OUStringBufferAppender and intersperse

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

info/CWS odfmetadata2 : new: OUStringBufferAppender and intersperse

mst-2


          Type: info
         Title: new: OUStringBufferAppender and intersperse
     Posted by: [hidden email]
      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 [hidden email]



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]