Skip to content
Extraits de code Groupes Projets
Vérifiée Valider 3ab21d4d rédigé par Kubat's avatar Kubat
Parcourir les fichiers

MISC: Can now use qDebug() with std::string and std::string_view,...

MISC: Can now use qDebug() with std::string and std::string_view, VIVY_ASSERT_STRING is now a qFatal
parent 22c17bbc
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!21Add clean logs support + dependent MR
...@@ -295,9 +295,19 @@ Utils::getAnyTopLevelDocumentFileSuffixFilter() noexcept ...@@ -295,9 +295,19 @@ Utils::getAnyTopLevelDocumentFileSuffixFilter() noexcept
void void
Utils::writeAssertLocation(const char *msg) Utils::writeAssertLocation(const char *msg)
{ {
static bool goBoom = qEnvironmentVariableIsSet("QTC_FATAL_ASSERTS"); qFatal("ASSERT: %s", msg);
if (goBoom) }
qFatal("SOFT ASSERT made fatal: %s", msg);
else QDebug &
qDebug("SOFT ASSERT: %s", msg); operator<<(QDebug &stream, const std::string str) noexcept
{
stream << str.c_str();
return stream;
}
QDebug &
operator<<(QDebug &stream, const std::string_view strv) noexcept
{
stream << std::string(strv);
return stream;
} }
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
#define VIVY_EXPORT __attribute__((visibility("default"))) #define VIVY_EXPORT __attribute__((visibility("default")))
#define VIVY_NO_EXPORT __attribute__((visibility("hidden"))) #define VIVY_NO_EXPORT __attribute__((visibility("hidden")))
#define VIVY_DEPRECATED __attribute__((__deprecated__)) #define VIVY_DEPRECATED __attribute__((__deprecated__))
#define VIVY_CONSTRUCTOR __attribute__((constructor))
#define VIVY_DESTRUCTOR __attribute__((destructor))
// Use chrono instead of std::chrono... // Use chrono instead of std::chrono...
namespace chrono = std::chrono; namespace chrono = std::chrono;
...@@ -40,6 +42,10 @@ namespace chrono = std::chrono; ...@@ -40,6 +42,10 @@ namespace chrono = std::chrono;
// QStringLiteral but for regexes // QStringLiteral but for regexes
#define QRegExpLiteral(str) QRegExp(QStringLiteral(str)) #define QRegExpLiteral(str) QRegExp(QStringLiteral(str))
// Log things for qDebug()
QDebug &operator<<(QDebug &, const std::string) noexcept;
QDebug &operator<<(QDebug &, const std::string_view) noexcept;
namespace Vivy namespace Vivy
{ {
// Concept for classes that can be viewd inside a property view // Concept for classes that can be viewd inside a property view
...@@ -162,8 +168,7 @@ int decodeLineToInteger(const QString &item, const QString &error); ...@@ -162,8 +168,7 @@ int decodeLineToInteger(const QString &item, const QString &error);
float decodeLineToFloating(const QString &item, const QString &error); float decodeLineToFloating(const QString &item, const QString &error);
QString getBaseName(const QString &) noexcept; QString getBaseName(const QString &) noexcept;
[[noreturn]] void writeAssertLocation(const char *msg);
void writeAssertLocation(const char *msg);
struct OsSpecificAspects final { struct OsSpecificAspects final {
private: private:
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter