OSDN Git Service

drop wide character and string support [ci reset]
authorIvailo Monev <xakepa10@gmail.com>
Sat, 31 Jul 2021 16:56:52 +0000 (19:56 +0300)
committerIvailo Monev <xakepa10@gmail.com>
Sat, 31 Jul 2021 17:45:49 +0000 (20:45 +0300)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
CMakeLists.txt
README
package/freebsd/pkg-plist
package/netbsd/PLIST.common
package/openbsd/pkg/PLIST
scripts/incfsck.py
scripts/namefsck.py
src/core/global/qconfig.h.cmake
src/core/tools/qstring.cpp
src/core/tools/qstring.h
tests/benchmarks/core/tools/qstringlist/main.cpp

index 24e99b0..b60ee20 100644 (file)
@@ -869,7 +869,6 @@ katie_generate_obsolete(QSqlRelation QtSql qsqlrelationaltablemodel.h)
 katie_generate_obsolete(QStandardItemEditorCreator QtGui qitemeditorfactory.h)
 katie_generate_obsolete(QStandardItem QtGui qstandarditemmodel.h)
 katie_generate_obsolete(QStatusTipEvent QtGui qevent.h)
-katie_generate_obsolete(QStdWString QtCore qstring.h)
 katie_generate_obsolete(QStringListIterator QtCore qstringlist.h)
 katie_generate_obsolete(QStringRef QtCore qstring.h)
 katie_generate_obsolete(QStyleFactoryInterface QtGui qstyleplugin.h)
diff --git a/README b/README
index 327edcf..311a5c9 100644 (file)
--- a/README
+++ b/README
@@ -45,6 +45,7 @@ There are several things you should be aware before considering Katie:
   - dropped obscure (24-bit) image formats support
   - dropped Valgrind support
   - dropped recursive mutex and lock support
+  - dropped wide character and string support
 
  - some additions have been made: 
   - JSON document handler
index 8d5b09c..3079c18 100644 (file)
@@ -158,7 +158,6 @@ include/katie/QtCore/QSizeF
 include/katie/QtCore/QSocketNotifier
 include/katie/QtCore/QStack
 include/katie/QtCore/QStandardPaths
-include/katie/QtCore/QStdWString
 include/katie/QtCore/QString
 include/katie/QtCore/QStringList
 include/katie/QtCore/QStringListIterator
index 3e026ec..2edfc34 100644 (file)
@@ -161,7 +161,6 @@ include/katie/QtCore/QSizeF
 include/katie/QtCore/QSocketNotifier
 include/katie/QtCore/QStack
 include/katie/QtCore/QStandardPaths
-include/katie/QtCore/QStdWString
 include/katie/QtCore/QString
 include/katie/QtCore/QStringList
 include/katie/QtCore/QStringListIterator
index 387f650..016cf22 100644 (file)
@@ -161,7 +161,6 @@ include/katie/QtCore/QSizeF
 include/katie/QtCore/QSocketNotifier
 include/katie/QtCore/QStack
 include/katie/QtCore/QStandardPaths
-include/katie/QtCore/QStdWString
 include/katie/QtCore/QString
 include/katie/QtCore/QStringList
 include/katie/QtCore/QStringListIterator
