Suggestion: some changes in String API

Sander Jansen s.jansen at gmail.com
Thu May 23 19:09:08 UTC 2013


Not everybody using C++ uses std:string so I'd prefer if you keep toCString
around.
Perhaps one thing to consider is whether UTF-8 conversion should be the
default instead of Latin1.

Sander


On Thu, May 23, 2013 at 1:32 PM, Tsuda Kageyu <tsuda.kageyu at gmail.com>wrote:

>
> I suggest to make some small changes in String API.
>
> Currently, String class has some methods which convert itself into a
> standard C/C++ string, but they are somewhat confusing and inconsistent.
> So I'd like to change these methods like this:
>
> // Current
> std::string to8Bit(bool unicode = false) const;
> const std::wstring &toWString() const;
> const char *toCString(bool unicode = false) const;
>
> // New
> std::string toStdString(Type t = Latin1) const;
> const std::wstring &toStdWString() const;
> const char *toCString(String::Type t = Latin1) const;
>
> The actual code is at https://github.com/taglib/taglib/pull/218
>
> I think that toCString() is no longer needed and can be substituted by
> toStdString() so we can remove it.
> _______________________________________________
> taglib-devel mailing list
> taglib-devel at kde.org
> https://mail.kde.org/mailman/listinfo/taglib-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/taglib-devel/attachments/20130523/980ec03c/attachment.html>


More information about the taglib-devel mailing list