summaryrefslogtreecommitdiffstats
path: root/base/json/string_escape.cc
diff options
context:
space:
mode:
Diffstat (limited to 'base/json/string_escape.cc')
-rw-r--r--base/json/string_escape.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/base/json/string_escape.cc b/base/json/string_escape.cc
index 4e1418c..5bf0b86 100644
--- a/base/json/string_escape.cc
+++ b/base/json/string_escape.cc
@@ -82,10 +82,22 @@ void JsonDoubleQuote(const std::string& str,
JsonDoubleQuoteT(str, put_in_quotes, dst);
}
+std::string GetDoubleQuotedJson(const std::string& str) {
+ std::string dst;
+ JsonDoubleQuote(str, true, &dst);
+ return dst;
+}
+
void JsonDoubleQuote(const string16& str,
bool put_in_quotes,
std::string* dst) {
JsonDoubleQuoteT(str, put_in_quotes, dst);
}
+std::string GetDoubleQuotedJson(const string16& str) {
+ std::string dst;
+ JsonDoubleQuote(str, true, &dst);
+ return dst;
+}
+
} // namespace base