aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/ApiExtractor/anystringview_helpers.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <friedemann.kleint@qt.io>2023-05-10 13:50:56 +0200
committerCristián Maureira-Fredes <cristian.maureira-fredes@qt.io>2025-11-24 12:06:06 +0100
commit845630ad239c4b37ff37e49ef5bb969a8946744b (patch)
tree5c65f2e270511459d346c14f0ad8d01f5e6e39a0 /sources/shiboken6/ApiExtractor/anystringview_helpers.cpp
parent3cf2077a1b060bbea3419ccde23c5da6485a2e24 (diff)
Move the shiboken-generator source around
THIS COMMIT WAS GENERATED BY A SCRIPT Task-number: PYSIDE-962 Task-number: PYSIDE-1587 Change-Id: I58b05c3d05606efb6303193f2d7f907a0ab5741b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/anystringview_helpers.cpp')
-rw-r--r--sources/shiboken6/ApiExtractor/anystringview_helpers.cpp78
1 files changed, 0 insertions, 78 deletions
diff --git a/sources/shiboken6/ApiExtractor/anystringview_helpers.cpp b/sources/shiboken6/ApiExtractor/anystringview_helpers.cpp
deleted file mode 100644
index fcff16205..000000000
--- a/sources/shiboken6/ApiExtractor/anystringview_helpers.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright (C) 2023 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-
-#include "anystringview_helpers.h"
-
-#include <QtCore/QString> // Must go before QAnyStringView for operator<<(QTextStream,QASV)!
-#include <QtCore/qanystringview.h>
-#include <QtCore/qdebug.h>
-#include <QtCore/qtextstream.h>
-
-#include <cstring>
-
-QTextStream &operator<<(QTextStream &str, QAnyStringView asv)
-{
- asv.visit([&str](auto s) { str << s; });
- return str;
-}
-
-static bool asv_containsImpl(QLatin1StringView v, char c)
-{
- return v.contains(uint16_t(c));
-}
-
-static bool asv_containsImpl(QUtf8StringView v, char c)
-{
- return std::strchr(v.data(), c) != nullptr;
-}
-
-static bool asv_containsImpl(QStringView v, char c)
-{
- return v.contains(uint16_t(c));
-}
-
-bool asv_contains(QAnyStringView asv, char needle)
-{
- return asv.visit([needle](auto s) { return asv_containsImpl(s, needle); });
-}
-
-static bool asv_containsImpl(QLatin1StringView v, const char *c)
-{
- return v.contains(QLatin1StringView(c));
-}
-static bool asv_containsImpl(QUtf8StringView v, const char *c)
-{
- return std::strstr(v.data(), c) != nullptr;
-}
-
-static bool asv_containsImpl(QStringView v, const char *c)
-{
- return v.contains(QLatin1StringView(c));
-}
-
-bool asv_contains(QAnyStringView asv, const char *needle)
-{
- return asv.visit([needle](auto s) { return asv_containsImpl(s, needle); });
-}
-
-static qsizetype asv_indexOfImpl(QLatin1StringView v, const char *needle)
-{
- return v.indexOf(QLatin1StringView(needle));
-}
-
-static qsizetype asv_indexOfImpl(QUtf8StringView v, const char *needle)
-{
- const char *data = v.data();
- const char *match = std::strstr(data, needle);
- return match != nullptr ? qsizetype(match - data) : qsizetype(-1);
-}
-
-static qsizetype asv_indexOfImpl(QStringView v, const char *needle)
-{
- return v.indexOf(QLatin1StringView(needle));
-}
-
-qsizetype asv_indexOf(QAnyStringView asv, const char *needle)
-{
- return asv.visit([needle](auto s) { return asv_indexOfImpl(s, needle); });
-}