24 static const QList<QString > sSeps{
"=>",
"," };
27 while ( i <
string.length() )
29 while ( i <
string.length() &&
string.at( i ).isSpace() )
31 const QString current =
string.mid( i );
32 const QString sep = sSeps.at( bits.length() );
33 if ( current.startsWith(
'"' ) )
35 const thread_local QRegularExpression re( QStringLiteral(
"^\"((?:\\\\.|[^\"\\\\])*)\".*" ) );
36 const QRegularExpressionMatch match = re.match( current );
38 if ( match.hasMatch() )
40 bits[bits.length() - 1] = match.captured( 1 ).replace( QLatin1String(
"\\\"" ), QLatin1String(
"\"" ) ).replace( QLatin1String(
"\\\\" ), QLatin1String(
"\\" ) );
41 i += match.captured( 1 ).length() + 2;
42 while ( i <
string.length() &&
string.at( i ).isSpace() )
45 if ( QStringView{
string}.mid( i ).startsWith( sep ) )
49 else if ( i <
string.length() )
52 i += current.length();
58 i += current.length();
59 bits[bits.length() - 1] = current.trimmed();
64 const int sepPos = current.indexOf( sep );
67 i += current.length();
68 bits << current.trimmed();
72 i += sepPos + sep.length();
73 bits << current.left( sepPos ).trimmed();
77 if ( bits.length() == 2 )
79 if ( !bits.at( 0 ).isEmpty() && !bits.at( 1 ).isEmpty() )
80 map[ bits.at( 0 ) ] = bits.at( 1 );