Add a QStringBuilder::toUtf8() function

Just to match the ones that are already there.

Change-Id: I25acc2391feded4cac79ebf65a6bc72176f5f931
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
Thiago Macieira 2012-04-25 18:01:24 +02:00 committed by Qt by Nokia
parent 6e6b74c0c7
commit 1ea3c22e66
2 changed files with 5 additions and 0 deletions

View File

@ -100,6 +100,10 @@ QT_BEGIN_NAMESPACE
returned byte array is undefined if the string contains non-Latin1
characters.
*/
/* \fn QByteArray QStringBuilder::toUtf8() const
Returns a UTF-8 representation of the string as a QByteArray.
*/
/*! \internal
*/

View File

@ -97,6 +97,7 @@ template<typename Builder>
struct QStringBuilderBase<Builder, QString> : public QStringBuilderCommon<Builder, QString>
{
QByteArray toLatin1() const { return this->resolved().toLatin1(); }
QByteArray toUtf8() const { return this->resolved().toUtf8(); }
QByteArray toLocal8Bit() const { return this->resolved().toLocal8Bit(); }
};