diff options
Diffstat (limited to 'src/string_utils.hh')
| -rw-r--r-- | src/string_utils.hh | 5 |
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 |
