27 static const QList<QString > sSeps{
"=>",
"," };
30 while ( i <
string.length() )
32 while ( i <
string.length() &&
string.at( i ).isSpace() )
34 const QString current =
string.mid( i );
35 const QString sep = sSeps.at( bits.length() );
36 if ( current.startsWith(
'"' ) )
38 const thread_local QRegularExpression re( u
"^\"((?:\\\\.|[^\"\\\\])*)\".*"_s );
39 const QRegularExpressionMatch match = re.match( current );
41 if ( match.hasMatch() )
43 bits[bits.length() - 1] = match.captured( 1 ).replace(
"\\\""_L1,
"\""_L1 ).replace(
"\\\\"_L1,
"\\"_L1 );
44 i += match.captured( 1 ).length() + 2;
45 while ( i <
string.length() &&
string.at( i ).isSpace() )
48 if ( QStringView{
string}.mid( i ).startsWith( sep ) )
52 else if ( i <
string.length() )
55 i += current.length();
61 i += current.length();
62 bits[bits.length() - 1] = current.trimmed();
67 const int sepPos = current.indexOf( sep );
70 i += current.length();
71 bits << current.trimmed();
75 i += sepPos + sep.length();
76 bits << current.left( sepPos ).trimmed();
80 if ( bits.length() == 2 )
82 if ( !bits.at( 0 ).isEmpty() && !bits.at( 1 ).isEmpty() )
83 map[ bits.at( 0 ) ] = bits.at( 1 );