diff --git a/include/orm/tiny/utils/string.hpp b/include/orm/tiny/utils/string.hpp index 2dc6e80cf..a334bf3f6 100644 --- a/include/orm/tiny/utils/string.hpp +++ b/include/orm/tiny/utils/string.hpp @@ -35,10 +35,12 @@ namespace Orm::Tiny::Utils /*! Convert a value to studly caps case. */ static QString studly(QString string); -#ifndef TINYORM_DISABLE_TOM +#if !defined(TINYORM_DISABLE_TOM) || !defined(TINYORM_DISABLE_ORM) /*! Check if the given string is the number, signed or unsigned. */ static bool isNumber(QStringView string, bool allowFloating = false); +#endif +#if !defined(TINYORM_DISABLE_TOM) /*! Split a string by the given width (not in the middle of a word). */ static std::vector splitStringByWidth(const QString &string, int width); diff --git a/src/orm/tiny/utils/string.cpp b/src/orm/tiny/utils/string.cpp index 407782c10..ebe6ac4d4 100644 --- a/src/orm/tiny/utils/string.cpp +++ b/src/orm/tiny/utils/string.cpp @@ -113,7 +113,7 @@ QString String::studly(QString string) return (*studlyCache)[std::move(key)] = value.replace(SPACE, ""); } -#ifndef TINYORM_DISABLE_TOM +#if !defined(TINYORM_DISABLE_TOM) || !defined(TINYORM_DISABLE_ORM) bool String::isNumber(const QStringView string, const bool allowFloating) { /* Performance boost was amazing after the QRegularExpression has been removed, @@ -150,7 +150,9 @@ bool String::isNumber(const QStringView string, const bool allowFloating) return nonDigit == string.cend(); } +#endif +#ifndef TINYORM_DISABLE_TOM namespace { #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)