summaryrefslogtreecommitdiff
path: root/src/util/smt2_quote_string.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/smt2_quote_string.cpp')
-rw-r--r--src/util/smt2_quote_string.cpp12
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
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback