Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qanystringview.cpp
Go to the documentation of this file.
1// Copyright (C) 2020 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com>
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "qanystringview.h"
5#include "qdebug.h"
6#include "qttypetraits.h"
7
9
450
453
465
467
635{
636 struct S { const char *prefix, *suffix; };
637 const auto affixes = s.visit([](auto s) {
638 using View = decltype(s);
639 if constexpr (std::is_same_v<View, QLatin1StringView>) {
640 return S{"", "_L1"};
641 } else if constexpr (std::is_same_v<View, QUtf8StringView>) {
642 return S{"u8", ""};
643 } else if constexpr (std::is_same_v<View, QStringView>) {
644 return S{"u", ""};
645 } else {
647 }
648 });
649 const QDebugStateSaver saver(d);
650 d.nospace();
651 if (d.quoteStrings())
652 d << affixes.prefix;
653 s.visit([&d](auto s) { d << s; });
654 if (d.quoteStrings())
655 d << affixes.suffix;
656 return d;
657}
658
659
\inmodule QtCore
\inmodule QtCore
\inmodule QtCore
Combined button and popup list for selecting options.
QDebug operator<<(QDebug d, QAnyStringView s)
GLdouble s
[6]
Definition qopenglext.h:235