summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2011-04-28 11:10:24 +0200
committerOlivier Goffart <olivier.goffart@nokia.com>2011-05-10 12:54:51 +0200
commitcd650da45ac780f10e2ae83ecafbb2f29cd01896 (patch)
treea749ca1263f6b3de86177896a17978afc3e94dc6 /src/corelib/tools
parent9c8734dccb90804673c7464c5ce44da615c3ac86 (diff)
Revert "Added QStringRef::toLatin1 and QStringRef::toUtf8"
This reverts commit feabda665de62a0f6a82d831b45926697f30b45b. They were already added by Denis Dzyubenko in commit 2916b074. (cherry picked from commit ffe0a2ec7c1f4412792a977401bdc4dbf6c76acd)
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qstring.cpp41
-rw-r--r--src/corelib/tools/qstring.h2
2 files changed, 0 insertions, 43 deletions
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 75695558ba..5493ba915b 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -8014,47 +8014,6 @@ QString QStringRef::toString() const {
return QString(m_string->unicode() + m_position, m_size);
}
-/*!
- Returns a Latin-1 representation of the string reference as a QByteArray.
-
- The returned byte array is undefined if the string reference contains
- non-Latin1 characters. Those characters may be suppressed or replaced with a
- question mark.
-
- \sa QString::toLatin1(), toUtf8()
- \since 4.8
-*/
-QByteArray QStringRef::toLatin1() const
-{
- if (!m_string)
- return QByteArray();
- return toLatin1_helper(m_string->unicode() + m_position, m_size);
-}
-
-/*!
- Returns a UTF-8 representation of the string reference as a QByteArray.
-
- UTF-8 is a Unicode codec and can represent all characters in a Unicode
- string like QString.
-
- However, in the Unicode range, there are certain codepoints that are not
- considered characters. The Unicode standard reserves the last two
- codepoints in each Unicode Plane (U+FFFE, U+FFFF, U+1FFFE, U+1FFFF,
- U+2FFFE, etc.), as well as 16 codepoints in the range U+FDD0..U+FDDF,
- inclusive, as non-characters. If any of those appear in the string, they
- may be discarded and will not appear in the UTF-8 representation, or they
- may be replaced by one or more replacement characters.
-
- \sa QString::toUtf8(), toLatin1(), QTextCodec
- \since 4.8
-*/
-QByteArray QStringRef::toUtf8() const
-{
- if (isNull())
- return QByteArray();
- return QUtf8::convertFromUnicode(m_string->unicode() + m_position, m_size, 0);
-}
-
/*! \relates QStringRef
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h
index 4c5f2f093b..6418a8cbd4 100644
--- a/src/corelib/tools/qstring.h
+++ b/src/corelib/tools/qstring.h
@@ -1167,8 +1167,6 @@ public:
inline void clear() { m_string = 0; m_position = m_size = 0; }
QString toString() const;
- QByteArray toLatin1() const;
- QByteArray toUtf8() const;
inline bool isEmpty() const { return m_size == 0; }
inline bool isNull() const { return m_string == 0 || m_string->isNull(); }