18 #include <QRegularExpression>
23 slst.reserve( lst.size() );
26 QStringList indexPathStr;
27 const QVector<int> indexPath = ref.symbolLayerId().symbolLayerIndexPath();
28 indexPathStr.reserve( indexPath.size() );
29 for (
const int index : indexPath )
31 indexPathStr.append( QString::number( index ) );
35 slst.append( QStringLiteral(
"%1,%2,%3" ).arg( ref.layerId(), ref.symbolLayerId().symbolKey(), indexPathStr.join(
',' ) ) );
37 return slst.join(
';' );
48 const thread_local QRegularExpression partsRx( QStringLiteral(
"((?:.*?),(?:.*?),(?:(?:\\d+,)+)?(?:\\d+);)" ) );
49 QRegularExpressionMatchIterator partsIt = partsRx.globalMatch(
str +
';' );
51 while ( partsIt.hasNext() )
53 const QRegularExpressionMatch partMatch = partsIt.next();
54 const QString tuple = partMatch.captured( 1 );
59 const thread_local QRegularExpression rx( QStringLiteral(
"(.*?),(.*?),((?:\\d+,)+)?(\\d+)" ) );
61 const QRegularExpressionMatch match = rx.match( tuple );
62 if ( !match.hasMatch() )
65 const QString layerId = match.captured( 1 );
66 const QString symbolKey = match.captured( 2 );
67 const QStringList indices = QString( match.captured( 3 ) + match.captured( 4 ) ).split(
',' );
69 QVector<int> indexPath;
70 indexPath.reserve( indices.size() );
71 for (
const QString &index : indices )
73 indexPath.append( index.toInt() );