diff options
Diffstat (limited to 'src/util/smt2_quote_string.cpp')
-rw-r--r-- | src/util/smt2_quote_string.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/util/smt2_quote_string.cpp b/src/util/smt2_quote_string.cpp index 82750c48b..e2ab4a74c 100644 --- a/src/util/smt2_quote_string.cpp +++ b/src/util/smt2_quote_string.cpp @@ -42,4 +42,16 @@ std::string quoteSymbol(const std::string& s){ return s; } +std::string quoteString(const std::string& s) { + // escape all double-quotes + std::string output = s; + size_t pos = 0; + while ((pos = output.find('"', pos)) != std::string::npos) + { + output.replace(pos, 1, "\"\""); + pos += 2; + } + return '"' + output + '"'; +} + } // namespace cvc5 |