123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- #ifndef BOOST_MYSQL_ESCAPE_STRING_HPP
- #define BOOST_MYSQL_ESCAPE_STRING_HPP
- #include <boost/mysql/error_code.hpp>
- #include <boost/mysql/string_view.hpp>
- #include <boost/mysql/detail/escape_string.hpp>
- #include <boost/mysql/detail/output_string.hpp>
- #include <boost/config.hpp>
- namespace boost {
- namespace mysql {
- struct format_options;
- enum class quoting_context : char
- {
-
- double_quote = '"',
-
- single_quote = '\'',
-
- backtick = '`',
- };
- template <BOOST_MYSQL_OUTPUT_STRING OutputString>
- BOOST_ATTRIBUTE_NODISCARD error_code
- escape_string(string_view input, const format_options& opts, quoting_context quot_ctx, OutputString& output)
- {
- output.clear();
- return detail::escape_string(
- input,
- opts,
- static_cast<char>(quot_ctx),
- detail::output_string_ref::create(output)
- );
- }
- }
- }
- #endif
|