diff options
author | Christian Tismer <tismer@stackless.com> | 2020-06-12 12:00:52 +0200 |
---|---|---|
committer | Christian Tismer <tismer@stackless.com> | 2020-06-12 15:03:21 +0200 |
commit | 91cc9fc5f95de0d800dd4da46fc3fbe262258390 (patch) | |
tree | a7fc7aa55e194e5648819c5d0aee2fa7a5989676 /sources | |
parent | 066957b44c83ed3cbadeda756923d1a891ecee72 (diff) |
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 <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources')
-rw-r--r-- | sources/shiboken2/generator/shiboken2/cppgenerator.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
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"; } |