Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


On 15/01/13 13:58, Jean-Noël Rouvignac wrote:

  * What are the guidelines to replace String? When to use OString and
    when to use OUString?

in almost all cases, convert to OUString.

there also used to be a ByteString that corresponded to OString but that
has already been removed.

  * What is XubString?
    https://wiki.documentfoundation.org/Development/String_Classes does
    not mention it.

it is the same as String.

tools/inc/tools/solar.h:

#define UniString       String
#define XubString       String
#define xub_StrLen      sal_uInt16

  * What about the associated type xub_StrLen ?

good question... there is code that loops over the sal_Unicode UTF-16
code units in the string (Note: those are not "characters").  since
String has a maximum capacity of 2^16, and the xub_StrLen is a "short",
and OUString of 2^31 the indexes in such loops most likely need to be
adapted to sal_Int32.

there is also a method OUString::iterateCodePoints that gives the actual
characters, which could be useful in some places.

If somebody has got the answers, could he update
https://wiki.documentfoundation.org/Development/String_Classes?

i'll try to do that...

Finally I noticed there is no doxygen generated for XubString, UniString
or String under http://api.libreoffice.org/docs.

that is not surprising, since those classes are (fortunately) not part
of the API, they are just LO implementation details (so we can remove them).



Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.