index 7efd53e..ec27a10 100755 (executable)
@@ -83,7 +83,6 @@ incmap = {
         'QSetIterator': 'qset.h',
         'QSharedDataPointer': 'qshareddata.h',
         'QSizeF': 'qsize.h',
-        'QStdWString': 'qstring.h',
         'QStringListIterator': 'qstringlist.h',
         'QStringRef': 'qstring.h',
         'QSysInfo': 'qglobal.h',
index 4a00a41..cddfbfb 100755 (executable)
@@ -605,7 +605,6 @@ classlist = [
     "QStaticText",
     "QStatusBar",
     "QStatusTipEvent",
-    "QStdWString",
     "QString",
     "QStringList",
     "QStringListIterator",
index 0c9eec4..c4ec94a 100644 (file)
 #define QT_NO_TEXTODFWRITER
 #define QT_NO_TEXTCODECPLUGIN
 #define QT_NO_SYSTEMLOCALE
+#define QT_NO_STL_WCHAR
 
 // Not supported, used to bootstrap
 #cmakedefine QT_NO_QOBJECT
 #cmakedefine QT_NO_STANDARDITEMMODEL
 #cmakedefine QT_NO_STATUSBAR
 #cmakedefine QT_NO_STATUSTIP
-#cmakedefine QT_NO_STL_WCHAR
 #cmakedefine QT_NO_STRINGLISTMODEL
 #cmakedefine QT_NO_STYLE_CLEANLOOKS
 #cmakedefine QT_NO_STYLE_MOTIF
index f1f4689..6d29fbf 100644 (file)
@@ -676,56 +676,7 @@ QString::Data QString::shared_empty = { QAtomicInt(1),
     \sa  fromAscii(), fromLatin1(), fromLocal8Bit(), fromUtf8(), QByteArray::fromStdString()
 */
 
-/*! \fn QString QString::fromStdWString(const std::wstring &str)
-
-    Returns a copy of the \a str string. The given string is assumed
-    to be encoded in utf16 if the size of wchar_t is 2 bytes (e.g. on
-    windows) and ucs4 if the size of wchar_t is 4 bytes (most Unix
-    systems).
-
-    This method is only available if Qt is configured with STL
-    compatibility enabled.
-
-    \sa fromUtf16(), fromLatin1(), fromLocal8Bit(), fromUtf8(), fromUcs4()
-*/
-
-/*!
-    \since 4.2
-
-    Returns a copy of the \a string, where the encoding of \a string depends on
-    the size of wchar. If wchar is 4 bytes, the \a string is interpreted as ucs-4,
-    if wchar is 2 bytes it is interpreted as ucs-2.
-
-    If \a size is -1 (default), the \a string has to be 0 terminated.
-
-    \sa fromUtf16(), fromLatin1(), fromLocal8Bit(), fromUtf8(), fromUcs4(), fromStdWString()
-*/
-QString QString::fromWCharArray(const wchar_t *string, int size)
-{
-    if (sizeof(wchar_t) == sizeof(QChar)) {
-        return fromUtf16((const ushort *)string, size);
-    } else {
-        return fromUcs4((uint *)string, size);
-    }
-}
-
-/*! \fn std::wstring QString::toStdWString() const
-
-    Returns a std::wstring object with the data contained in this
-    QString. The std::wstring is encoded in utf16 on platforms where
-    wchar_t is 2 bytes wide (e.g. windows) and in ucs4 on platforms
-    where wchar_t is 4 bytes wide (most Unix systems).
-
-    This operator is mostly useful to pass a QString to a function
-    that accepts a std::wstring object.
-
-    This operator is only available if Qt is configured with STL
-    compatibility enabled.
-
-    \sa utf16(), toAscii(), toLatin1(), toUtf8(), toLocal8Bit()
-*/
-
-template<typename T> int toUcs4_helper(const unsigned short *uc, int length, T *out)
+int toUcs4_helper(const unsigned short *uc, int length, uint *out)
 {
     int i = 0;
     for (; i < length; ++i) {
@@ -737,40 +688,12 @@ template<typename T> int toUcs4_helper(const unsigned short *uc, int length, T *
                 u = QChar::surrogateToUcs4(u, low);
             }
         }
-        *out = T(u);
+        *out = u;
         ++out;
     }
     return i;
 }
 
-/*!
-  \since 4.2
-
-  Fills the \a array with the data contained in this QString object.
-  The array is encoded in utf16 on platforms where
-  wchar_t is 2 bytes wide (e.g. windows) and in ucs4 on platforms
-  where wchar_t is 4 bytes wide (most Unix systems).
-
-  \a array has to be allocated by the caller and contain enough space to
-  hold the complete string (allocating the array with the same length as the
-  string is always sufficient).
-
-  returns the actual length of the string in \a array.
-
-  \note This function does not append a null character to the array.
-
-  \sa utf16(), toUcs4(), toAscii(), toLatin1(), toUtf8(), toLocal8Bit(), toStdWString()
-*/
-int QString::toWCharArray(wchar_t *array) const
-{
-    if (sizeof(wchar_t) == sizeof(QChar)) {
-        memcpy(array, utf16(), sizeof(wchar_t)*length());
-        return length();
-    } else {
-        return toUcs4_helper<wchar_t>(utf16(), length(), array);
-    }
-}
-
 /*! \fn QString::QString(const QString &other)
 
     Constructs a copy of \a other.
@@ -3364,13 +3287,13 @@ QByteArray QString::toUtf8() const
     UCS-4 is a Unicode codec and is lossless. All characters from this string
     can be encoded in UCS-4. The vector is not null terminated.
 
-    \sa fromUtf8(), toAscii(), toLatin1(), toLocal8Bit(), QTextCodec, fromUcs4(), toWCharArray()
+    \sa fromUtf8(), toAscii(), toLatin1(), toLocal8Bit(), QTextCodec, fromUcs4()
 */
 QVector<uint> QString::toUcs4() const
 {
     QVector<uint> v(length());
     uint *a = v.data();
-    int len = toUcs4_helper<uint>(utf16(), length(), a);
+    int len = toUcs4_helper(utf16(), length(), a);
     v.resize(len);
     return v;
 }
@@ -3557,7 +3480,7 @@ QString QString::fromUtf16(const ushort *unicode, int size)
     If \a size is -1 (default), \a unicode must be terminated
     with a 0.
 
-    \sa toUcs4(), fromUtf16(), utf16(), setUtf16(), fromWCharArray()
+    \sa toUcs4(), fromUtf16(), utf16(), setUtf16()
 */
 QString QString::fromUcs4(const uint *unicode, int size)
 {
@@ -8323,7 +8246,7 @@ QVector<uint> QStringRef::toUcs4() const
 {
     QVector<uint> v(length());
     uint *a = v.data();
-    int len = toUcs4_helper<uint>(reinterpret_cast<const unsigned short *>(unicode()), length(), a);
+    int len = toUcs4_helper(reinterpret_cast<const unsigned short *>(unicode()), length(), a);
     v.resize(len);
     return v;
 }
index 2ecc0fc..9fa11b7 100644 (file)
 #include <QtCore/qnamespace.h>
 
 #include <string>
-#ifndef QT_NO_STL_WCHAR
-// workaround for some headers not typedef'ing std::wstring
-typedef std::basic_string<wchar_t> QStdWString;
-#endif // QT_NO_STL_WCHAR
-
 #include <stdarg.h>
 
 
@@ -301,9 +296,6 @@ public:
     static QString fromUcs4(const uint *, int size = -1);
     static QString fromRawData(const QChar *, int size);
 
-    int toWCharArray(wchar_t *array) const;
-    static QString fromWCharArray(const wchar_t *, int size = -1);
-
     QString &setRawData(const QChar *unicode, int size);
     QString &setUnicode(const QChar *unicode, int size);
     inline QString &setUtf16(const ushort *utf16, int size);
@@ -450,10 +442,6 @@ public:
 
     static inline QString fromStdString(const std::string &s);
     inline std::string toStdString() const;
-#ifndef QT_NO_STL_WCHAR
-    static inline QString fromStdWString(const QStdWString &s);
-    inline QStdWString toStdWString() const;
-#endif // QT_NO_STL_WCHAR
 
     bool isRightToLeft() const;
 
@@ -861,19 +849,6 @@ inline std::string QString::toStdString() const
 inline QString QString::fromStdString(const std::string &s)
 { return fromAscii(s.data(), int(s.size())); }
 
-#ifndef QT_NO_STL_WCHAR
-inline QStdWString QString::toStdWString() const
-{
-    QStdWString str;
-    str.resize(length());
-    str.resize(toWCharArray(&(*str.begin())));
-    return str;
-}
-inline QString QString::fromStdWString(const QStdWString &s)
-{ return fromWCharArray(s.data(), int(s.size())); }
-#endif
-
-
 #if !defined(QT_NO_DATASTREAM)
 Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QString &);
 Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QString &);
index 1a491ea..59e1bd1 100644 (file)
@@ -44,9 +44,6 @@ private slots:
     void split_stdvector_stdstring() const;
     void split_stdvector_stdstring_data() const { return split_data(); }
 
-    void split_stdvector_stdwstring() const;
-    void split_stdvector_stdwstring_data() const { return split_data(); }
-
     void split_stdlist_stdstring() const;
     void split_stdlist_stdstring_data() const { return split_data(); }
 
@@ -157,22 +154,6 @@ void tst_QStringList::split_stdvector_stdstring() const
     }
 }
 
-void tst_QStringList::split_stdvector_stdwstring() const
-{
-    QFETCH(QString, input);
-    const wchar_t split_char = ':';
-    std::wstring stdinput = input.toStdWString();
-
-    QBENCHMARK {
-        std::wistringstream split(stdinput);
-        std::vector<std::wstring> token;
-        for (std::wstring each;
-             std::getline(split, each, split_char);
-             token.push_back(each))
-            ;
-    }
-}
-
 void tst_QStringList::split_stdlist_stdstring() const
 {
     QFETCH(QString, input);