VirtualBox

Changeset 95336 in vbox for trunk/include/iprt/cpp


Ignore:
Timestamp:
Jun 21, 2022 8:48:58 PM (3 years ago)
Author:
vboxsync
Message:

IPRT/RTCString: Added a truncate() method that takes UTF-8 encoding into account when truncating the string. bugref:10185

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/cpp/ministring.h

    r93115 r95336  
    853853
    854854    /**
     855     * Truncates the string to a max length of @a cchMax.
     856     *
     857     * If the string is shorter than @a cchMax characters, no change is made.
     858     *
     859     * If the @a cchMax is not at the start of a UTF-8 sequence, it will be adjusted
     860     * down to the start of the UTF-8 sequence.  Thus, after a truncation, the
     861     * length() may be smaller than @a cchMax.
     862     *
     863     */
     864    RTCString &truncate(size_t cchMax) RT_NOEXCEPT;
     865
     866    /**
    855867     * Index operator.
    856868     *
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette