Don't use unnamed namespace in qlocale_p.h
Pointed out by CodeChecker. It's included by plenty of places, so duplicating that anonymous namespace potential code duplication. Use QtPrivate namespace instead. Change-Id: I9ccfd569089ea01a8be9ffd87889bca73b70dd9c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This commit is contained in:
parent
eaae969ac6
commit
0b66d4a3d4
@ -3920,7 +3920,7 @@ class NumericTokenizer
|
|||||||
// TODO: use deterministic finite-state-automata.
|
// TODO: use deterministic finite-state-automata.
|
||||||
// TODO QTBUG-95460: CLDR has Inf/NaN representations per locale.
|
// TODO QTBUG-95460: CLDR has Inf/NaN representations per locale.
|
||||||
static constexpr char lettersInfNaN[] = "afin"; // Letters of Inf, NaN
|
static constexpr char lettersInfNaN[] = "afin"; // Letters of Inf, NaN
|
||||||
static constexpr auto matchInfNaN = makeCharacterSetMatch<lettersInfNaN>();
|
static constexpr auto matchInfNaN = QtPrivate::makeCharacterSetMatch<lettersInfNaN>();
|
||||||
const QStringView m_text;
|
const QStringView m_text;
|
||||||
const QLocaleData::NumericData m_guide;
|
const QLocaleData::NumericData m_guide;
|
||||||
qsizetype m_index = 0;
|
qsizetype m_index = 0;
|
||||||
|
@ -55,8 +55,8 @@ template <typename MaskType, uchar Lowest> struct QCharacterSetMatch
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace {
|
namespace QtPrivate {
|
||||||
static constexpr char ascii_space_chars[] =
|
inline constexpr char ascii_space_chars[] =
|
||||||
"\t" // 9: HT - horizontal tab
|
"\t" // 9: HT - horizontal tab
|
||||||
"\n" // 10: LF - line feed
|
"\n" // 10: LF - line feed
|
||||||
"\v" // 11: VT - vertical tab
|
"\v" // 11: VT - vertical tab
|
||||||
@ -64,7 +64,8 @@ static constexpr char ascii_space_chars[] =
|
|||||||
"\r" // 13: CR - carriage return
|
"\r" // 13: CR - carriage return
|
||||||
" "; // 32: space
|
" "; // 32: space
|
||||||
|
|
||||||
template <const char *Set, int ForcedLowest = -1> static constexpr auto makeCharacterSetMatch()
|
template <const char *Set, int ForcedLowest = -1>
|
||||||
|
inline constexpr auto makeCharacterSetMatch()
|
||||||
{
|
{
|
||||||
constexpr auto view = std::string_view(Set);
|
constexpr auto view = std::string_view(Set);
|
||||||
constexpr uchar MinElement = *std::min_element(view.begin(), view.end());
|
constexpr uchar MinElement = *std::min_element(view.begin(), view.end());
|
||||||
@ -87,7 +88,7 @@ template <const char *Set, int ForcedLowest = -1> static constexpr auto makeChar
|
|||||||
return QCharacterSetMatch<MaskType, MinElement>(view);
|
return QCharacterSetMatch<MaskType, MinElement>(view);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // unnamed namespace
|
} // QtPrivate
|
||||||
|
|
||||||
struct QLocaleData;
|
struct QLocaleData;
|
||||||
// Subclassed by Android platform plugin:
|
// Subclassed by Android platform plugin:
|
||||||
@ -536,7 +537,7 @@ QString qt_readEscapedFormatString(QStringView format, qsizetype *idx);
|
|||||||
|
|
||||||
[[nodiscard]] constexpr inline bool ascii_isspace(uchar c)
|
[[nodiscard]] constexpr inline bool ascii_isspace(uchar c)
|
||||||
{
|
{
|
||||||
constexpr auto matcher = makeCharacterSetMatch<ascii_space_chars>();
|
constexpr auto matcher = QtPrivate::makeCharacterSetMatch<QtPrivate::ascii_space_chars>();
|
||||||
return matcher.matches(c);
|
return matcher.matches(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user