Marble
LonLatParser.cpp
46 getLocaleList(m_northLocale, GeoDataCoordinates::tr("*", "North direction terms"), placeholder, separator);
48 getLocaleList(m_eastLocale, GeoDataCoordinates::tr("*", "East direction terms"), placeholder, separator);
50 getLocaleList(m_southLocale, GeoDataCoordinates::tr("*", "South direction terms"), placeholder, separator);
52 getLocaleList(m_westLocale, GeoDataCoordinates::tr("*", "West direction terms"), placeholder, separator);
76 m_dirCapExp = QLatin1Char('(') + fullNamesExp + QLatin1Char('[') + simpleLetters + QLatin1StringView("])");
80 getLocaleList(m_degreeLocale, GeoDataCoordinates::tr("*", "Degree symbol terms"), placeholder, separator);
82 getLocaleList(m_minutesLocale, GeoDataCoordinates::tr("*", "Minutes symbol terms"), placeholder, separator);
84 getLocaleList(m_secondsLocale, GeoDataCoordinates::tr("*", "Seconds symbol terms"), placeholder, separator);
104 m_secondsExp = QStringLiteral(u"\"|\u2033|\u201D|''|\u2032\u2032|\u00B4\u00B4|\u20C2\u20C2|\u2019\u2019");
116 const QString numberCapExp = QStringLiteral("\\A(?:") + QStringLiteral("([-+]?\\d{1,3}%1?\\d*(?:[eE][+-]?\\d+)?)(?:,|;|\\s)\\s*").arg(m_decimalPointExp)
117 + QStringLiteral("([-+]?\\d{1,3}%1?\\d*(?:[eE][+-]?\\d+)?)").arg(m_decimalPointExp) + QStringLiteral(")\\z");
162 const QString postfixCapExp = QStringLiteral("\\A(?:") + QStringLiteral("([-+]?)(\\d{1,3})(?:%3|\\s)\\s*(\\d{1,2})(?:%4|\\s)\\s*")
163 + QStringLiteral("(\\d{1,2}%1?\\d*)(?:%5)?\\s*%2[,;]?\\s*") + QStringLiteral("([-+]?)(\\d{1,3})(?:%3|\\s)\\s*(\\d{1,2})(?:%4|\\s)\\s*")
167 const QString prefixCapExp = QStringLiteral("\\A(?:") + QStringLiteral("%2\\s*([-+]?)(\\d{1,3})(?:%3|\\s)\\s*(\\d{1,2})(?:%4|\\s)\\s*")
168 + QStringLiteral("(\\d{1,2}%1?\\d*)(?:%5)?\\s*(?:,|;|\\s)\\s*") + QStringLiteral("%2\\s*([-+]?)(\\d{1,3})(?:%3|\\s)\\s*(\\d{1,2})(?:%4|\\s)\\s*")
173 const QString numberCapExp = expTemplate.arg(m_decimalPointExp, m_dirCapExp, m_degreeExp, m_minutesExp, m_secondsExp);
186 if (!isCorrectDirections(dir1, dir2, isDir1LonDir, isLonDirPosHemisphere, isLatDirPosHemisphere)) {
192 m_lon = degreeValueFromDMS(match, isDir1LonDir ? valueStartIndex1 : valueStartIndex2, isLonDirPosHemisphere);
193 m_lat = degreeValueFromDMS(match, isDir1LonDir ? valueStartIndex2 : valueStartIndex1, isLatDirPosHemisphere);
202 const QString postfixCapExp = QStringLiteral("\\A(?:") + QStringLiteral("([-+]?)(\\d{1,3})(?:%3|\\s)\\s*(\\d{1,2}%1?\\d*)(?:%4)?\\s*%2[,;]?\\s*")
203 + QStringLiteral("([-+]?)(\\d{1,3})(?:%3|\\s)\\s*(\\d{1,2}%1?\\d*)(?:%4)?\\s*%2") + QStringLiteral(")\\z");
206 const QString prefixCapExp = QStringLiteral("\\A(?:") + QStringLiteral("%2\\s*([-+]?)(\\d{1,3})(?:%3|\\s)\\s*(\\d{1,2}%1?\\d*)(?:%4)?\\s*(?:,|;|\\s)\\s*")
207 + QStringLiteral("%2\\s*([-+]?)(\\d{1,3})(?:%3|\\s)\\s*(\\d{1,2}%1?\\d*)(?:%4)?") + QStringLiteral(")\\z");
211 const QString numberCapExp = expTemplate.arg(m_decimalPointExp, m_dirCapExp, m_degreeExp, m_minutesExp);
223 if (!isCorrectDirections(dir1, dir2, isDir1LonDir, isLonDirPosHemisphere, isLatDirPosHemisphere)) {
229 m_lon = degreeValueFromDM(match, isDir1LonDir ? valueStartIndex1 : valueStartIndex2, isLonDirPosHemisphere);
230 m_lat = degreeValueFromDM(match, isDir1LonDir ? valueStartIndex2 : valueStartIndex1, isLatDirPosHemisphere);
239 const QString postfixCapExp = QStringLiteral("\\A(?:") + QStringLiteral("([-+]?\\d{1,3}%1?\\d*)(?:%3)?(?:\\s*)%2(?:,|;|\\s)\\s*")
243 const QString prefixCapExp = QStringLiteral("\\A(?:") + QStringLiteral("%2\\s*([-+]?\\d{1,3}%1?\\d*)(?:%3)?\\s*(?:,|;|\\s)\\s*")
263 if (!isCorrectDirections(dir1, dir2, isDir1LonDir, isLonDirPosHemisphere, isLatDirPosHemisphere)) {
269 m_lon = degreeValueFromD(match, isDir1LonDir ? valueStartIndex1 : valueStartIndex2, isLonDirPosHemisphere);
270 m_lat = degreeValueFromD(match, isDir1LonDir ? valueStartIndex2 : valueStartIndex1, isLatDirPosHemisphere);
289 return (decimalPoint == QLatin1StringView(".")) ? QStringLiteral("\\.") : QLatin1StringView("[.") + decimalPoint + QLatin1Char(']');
292void LonLatParser::getLocaleList(QStringList &localeList, const QString &localeListString, const QLatin1String &placeholder, const QString &separator)
310bool LonLatParser::isOneOfDirections(const QString &input, const QString &firstDirection, const QString &secondDirection, bool &isFirstDirection)
316bool LonLatParser::isOneOfDirections(const QString &input, const QStringList &firstDirections, const QStringList &secondDirections, bool &isFirstDirection)
342qreal LonLatParser::degreeValueFromDMS(const QRegularExpressionMatch ®exMatch, int c, bool isPosHemisphere)
361qreal LonLatParser::degreeValueFromDM(const QRegularExpressionMatch ®exMatch, int c, bool isPosHemisphere)
379qreal LonLatParser::degreeValueFromD(const QRegularExpressionMatch ®exMatch, int c, bool isPosHemisphere)
399 : (isLocaleLatDirection(dir1, isLatDirPosHemisphere) && isLocaleLonDirection(dir2, isLonDirPosHemisphere));
KCOREADDONS_EXPORT Result match(QStringView pattern, QStringView str)
KIOCORE_EXPORT QString dir(const QString &fileClass)
Binds a QML item to a specific geodetic location in screen coordinates.
Definition AbstractDataPlugin.cpp:23
QString decimalPoint() const const
QLocale system()
double toDouble(QStringView s, bool *ok) const const
QString escape(QStringView str)
QString captured(QStringView name) const const
QString arg(Args &&... args) const const
const QChar at(qsizetype position) const const
bool contains(QChar ch, Qt::CaseSensitivity cs) const const
qsizetype length() const const
QStringList split(QChar sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const const
double toDouble(bool *ok) const const
QString toLower() const const
uint toUInt(bool *ok, int base) const const
QString trimmed() const const
bool contains(QLatin1StringView str, Qt::CaseSensitivity cs) const const
SkipEmptyParts
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:52:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:52:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.