From efcea3a80da7c4479d5fe168435ecc9fd06bdc72 Mon Sep 17 00:00:00 2001 From: John Turner Date: Sun, 14 Sep 2025 00:16:10 -0400 Subject: Squashed 'subprojects/boost-sqlite/' content from commit 3378e35 git-subtree-dir: subprojects/boost-sqlite git-subtree-split: 3378e353705271e569cf4ba15c467b840a39798c --- include/boost/sqlite/string.hpp | 49 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 include/boost/sqlite/string.hpp (limited to 'include/boost/sqlite/string.hpp') diff --git a/include/boost/sqlite/string.hpp b/include/boost/sqlite/string.hpp new file mode 100644 index 0000000..5a81978 --- /dev/null +++ b/include/boost/sqlite/string.hpp @@ -0,0 +1,49 @@ +// Copyright (c) 2023 Klemens D. Morgenstern +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#ifndef BOOST_SQLITE_STRING_HPP +#define BOOST_SQLITE_STRING_HPP + +#include +#include + +BOOST_SQLITE_BEGIN_NAMESPACE + +inline +bool like( + cstring_ref lhs, + cstring_ref rhs, + char escape = '\0') +{ + return sqlite3_strlike(lhs.c_str(), rhs.c_str(), escape) != 0; +} + +inline +bool glob( + cstring_ref lhs, + cstring_ref rhs) +{ + return sqlite3_strglob(lhs.c_str(), rhs.c_str()) != 0; +} + +inline +int icmp( + cstring_ref lhs, + cstring_ref rhs) +{ + return sqlite3_stricmp(lhs.c_str(), rhs.c_str()); +} + +inline +int icmp( + core::string_view lhs, + core::string_view rhs, + std::size_t n) +{ + return sqlite3_strnicmp(lhs.data(), rhs.data(), static_cast(n)); +} + +BOOST_SQLITE_END_NAMESPACE + +#endif //BOOST_SQLITE_STRING_HPP -- cgit v1.2.3