From 91cc9fc5f95de0d800dd4da46fc3fbe262258390 Mon Sep 17 00:00:00 2001 From: Christian Tismer Date: Fri, 12 Jun 2020 12:00:52 +0200 Subject: signature: use raw strings when needed, only This is more convenient for developers who deal with signatures quite often. Change-Id: I009eaa854e0df02afc0e07954d743821dbc1e33c Reviewed-by: Friedemann Kleint --- sources/shiboken2/generator/shiboken2/cppgenerator.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'sources') diff --git a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp index 4c637e701..840318020 100644 --- a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp +++ b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp @@ -4983,8 +4983,13 @@ void CppGenerator::writeSignatureStrings(QTextStream &s, s << "// Multiple signatures have their index \"n:\" in front.\n"; s << "static const char *" << arrayName << "_SignatureStrings[] = {\n"; QString line; - while (signatureStream.readLineInto(&line)) - s << INDENT << "R\"CPP(" << line << ")CPP\",\n"; + while (signatureStream.readLineInto(&line)) { + // must anything be escaped? + if (line.contains(QLatin1Char('"')) || line.contains(QLatin1Char('\\'))) + s << INDENT << "R\"CPP(" << line << ")CPP\",\n"; + else + s << INDENT << '"' << line << "\",\n"; + } s << INDENT << NULL_PTR << "}; // Sentinel\n\n"; } -- cgit v1.2.3