summaryrefslogtreecommitdiff
path: root/src/string_utils.hh
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2018-05-31 20:59:21 +1000
committerMaxime Coste <mawww@kakoune.org>2018-07-05 07:54:28 +1000
commit8b2e5ea862c748e13fbfd49ee3a00c8918d3ee10 (patch)
treef29adb218b2e37187efb36089d08f38d039ed959 /src/string_utils.hh
parent2729042f83493d76cc9b135c45f326eaf878bec4 (diff)
Make selection lists use the option list syntax
Diffstat (limited to 'src/string_utils.hh')
-rw-r--r--src/string_utils.hh5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/string_utils.hh b/src/string_utils.hh
index bd803536..61a28cad 100644
--- a/src/string_utils.hh
+++ b/src/string_utils.hh
@@ -128,6 +128,11 @@ StringView format_to(ArrayView<char> buffer, StringView fmt, Types&&... params)
return format_to(buffer, fmt, ArrayView<const StringView>{detail::format_param(std::forward<Types>(params))...});
}
+inline String quote(StringView s)
+{
+ return format("'{}'", replace(s, "'", "''"));
+}
+
}
#endif // string_utils_hh_INCLUDED